Skip to content

Commit

Permalink
Add temporary navigation scheme option
Browse files Browse the repository at this point in the history
  • Loading branch information
ryevdokimov committed Feb 19, 2024
1 parent 4b549b1 commit b7a8ea4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion editor/editor_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
// 3D: Navigation
_initial_set("editors/3d/navigation/invert_x_axis", false);
_initial_set("editors/3d/navigation/invert_y_axis", false);
EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "editors/3d/navigation/navigation_scheme", 0, "Godot,Maya,Modo")
EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "editors/3d/navigation/navigation_scheme", 0, "Godot,Maya,Modo,Temp")
EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "editors/3d/navigation/zoom_style", 0, "Vertical,Horizontal")

_initial_set("editors/3d/navigation/emulate_numpad", false);
Expand Down
6 changes: 3 additions & 3 deletions editor/plugins/node_3d_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1839,7 +1839,9 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {

clicked = ObjectID();

if (after != EditorPlugin::AFTER_GUI_INPUT_CUSTOM && !b->is_alt_pressed()) {
bool node_selected = get_selected_count() > 0;

if (after != EditorPlugin::AFTER_GUI_INPUT_CUSTOM && (!b->is_alt_pressed() && (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT || !node_selected || nav_scheme == NAVIGATION_TEMP))) {
//clicking is always deferred to either move or release
clicked = _select_ray(b->get_position());
if (clicked.is_valid() && !editor_selection->is_selected(Object::cast_to<Node>(ObjectDB::get_instance(clicked)))) {
Expand All @@ -1856,8 +1858,6 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
}
}

bool node_selected = get_selected_count() > 0;

if (node_selected && ((spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT && b->is_command_or_control_pressed()) || spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_ROTATE)) {
begin_transform(TRANSFORM_ROTATE, false);
break;
Expand Down
1 change: 1 addition & 0 deletions editor/plugins/node_3d_editor_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ class Node3DEditorViewport : public Control {
NAVIGATION_GODOT,
NAVIGATION_MAYA,
NAVIGATION_MODO,
NAVIGATION_TEMP,
};

enum FreelookNavigationScheme {
Expand Down

0 comments on commit b7a8ea4

Please sign in to comment.