diff options
Diffstat (limited to 'editor')
31 files changed, 379 insertions, 339 deletions
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index 157a9cdca7..77e20b971c 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -226,6 +226,10 @@ void FindReplaceBar::_replace_all() { text_edit->begin_complex_operation(); + if (selection_enabled && is_selection_only()) { + text_edit->cursor_set_line(selection_begin.width); + text_edit->cursor_set_column(selection_begin.height); + } if (search_current()) { do { // replace area @@ -243,7 +247,7 @@ void FindReplaceBar::_replace_all() { if (selection_enabled && is_selection_only()) { if (match_from < selection_begin || match_to > selection_end) { - continue; + break; // Done. } // Replace but adjust selection bounds. @@ -289,6 +293,10 @@ void FindReplaceBar::_get_search_from(int &r_line, int &r_col) { r_line = text_edit->cursor_get_line(); r_col = text_edit->cursor_get_column(); + if (text_edit->is_selection_active() && is_selection_only()) { + return; + } + if (r_line == result_line && r_col >= result_col && r_col <= result_col + get_search_text().length()) { r_col = result_col; } diff --git a/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp index ed628ff620..6917b2b775 100644 --- a/editor/editor_autoload_settings.cpp +++ b/editor/editor_autoload_settings.cpp @@ -48,8 +48,6 @@ void EditorAutoloadSettings::_notification(int p_what) { ResourceLoader::get_recognized_extensions_for_type("Script", &afn); ResourceLoader::get_recognized_extensions_for_type("PackedScene", &afn); - EditorFileDialog *file_dialog = autoload_add_path->get_file_dialog(); - for (List<String>::Element *E = afn.front(); E; E = E->next()) { file_dialog->add_filter("*." + E->get()); @@ -61,6 +59,9 @@ void EditorAutoloadSettings::_notification(int p_what) { get_tree()->get_root()->call_deferred("add_child", info.node); } } + browse_button->set_icon(get_theme_icon("Folder", "EditorIcons")); + } else if (p_what == NOTIFICATION_THEME_CHANGED) { + browse_button->set_icon(get_theme_icon("Folder", "EditorIcons")); } } @@ -116,8 +117,8 @@ bool EditorAutoloadSettings::_autoload_name_is_valid(const String &p_name, Strin void EditorAutoloadSettings::_autoload_add() { - if (autoload_add(autoload_add_name->get_text(), autoload_add_path->get_line_edit()->get_text())) - autoload_add_path->get_line_edit()->set_text(""); + if (autoload_add(autoload_add_name->get_text(), autoload_add_path->get_text())) + autoload_add_path->set_text(""); autoload_add_name->set_text(""); add_autoload->set_disabled(true); @@ -326,7 +327,7 @@ void EditorAutoloadSettings::_autoload_file_callback(const String &p_path) { void EditorAutoloadSettings::_autoload_text_entered(const String p_name) { - if (autoload_add_path->get_line_edit()->get_text() != "" && _autoload_name_is_valid(p_name, nullptr)) { + if (autoload_add_path->get_text() != "" && _autoload_name_is_valid(p_name, nullptr)) { _autoload_add(); } } @@ -340,7 +341,7 @@ void EditorAutoloadSettings::_autoload_path_text_changed(const String p_path) { void EditorAutoloadSettings::_autoload_text_changed(const String p_name) { add_autoload->set_disabled( - autoload_add_path->get_line_edit()->get_text() == "" || !_autoload_name_is_valid(p_name, nullptr)); + autoload_add_path->get_text() == "" || !_autoload_name_is_valid(p_name, nullptr)); } Node *EditorAutoloadSettings::_create_autoload(const String &p_path) { @@ -823,13 +824,24 @@ EditorAutoloadSettings::EditorAutoloadSettings() { l->set_text(TTR("Path:")); hbc->add_child(l); - autoload_add_path = memnew(EditorLineEditFileChooser); - autoload_add_path->set_h_size_flags(SIZE_EXPAND_FILL); - autoload_add_path->get_file_dialog()->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE); - autoload_add_path->get_file_dialog()->connect("file_selected", callable_mp(this, &EditorAutoloadSettings::_autoload_file_callback)); - autoload_add_path->get_line_edit()->connect("text_changed", callable_mp(this, &EditorAutoloadSettings::_autoload_path_text_changed)); - + autoload_add_path = memnew(LineEdit); hbc->add_child(autoload_add_path); + autoload_add_path->set_h_size_flags(Control::SIZE_EXPAND_FILL); + autoload_add_path->connect("text_changed", callable_mp(this, &EditorAutoloadSettings::_autoload_path_text_changed)); + + browse_button = memnew(Button); + hbc->add_child(browse_button); + browse_button->connect("pressed", callable_mp(this, &EditorAutoloadSettings::_browse_autoload_add_path)); + + file_dialog = memnew(EditorFileDialog); + hbc->add_child(file_dialog); + file_dialog->connect("file_selected", callable_mp(this, &EditorAutoloadSettings::_set_autoload_add_path)); + file_dialog->connect("dir_selected", callable_mp(this, &EditorAutoloadSettings::_set_autoload_add_path)); + file_dialog->connect("files_selected", callable_mp(this, &EditorAutoloadSettings::_set_autoload_add_path)); + + hbc->set_h_size_flags(SIZE_EXPAND_FILL); + file_dialog->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE); + file_dialog->connect("file_selected", callable_mp(this, &EditorAutoloadSettings::_autoload_file_callback)); l = memnew(Label); l->set_text(TTR("Node Name:")); @@ -890,3 +902,14 @@ EditorAutoloadSettings::~EditorAutoloadSettings() { } } } + +void EditorAutoloadSettings::_set_autoload_add_path(const String &p_text) { + + autoload_add_path->set_text(p_text); + autoload_add_path->emit_signal("text_entered", p_text); +} + +void EditorAutoloadSettings::_browse_autoload_add_path() { + + file_dialog->popup_centered_ratio(); +}
\ No newline at end of file diff --git a/editor/editor_autoload_settings.h b/editor/editor_autoload_settings.h index 2716442ec9..94a581401c 100644 --- a/editor/editor_autoload_settings.h +++ b/editor/editor_autoload_settings.h @@ -74,9 +74,11 @@ class EditorAutoloadSettings : public VBoxContainer { String selected_autoload; Tree *tree; - EditorLineEditFileChooser *autoload_add_path; LineEdit *autoload_add_name; Button *add_autoload; + LineEdit *autoload_add_path; + Button *browse_button; + EditorFileDialog *file_dialog; bool _autoload_name_is_valid(const String &p_name, String *r_error = nullptr); @@ -96,6 +98,9 @@ class EditorAutoloadSettings : public VBoxContainer { bool can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_control) const; void drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_control); + void _set_autoload_add_path(const String &p_text); + void _browse_autoload_add_path(); + protected: void _notification(int p_what); static void _bind_methods(); diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index 71ade56e39..6a06c6657e 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -1579,6 +1579,7 @@ EditorFileDialog::EditorFileDialog() { drives = memnew(OptionButton); drives->connect("item_selected", callable_mp(this, &EditorFileDialog::_select_drive)); + pathhb->add_child(drives); makedir = memnew(Button); makedir->set_text(TTR("Create Folder")); @@ -1733,42 +1734,3 @@ EditorFileDialog::~EditorFileDialog() { unregister_func(this); memdelete(dir_access); } - -void EditorLineEditFileChooser::_notification(int p_what) { - - if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) - button->set_icon(get_theme_icon("Folder", "EditorIcons")); -} - -void EditorLineEditFileChooser::_bind_methods() { - - ClassDB::bind_method(D_METHOD("get_button"), &EditorLineEditFileChooser::get_button); - ClassDB::bind_method(D_METHOD("get_line_edit"), &EditorLineEditFileChooser::get_line_edit); - ClassDB::bind_method(D_METHOD("get_file_dialog"), &EditorLineEditFileChooser::get_file_dialog); -} - -void EditorLineEditFileChooser::_chosen(const String &p_text) { - - line_edit->set_text(p_text); - line_edit->emit_signal("text_entered", p_text); -} - -void EditorLineEditFileChooser::_browse() { - - dialog->popup_centered_ratio(); -} - -EditorLineEditFileChooser::EditorLineEditFileChooser() { - - line_edit = memnew(LineEdit); - add_child(line_edit); - line_edit->set_h_size_flags(Control::SIZE_EXPAND_FILL); - button = memnew(Button); - add_child(button); - button->connect("pressed", callable_mp(this, &EditorLineEditFileChooser::_browse)); - dialog = memnew(EditorFileDialog); - add_child(dialog); - dialog->connect("file_selected", callable_mp(this, &EditorLineEditFileChooser::_chosen)); - dialog->connect("dir_selected", callable_mp(this, &EditorLineEditFileChooser::_chosen)); - dialog->connect("files_selected", callable_mp(this, &EditorLineEditFileChooser::_chosen)); -} diff --git a/editor/editor_file_dialog.h b/editor/editor_file_dialog.h index ed23f14ebe..8efb8f5368 100644 --- a/editor/editor_file_dialog.h +++ b/editor/editor_file_dialog.h @@ -245,28 +245,6 @@ public: ~EditorFileDialog(); }; -class EditorLineEditFileChooser : public HBoxContainer { - - GDCLASS(EditorLineEditFileChooser, HBoxContainer); - Button *button; - LineEdit *line_edit; - EditorFileDialog *dialog; - - void _chosen(const String &p_text); - void _browse(); - -protected: - void _notification(int p_what); - static void _bind_methods(); - -public: - Button *get_button() { return button; } - LineEdit *get_line_edit() { return line_edit; } - EditorFileDialog *get_file_dialog() { return dialog; } - - EditorLineEditFileChooser(); -}; - VARIANT_ENUM_CAST(EditorFileDialog::FileMode); VARIANT_ENUM_CAST(EditorFileDialog::Access); VARIANT_ENUM_CAST(EditorFileDialog::DisplayMode); diff --git a/editor/editor_help.h b/editor/editor_help.h index d9c7194003..2e053e674f 100644 --- a/editor/editor_help.h +++ b/editor/editor_help.h @@ -192,9 +192,9 @@ public: ~EditorHelp(); }; -class EditorHelpBit : public PanelContainer { +class EditorHelpBit : public MarginContainer { - GDCLASS(EditorHelpBit, PanelContainer); + GDCLASS(EditorHelpBit, MarginContainer); RichTextLabel *rich_text; void _go_to_help(String p_what); diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index c92d1d009d..a0f8b59117 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -1478,6 +1478,8 @@ void EditorInspector::update_tree() { String filter = search_box ? search_box->get_text() : ""; String group; String group_base; + String subgroup; + String subgroup_base; VBoxContainer *category_vbox = nullptr; List<PropertyInfo> @@ -1503,10 +1505,19 @@ void EditorInspector::update_tree() { //make sure the property can be edited - if (p.usage & PROPERTY_USAGE_GROUP) { + if (p.usage & PROPERTY_USAGE_SUBGROUP) { + + subgroup = p.name; + subgroup_base = p.hint_string; + + continue; + + } else if (p.usage & PROPERTY_USAGE_GROUP) { group = p.name; group_base = p.hint_string; + subgroup = ""; + subgroup_base = ""; continue; @@ -1514,6 +1525,8 @@ void EditorInspector::update_tree() { group = ""; group_base = ""; + subgroup = ""; + subgroup_base = ""; if (!show_categories) continue; @@ -1577,18 +1590,33 @@ void EditorInspector::update_tree() { } String basename = p.name; + + if (subgroup != "") { + if (subgroup_base != "") { + if (basename.begins_with(subgroup_base)) { + basename = basename.replace_first(subgroup_base, ""); + } else if (subgroup_base.begins_with(basename)) { + //keep it, this is used pretty often + } else { + subgroup = ""; //no longer using subgroup base, clear + } + } + } if (group != "") { - if (group_base != "") { + if (group_base != "" && subgroup == "") { if (basename.begins_with(group_base)) { basename = basename.replace_first(group_base, ""); } else if (group_base.begins_with(basename)) { //keep it, this is used pretty often } else { group = ""; //no longer using group base, clear + subgroup = ""; } } } - + if (subgroup != "") { + basename = subgroup + "/" + basename; + } if (group != "") { basename = group + "/" + basename; } diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index aeb3737120..d8f0a2764a 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -369,6 +369,13 @@ void EditorNode::_notification(int p_what) { RS::get_singleton()->environment_glow_set_use_bicubic_upscale(glow_bicubic); RS::EnvironmentSSRRoughnessQuality ssr_roughness_quality = RS::EnvironmentSSRRoughnessQuality(int(GLOBAL_GET("rendering/quality/screen_space_reflection/roughness_quality"))); RS::get_singleton()->environment_set_ssr_roughness_quality(ssr_roughness_quality); + RS::SubSurfaceScatteringQuality sss_quality = RS::SubSurfaceScatteringQuality(int(GLOBAL_GET("rendering/quality/subsurface_scattering/subsurface_scattering_quality"))); + RS::get_singleton()->sub_surface_scattering_set_quality(sss_quality); + float sss_scale = GLOBAL_GET("rendering/quality/subsurface_scattering/subsurface_scattering_scale"); + float sss_depth_scale = GLOBAL_GET("rendering/quality/subsurface_scattering/subsurface_scattering_depth_scale"); + RS::get_singleton()->sub_surface_scattering_set_scale(sss_scale, sss_depth_scale); + RS::ShadowFilter shadow_filter = RS::ShadowFilter(int(GLOBAL_GET("rendering/quality/shadows/filter_mode"))); + RS::get_singleton()->shadow_filter_set(shadow_filter); } ResourceImporterTexture::get_singleton()->update_imports(); @@ -3953,11 +3960,14 @@ void EditorNode::_copy_warning(const String &p_str) { } void EditorNode::_dock_floating_close_request(Control *p_control) { - Window *window = (Window *)p_control->get_parent(); + // Through the MarginContainer to the Window. + Window *window = (Window *)p_control->get_parent()->get_parent(); int window_slot = window->get_meta("dock_slot"); - window->remove_child(p_control); + p_control->get_parent()->remove_child(p_control); dock_slot[window_slot]->add_child(p_control); + dock_slot[window_slot]->move_child(p_control, MIN((int)window->get_meta("dock_index"), dock_slot[window_slot]->get_child_count())); + dock_slot[window_slot]->set_current_tab(window->get_meta("dock_index")); window->queue_delete(); @@ -3970,10 +3980,12 @@ void EditorNode::_dock_make_float() { Control *dock = dock_slot[dock_popup_selected]->get_current_tab_control(); ERR_FAIL_COND(!dock); - Size2 dock_size = dock->get_size(); //remember size - Point2 dock_screen_pos = dock->get_global_position() + get_tree()->get_root()->get_position(); + const Size2i borders = Size2i(4, 4) * EDSCALE; + Size2 dock_size = dock->get_size() + borders * 2; //remember size + Point2 dock_screen_pos = dock->get_global_position() + get_tree()->get_root()->get_position() - borders; print_line("dock pos: " + dock->get_global_position() + " window pos: " + get_tree()->get_root()->get_position()); + int dock_index = dock->get_index(); dock_slot[dock_popup_selected]->remove_child(dock); Window *window = memnew(Window); @@ -3982,14 +3994,22 @@ void EditorNode::_dock_make_float() { p->set_mode(Panel::MODE_FOREGROUND); p->set_anchors_and_margins_preset(Control::PRESET_WIDE); window->add_child(p); + MarginContainer *margin = memnew(MarginContainer); + margin->set_anchors_and_margins_preset(Control::PRESET_WIDE); + margin->add_theme_constant_override("margin_right", borders.width); + margin->add_theme_constant_override("margin_top", borders.height); + margin->add_theme_constant_override("margin_left", borders.width); + margin->add_theme_constant_override("margin_bottom", borders.height); + window->add_child(margin); dock->set_anchors_and_margins_preset(Control::PRESET_WIDE); - window->add_child(dock); + margin->add_child(dock); window->set_wrap_controls(true); window->set_size(dock_size); window->set_position(dock_screen_pos); window->set_transient(true); window->connect("close_requested", callable_mp(this, &EditorNode::_dock_floating_close_request), varray(dock)); window->set_meta("dock_slot", dock_popup_selected); + window->set_meta("dock_index", dock_index); gui_base->add_child(window); dock_select_popup->hide(); @@ -5914,7 +5934,7 @@ EditorNode::EditorNode() { dock_vb->add_child(dock_select); dock_float = memnew(Button); - dock_float->set_text("Make Floating"); + dock_float->set_text(TTR("Make Floating")); dock_float->set_focus_mode(Control::FOCUS_NONE); dock_float->set_h_size_flags(Control::SIZE_SHRINK_CENTER); dock_float->connect("pressed", callable_mp(this, &EditorNode::_dock_make_float)); diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 1f3ff1b332..cf478f20e5 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -2196,7 +2196,7 @@ void EditorPropertyResource::_menu_option(int p_which) { file_system_dock->navigate_to_path(res->get_path()); // Ensure that the FileSystem dock is visible. TabContainer *tab_container = (TabContainer *)file_system_dock->get_parent_control(); - tab_container->set_current_tab(file_system_dock->get_position_in_parent()); + tab_container->set_current_tab(file_system_dock->get_index()); } break; default: { diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 7ce6e3edb8..5d5bb1242d 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -341,6 +341,8 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { hints["interface/editor/unfocused_low_processor_mode_sleep_usec"] = PropertyInfo(Variant::FLOAT, "interface/editor/unfocused_low_processor_mode_sleep_usec", PROPERTY_HINT_RANGE, "1,100000,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); _initial_set("interface/editor/separate_distraction_mode", false); _initial_set("interface/editor/automatically_open_screenshots", true); + _initial_set("interface/editor/single_window_mode", false); + hints["interface/editor/single_window_mode"] = PropertyInfo(Variant::BOOL, "interface/editor/single_window_mode", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); _initial_set("interface/editor/hide_console_window", false); _initial_set("interface/editor/save_each_scene_on_quit", true); // Regression _initial_set("interface/editor/quit_confirmation", true); diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 663068b2b5..37bca661dd 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -977,8 +977,6 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_stylebox("focus", "RichTextLabel", make_empty_stylebox()); theme->set_stylebox("normal", "RichTextLabel", style_tree_bg); - theme->set_stylebox("panel", "EditorHelpBit", make_flat_stylebox(dark_color_1, 6, 4, 6, 4)); - theme->set_color("headline_color", "EditorHelp", mono_color); // Panel @@ -997,6 +995,9 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { // LinkButton theme->set_stylebox("focus", "LinkButton", style_empty); theme->set_color("font_color", "LinkButton", font_color); + theme->set_color("font_color_hover", "LinkButton", font_color_hl); + theme->set_color("font_color_pressed", "LinkButton", accent_color); + theme->set_color("font_color_disabled", "LinkButton", font_color_disabled); // TooltipPanel Ref<StyleBoxFlat> style_tooltip = style_popup->duplicate(); diff --git a/editor/icons/ViewportContainer.svg b/editor/icons/SubViewportContainer.svg index 18dcddc15f..18dcddc15f 100644 --- a/editor/icons/ViewportContainer.svg +++ b/editor/icons/SubViewportContainer.svg diff --git a/editor/import_dock.cpp b/editor/import_dock.cpp index 23be42aaea..22f6aedeaa 100644 --- a/editor/import_dock.cpp +++ b/editor/import_dock.cpp @@ -450,8 +450,8 @@ void ImportDock::_reimport() { String importer_name = params->importer->get_importer_name(); - if (params->checking) { - //update only what edited (checkboxes) + if (params->checking && config->get_value("remap", "importer") == params->importer->get_importer_name()) { + //update only what is edited (checkboxes) if the importer is the same for (List<PropertyInfo>::Element *E = params->properties.front(); E; E = E->next()) { if (params->checked.has(E->get().name)) { config->set_value("params", E->get().name, params->values[E->get().name]); @@ -558,7 +558,7 @@ ImportDock::ImportDock() { hb->add_spacer(); reimport_confirm = memnew(ConfirmationDialog); - reimport_confirm->get_ok()->set_text(TTR("Save scenes, re-import and restart")); + reimport_confirm->get_ok()->set_text(TTR("Save Scenes, Re-Import, and Restart")); add_child(reimport_confirm); reimport_confirm->connect("confirmed", callable_mp(this, &ImportDock::_reimport_and_restart)); diff --git a/editor/node_3d_editor_gizmos.cpp b/editor/node_3d_editor_gizmos.cpp index ab43e45af7..c06e5f3741 100644 --- a/editor/node_3d_editor_gizmos.cpp +++ b/editor/node_3d_editor_gizmos.cpp @@ -796,7 +796,7 @@ Vector3 EditorNode3DGizmo::get_handle_pos(int p_idx) const { //// light gizmo -LightNode3DGizmoPlugin::LightNode3DGizmoPlugin() { +Light3DGizmoPlugin::Light3DGizmoPlugin() { // Enable vertex colors for the materials below as the gizmo color depends on the light color. create_material("lines_primary", Color(1, 1, 1), false, false, true); @@ -811,19 +811,19 @@ LightNode3DGizmoPlugin::LightNode3DGizmoPlugin() { create_handle_material("handles_billboard", true); } -bool LightNode3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { +bool Light3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { return Object::cast_to<Light3D>(p_spatial) != nullptr; } -String LightNode3DGizmoPlugin::get_name() const { - return "Lights"; +String Light3DGizmoPlugin::get_name() const { + return "Light3D"; } -int LightNode3DGizmoPlugin::get_priority() const { +int Light3DGizmoPlugin::get_priority() const { return -1; } -String LightNode3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const { +String Light3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const { if (p_idx == 0) return "Radius"; @@ -831,7 +831,7 @@ String LightNode3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, return "Aperture"; } -Variant LightNode3DGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const { +Variant Light3DGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const { Light3D *light = Object::cast_to<Light3D>(p_gizmo->get_spatial_node()); if (p_idx == 0) @@ -871,7 +871,7 @@ static float _find_closest_angle_to_half_pi_arc(const Vector3 &p_from, const Vec return a * 180.0 / Math_PI; } -void LightNode3DGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) { +void Light3DGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) { Light3D *light = Object::cast_to<Light3D>(p_gizmo->get_spatial_node()); Transform gt = light->get_global_transform(); @@ -919,7 +919,7 @@ void LightNode3DGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, C } } -void LightNode3DGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) { +void Light3DGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) { Light3D *light = Object::cast_to<Light3D>(p_gizmo->get_spatial_node()); if (p_cancel) { @@ -943,7 +943,7 @@ void LightNode3DGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx } } -void LightNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { +void Light3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { Light3D *light = Object::cast_to<Light3D>(p_gizmo->get_spatial_node()); @@ -1086,7 +1086,7 @@ void LightNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { ////// //// player gizmo -AudioStreamPlayer3DNode3DGizmoPlugin::AudioStreamPlayer3DNode3DGizmoPlugin() { +AudioStreamPlayer3DGizmoPlugin::AudioStreamPlayer3DGizmoPlugin() { Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/stream_player_3d", Color(0.4, 0.8, 1)); @@ -1096,29 +1096,29 @@ AudioStreamPlayer3DNode3DGizmoPlugin::AudioStreamPlayer3DNode3DGizmoPlugin() { create_handle_material("handles"); } -bool AudioStreamPlayer3DNode3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { +bool AudioStreamPlayer3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { return Object::cast_to<AudioStreamPlayer3D>(p_spatial) != nullptr; } -String AudioStreamPlayer3DNode3DGizmoPlugin::get_name() const { +String AudioStreamPlayer3DGizmoPlugin::get_name() const { return "AudioStreamPlayer3D"; } -int AudioStreamPlayer3DNode3DGizmoPlugin::get_priority() const { +int AudioStreamPlayer3DGizmoPlugin::get_priority() const { return -1; } -String AudioStreamPlayer3DNode3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const { +String AudioStreamPlayer3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const { return "Emission Radius"; } -Variant AudioStreamPlayer3DNode3DGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const { +Variant AudioStreamPlayer3DGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const { AudioStreamPlayer3D *player = Object::cast_to<AudioStreamPlayer3D>(p_gizmo->get_spatial_node()); return player->get_emission_angle(); } -void AudioStreamPlayer3DNode3DGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) { +void AudioStreamPlayer3DGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) { AudioStreamPlayer3D *player = Object::cast_to<AudioStreamPlayer3D>(p_gizmo->get_spatial_node()); @@ -1157,7 +1157,7 @@ void AudioStreamPlayer3DNode3DGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo } } -void AudioStreamPlayer3DNode3DGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) { +void AudioStreamPlayer3DGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) { AudioStreamPlayer3D *player = Object::cast_to<AudioStreamPlayer3D>(p_gizmo->get_spatial_node()); @@ -1175,7 +1175,7 @@ void AudioStreamPlayer3DNode3DGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gi } } -void AudioStreamPlayer3DNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { +void AudioStreamPlayer3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { const AudioStreamPlayer3D *player = Object::cast_to<AudioStreamPlayer3D>(p_gizmo->get_spatial_node()); @@ -1233,7 +1233,7 @@ void AudioStreamPlayer3DNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { ////// -CameraNode3DGizmoPlugin::CameraNode3DGizmoPlugin() { +Camera3DGizmoPlugin::Camera3DGizmoPlugin() { Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/camera", Color(0.8, 0.4, 0.8)); @@ -1241,19 +1241,19 @@ CameraNode3DGizmoPlugin::CameraNode3DGizmoPlugin() { create_handle_material("handles"); } -bool CameraNode3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { +bool Camera3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { return Object::cast_to<Camera3D>(p_spatial) != nullptr; } -String CameraNode3DGizmoPlugin::get_name() const { +String Camera3DGizmoPlugin::get_name() const { return "Camera3D"; } -int CameraNode3DGizmoPlugin::get_priority() const { +int Camera3DGizmoPlugin::get_priority() const { return -1; } -String CameraNode3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const { +String Camera3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const { Camera3D *camera = Object::cast_to<Camera3D>(p_gizmo->get_spatial_node()); @@ -1264,7 +1264,7 @@ String CameraNode3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo } } -Variant CameraNode3DGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const { +Variant Camera3DGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const { Camera3D *camera = Object::cast_to<Camera3D>(p_gizmo->get_spatial_node()); @@ -1276,7 +1276,7 @@ Variant CameraNode3DGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, in } } -void CameraNode3DGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) { +void Camera3DGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) { Camera3D *camera = Object::cast_to<Camera3D>(p_gizmo->get_spatial_node()); @@ -1307,7 +1307,7 @@ void CameraNode3DGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, } } -void CameraNode3DGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) { +void Camera3DGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) { Camera3D *camera = Object::cast_to<Camera3D>(p_gizmo->get_spatial_node()); @@ -1339,7 +1339,7 @@ void CameraNode3DGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_id } } -void CameraNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { +void Camera3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { Camera3D *camera = Object::cast_to<Camera3D>(p_gizmo->get_spatial_node()); @@ -1489,26 +1489,26 @@ void CameraNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { ////// -MeshInstanceNode3DGizmoPlugin::MeshInstanceNode3DGizmoPlugin() { +MeshInstance3DGizmoPlugin::MeshInstance3DGizmoPlugin() { } -bool MeshInstanceNode3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { +bool MeshInstance3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { return Object::cast_to<MeshInstance3D>(p_spatial) != nullptr && Object::cast_to<SoftBody3D>(p_spatial) == nullptr; } -String MeshInstanceNode3DGizmoPlugin::get_name() const { +String MeshInstance3DGizmoPlugin::get_name() const { return "MeshInstance3D"; } -int MeshInstanceNode3DGizmoPlugin::get_priority() const { +int MeshInstance3DGizmoPlugin::get_priority() const { return -1; } -bool MeshInstanceNode3DGizmoPlugin::can_be_hidden() const { +bool MeshInstance3DGizmoPlugin::can_be_hidden() const { return false; } -void MeshInstanceNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { +void MeshInstance3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { MeshInstance3D *mesh = Object::cast_to<MeshInstance3D>(p_gizmo->get_spatial_node()); @@ -1526,26 +1526,26 @@ void MeshInstanceNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { } ///// -Sprite3DNode3DGizmoPlugin::Sprite3DNode3DGizmoPlugin() { +Sprite3DGizmoPlugin::Sprite3DGizmoPlugin() { } -bool Sprite3DNode3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { +bool Sprite3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { return Object::cast_to<Sprite3D>(p_spatial) != nullptr; } -String Sprite3DNode3DGizmoPlugin::get_name() const { +String Sprite3DGizmoPlugin::get_name() const { return "Sprite3D"; } -int Sprite3DNode3DGizmoPlugin::get_priority() const { +int Sprite3DGizmoPlugin::get_priority() const { return -1; } -bool Sprite3DNode3DGizmoPlugin::can_be_hidden() const { +bool Sprite3DGizmoPlugin::can_be_hidden() const { return false; } -void Sprite3DNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { +void Sprite3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { Sprite3D *sprite = Object::cast_to<Sprite3D>(p_gizmo->get_spatial_node()); @@ -1559,7 +1559,7 @@ void Sprite3DNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { /// -Position3DNode3DGizmoPlugin::Position3DNode3DGizmoPlugin() { +Position3DGizmoPlugin::Position3DGizmoPlugin() { pos3d_mesh = Ref<ArrayMesh>(memnew(ArrayMesh)); cursor_points = Vector<Vector3>(); @@ -1592,19 +1592,19 @@ Position3DNode3DGizmoPlugin::Position3DNode3DGizmoPlugin() { pos3d_mesh->surface_set_material(0, mat); } -bool Position3DNode3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { +bool Position3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { return Object::cast_to<Position3D>(p_spatial) != nullptr; } -String Position3DNode3DGizmoPlugin::get_name() const { +String Position3DGizmoPlugin::get_name() const { return "Position3D"; } -int Position3DNode3DGizmoPlugin::get_priority() const { +int Position3DGizmoPlugin::get_priority() const { return -1; } -void Position3DNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { +void Position3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { p_gizmo->clear(); p_gizmo->add_mesh(pos3d_mesh); @@ -1613,25 +1613,25 @@ void Position3DNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { ///// -SkeletonNode3DGizmoPlugin::SkeletonNode3DGizmoPlugin() { +Skeleton3DGizmoPlugin::Skeleton3DGizmoPlugin() { Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/skeleton", Color(1, 0.8, 0.4)); create_material("skeleton_material", gizmo_color); } -bool SkeletonNode3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { +bool Skeleton3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { return Object::cast_to<Skeleton3D>(p_spatial) != nullptr; } -String SkeletonNode3DGizmoPlugin::get_name() const { +String Skeleton3DGizmoPlugin::get_name() const { return "Skeleton3D"; } -int SkeletonNode3DGizmoPlugin::get_priority() const { +int Skeleton3DGizmoPlugin::get_priority() const { return -1; } -void SkeletonNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { +void Skeleton3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { Skeleton3D *skel = Object::cast_to<Skeleton3D>(p_gizmo->get_spatial_node()); @@ -1822,23 +1822,23 @@ void SkeletonNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { //// -PhysicalBoneNode3DGizmoPlugin::PhysicalBoneNode3DGizmoPlugin() { +PhysicalBone3DGizmoPlugin::PhysicalBone3DGizmoPlugin() { create_material("joint_material", EDITOR_DEF("editors/3d_gizmos/gizmo_colors/joint", Color(0.5, 0.8, 1))); } -bool PhysicalBoneNode3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { +bool PhysicalBone3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { return Object::cast_to<PhysicalBone3D>(p_spatial) != nullptr; } -String PhysicalBoneNode3DGizmoPlugin::get_name() const { - return "PhysicalBones"; +String PhysicalBone3DGizmoPlugin::get_name() const { + return "PhysicalBone3D"; } -int PhysicalBoneNode3DGizmoPlugin::get_priority() const { +int PhysicalBone3DGizmoPlugin::get_priority() const { return -1; } -void PhysicalBoneNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { +void PhysicalBone3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { p_gizmo->clear(); @@ -1864,12 +1864,12 @@ void PhysicalBoneNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { switch (physical_bone->get_joint_type()) { case PhysicalBone3D::JOINT_TYPE_PIN: { - JointNode3DGizmoPlugin::CreatePinJointGizmo(physical_bone->get_joint_offset(), points); + Joint3DGizmoPlugin::CreatePinJointGizmo(physical_bone->get_joint_offset(), points); } break; case PhysicalBone3D::JOINT_TYPE_CONE: { const PhysicalBone3D::ConeJointData *cjd(static_cast<const PhysicalBone3D::ConeJointData *>(physical_bone->get_joint_data())); - JointNode3DGizmoPlugin::CreateConeTwistJointGizmo( + Joint3DGizmoPlugin::CreateConeTwistJointGizmo( physical_bone->get_joint_offset(), physical_bone->get_global_transform() * physical_bone->get_joint_offset(), pb->get_global_transform(), @@ -1882,7 +1882,7 @@ void PhysicalBoneNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { case PhysicalBone3D::JOINT_TYPE_HINGE: { const PhysicalBone3D::HingeJointData *hjd(static_cast<const PhysicalBone3D::HingeJointData *>(physical_bone->get_joint_data())); - JointNode3DGizmoPlugin::CreateHingeJointGizmo( + Joint3DGizmoPlugin::CreateHingeJointGizmo( physical_bone->get_joint_offset(), physical_bone->get_global_transform() * physical_bone->get_joint_offset(), pb->get_global_transform(), @@ -1897,7 +1897,7 @@ void PhysicalBoneNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { case PhysicalBone3D::JOINT_TYPE_SLIDER: { const PhysicalBone3D::SliderJointData *sjd(static_cast<const PhysicalBone3D::SliderJointData *>(physical_bone->get_joint_data())); - JointNode3DGizmoPlugin::CreateSliderJointGizmo( + Joint3DGizmoPlugin::CreateSliderJointGizmo( physical_bone->get_joint_offset(), physical_bone->get_global_transform() * physical_bone->get_joint_offset(), pb->get_global_transform(), @@ -1913,7 +1913,7 @@ void PhysicalBoneNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { case PhysicalBone3D::JOINT_TYPE_6DOF: { const PhysicalBone3D::SixDOFJointData *sdofjd(static_cast<const PhysicalBone3D::SixDOFJointData *>(physical_bone->get_joint_data())); - JointNode3DGizmoPlugin::CreateGeneric6DOFJointGizmo( + Joint3DGizmoPlugin::CreateGeneric6DOFJointGizmo( physical_bone->get_joint_offset(), physical_bone->get_global_transform() * physical_bone->get_joint_offset(), @@ -1957,7 +1957,7 @@ void PhysicalBoneNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { ///// -RayCastNode3DGizmoPlugin::RayCastNode3DGizmoPlugin() { +RayCast3DGizmoPlugin::RayCast3DGizmoPlugin() { const Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/shape", Color(0.5, 0.7, 1)); create_material("shape_material", gizmo_color); @@ -1966,19 +1966,19 @@ RayCastNode3DGizmoPlugin::RayCastNode3DGizmoPlugin() { create_material("shape_material_disabled", gizmo_color_disabled); } -bool RayCastNode3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { +bool RayCast3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { return Object::cast_to<RayCast3D>(p_spatial) != nullptr; } -String RayCastNode3DGizmoPlugin::get_name() const { +String RayCast3DGizmoPlugin::get_name() const { return "RayCast3D"; } -int RayCastNode3DGizmoPlugin::get_priority() const { +int RayCast3DGizmoPlugin::get_priority() const { return -1; } -void RayCastNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { +void RayCast3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { RayCast3D *raycast = Object::cast_to<RayCast3D>(p_gizmo->get_spatial_node()); @@ -1998,7 +1998,7 @@ void RayCastNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { ///// -void SpringArmNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { +void SpringArm3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { SpringArm3D *spring_arm = Object::cast_to<SpringArm3D>(p_gizmo->get_spatial_node()); @@ -2015,44 +2015,44 @@ void SpringArmNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { p_gizmo->add_collision_segments(lines); } -SpringArmNode3DGizmoPlugin::SpringArmNode3DGizmoPlugin() { +SpringArm3DGizmoPlugin::SpringArm3DGizmoPlugin() { Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/shape", Color(0.5, 0.7, 1)); create_material("shape_material", gizmo_color); } -bool SpringArmNode3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { +bool SpringArm3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { return Object::cast_to<SpringArm3D>(p_spatial) != nullptr; } -String SpringArmNode3DGizmoPlugin::get_name() const { +String SpringArm3DGizmoPlugin::get_name() const { return "SpringArm3D"; } -int SpringArmNode3DGizmoPlugin::get_priority() const { +int SpringArm3DGizmoPlugin::get_priority() const { return -1; } ///// -VehicleWheelNode3DGizmoPlugin::VehicleWheelNode3DGizmoPlugin() { +VehicleWheel3DGizmoPlugin::VehicleWheel3DGizmoPlugin() { Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/shape", Color(0.5, 0.7, 1)); create_material("shape_material", gizmo_color); } -bool VehicleWheelNode3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { +bool VehicleWheel3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { return Object::cast_to<VehicleWheel3D>(p_spatial) != nullptr; } -String VehicleWheelNode3DGizmoPlugin::get_name() const { +String VehicleWheel3DGizmoPlugin::get_name() const { return "VehicleWheel3D"; } -int VehicleWheelNode3DGizmoPlugin::get_priority() const { +int VehicleWheel3DGizmoPlugin::get_priority() const { return -1; } -void VehicleWheelNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { +void VehicleWheel3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { VehicleWheel3D *car_wheel = Object::cast_to<VehicleWheel3D>(p_gizmo->get_spatial_node()); @@ -2108,29 +2108,29 @@ void VehicleWheelNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { /////////// -SoftBodyNode3DGizmoPlugin::SoftBodyNode3DGizmoPlugin() { +SoftBody3DGizmoPlugin::SoftBody3DGizmoPlugin() { Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/shape", Color(0.5, 0.7, 1)); create_material("shape_material", gizmo_color); create_handle_material("handles"); } -bool SoftBodyNode3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { +bool SoftBody3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { return Object::cast_to<SoftBody3D>(p_spatial) != nullptr; } -String SoftBodyNode3DGizmoPlugin::get_name() const { +String SoftBody3DGizmoPlugin::get_name() const { return "SoftBody3D"; } -int SoftBodyNode3DGizmoPlugin::get_priority() const { +int SoftBody3DGizmoPlugin::get_priority() const { return -1; } -bool SoftBodyNode3DGizmoPlugin::is_selectable_when_hidden() const { +bool SoftBody3DGizmoPlugin::is_selectable_when_hidden() const { return true; } -void SoftBodyNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { +void SoftBody3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { SoftBody3D *soft_body = Object::cast_to<SoftBody3D>(p_gizmo->get_spatial_node()); p_gizmo->clear(); @@ -2161,28 +2161,28 @@ void SoftBodyNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { p_gizmo->add_collision_triangles(tm); } -String SoftBodyNode3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const { +String SoftBody3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const { return "SoftBody3D pin point"; } -Variant SoftBodyNode3DGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const { +Variant SoftBody3DGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const { SoftBody3D *soft_body = Object::cast_to<SoftBody3D>(p_gizmo->get_spatial_node()); return Variant(soft_body->is_point_pinned(p_idx)); } -void SoftBodyNode3DGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) { +void SoftBody3DGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) { SoftBody3D *soft_body = Object::cast_to<SoftBody3D>(p_gizmo->get_spatial_node()); soft_body->pin_point_toggle(p_idx); } -bool SoftBodyNode3DGizmoPlugin::is_handle_highlighted(const EditorNode3DGizmo *p_gizmo, int idx) const { +bool SoftBody3DGizmoPlugin::is_handle_highlighted(const EditorNode3DGizmo *p_gizmo, int idx) const { SoftBody3D *soft_body = Object::cast_to<SoftBody3D>(p_gizmo->get_spatial_node()); return soft_body->is_point_pinned(idx); } /////////// -VisibilityNotifierGizmoPlugin::VisibilityNotifierGizmoPlugin() { +VisibilityNotifier3DGizmoPlugin::VisibilityNotifier3DGizmoPlugin() { Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/visibility_notifier", Color(0.8, 0.5, 0.7)); create_material("visibility_notifier_material", gizmo_color); gizmo_color.a = 0.1; @@ -2190,19 +2190,19 @@ VisibilityNotifierGizmoPlugin::VisibilityNotifierGizmoPlugin() { create_handle_material("handles"); } -bool VisibilityNotifierGizmoPlugin::has_gizmo(Node3D *p_spatial) { +bool VisibilityNotifier3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { return Object::cast_to<VisibilityNotifier3D>(p_spatial) != nullptr; } -String VisibilityNotifierGizmoPlugin::get_name() const { +String VisibilityNotifier3DGizmoPlugin::get_name() const { return "VisibilityNotifier3D"; } -int VisibilityNotifierGizmoPlugin::get_priority() const { +int VisibilityNotifier3DGizmoPlugin::get_priority() const { return -1; } -String VisibilityNotifierGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const { +String VisibilityNotifier3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const { switch (p_idx) { case 0: return "Size X"; @@ -2216,12 +2216,12 @@ String VisibilityNotifierGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p return ""; } -Variant VisibilityNotifierGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const { +Variant VisibilityNotifier3DGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const { VisibilityNotifier3D *notifier = Object::cast_to<VisibilityNotifier3D>(p_gizmo->get_spatial_node()); return notifier->get_aabb(); } -void VisibilityNotifierGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) { +void VisibilityNotifier3DGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) { VisibilityNotifier3D *notifier = Object::cast_to<VisibilityNotifier3D>(p_gizmo->get_spatial_node()); @@ -2274,7 +2274,7 @@ void VisibilityNotifierGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p } } -void VisibilityNotifierGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) { +void VisibilityNotifier3DGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) { VisibilityNotifier3D *notifier = Object::cast_to<VisibilityNotifier3D>(p_gizmo->get_spatial_node()); @@ -2290,7 +2290,7 @@ void VisibilityNotifierGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, in ur->commit_action(); } -void VisibilityNotifierGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { +void VisibilityNotifier3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { VisibilityNotifier3D *notifier = Object::cast_to<VisibilityNotifier3D>(p_gizmo->get_spatial_node()); @@ -3034,7 +3034,7 @@ void BakedIndirectLightGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { #endif //// -CollisionShapeNode3DGizmoPlugin::CollisionShapeNode3DGizmoPlugin() { +CollisionShape3DGizmoPlugin::CollisionShape3DGizmoPlugin() { const Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/shape", Color(0.5, 0.7, 1)); create_material("shape_material", gizmo_color); const float gizmo_value = gizmo_color.get_v(); @@ -3043,19 +3043,19 @@ CollisionShapeNode3DGizmoPlugin::CollisionShapeNode3DGizmoPlugin() { create_handle_material("handles"); } -bool CollisionShapeNode3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { +bool CollisionShape3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { return Object::cast_to<CollisionShape3D>(p_spatial) != nullptr; } -String CollisionShapeNode3DGizmoPlugin::get_name() const { +String CollisionShape3DGizmoPlugin::get_name() const { return "CollisionShape3D"; } -int CollisionShapeNode3DGizmoPlugin::get_priority() const { +int CollisionShape3DGizmoPlugin::get_priority() const { return -1; } -String CollisionShapeNode3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const { +String CollisionShape3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const { const CollisionShape3D *cs = Object::cast_to<CollisionShape3D>(p_gizmo->get_spatial_node()); @@ -3091,7 +3091,7 @@ String CollisionShapeNode3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo return ""; } -Variant CollisionShapeNode3DGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const { +Variant CollisionShape3DGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const { CollisionShape3D *cs = Object::cast_to<CollisionShape3D>(p_gizmo->get_spatial_node()); @@ -3131,7 +3131,7 @@ Variant CollisionShapeNode3DGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_g return Variant(); } -void CollisionShapeNode3DGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) { +void CollisionShape3DGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) { CollisionShape3D *cs = Object::cast_to<CollisionShape3D>(p_gizmo->get_spatial_node()); @@ -3244,7 +3244,7 @@ void CollisionShapeNode3DGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int cs2->set_height(d * 2.0); } } -void CollisionShapeNode3DGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) { +void CollisionShape3DGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) { CollisionShape3D *cs = Object::cast_to<CollisionShape3D>(p_gizmo->get_spatial_node()); @@ -3351,7 +3351,7 @@ void CollisionShapeNode3DGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, ur->commit_action(); } } -void CollisionShapeNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { +void CollisionShape3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { CollisionShape3D *cs = Object::cast_to<CollisionShape3D>(p_gizmo->get_spatial_node()); @@ -3663,7 +3663,7 @@ void CollisionShapeNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { ///// -CollisionPolygonNode3DGizmoPlugin::CollisionPolygonNode3DGizmoPlugin() { +CollisionPolygon3DGizmoPlugin::CollisionPolygon3DGizmoPlugin() { const Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/shape", Color(0.5, 0.7, 1)); create_material("shape_material", gizmo_color); const float gizmo_value = gizmo_color.get_v(); @@ -3671,19 +3671,19 @@ CollisionPolygonNode3DGizmoPlugin::CollisionPolygonNode3DGizmoPlugin() { create_material("shape_material_disabled", gizmo_color_disabled); } -bool CollisionPolygonNode3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { +bool CollisionPolygon3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { return Object::cast_to<CollisionPolygon3D>(p_spatial) != nullptr; } -String CollisionPolygonNode3DGizmoPlugin::get_name() const { +String CollisionPolygon3DGizmoPlugin::get_name() const { return "CollisionPolygon3D"; } -int CollisionPolygonNode3DGizmoPlugin::get_priority() const { +int CollisionPolygon3DGizmoPlugin::get_priority() const { return -1; } -void CollisionPolygonNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { +void CollisionPolygon3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { CollisionPolygon3D *polygon = Object::cast_to<CollisionPolygon3D>(p_gizmo->get_spatial_node()); @@ -3713,26 +3713,26 @@ void CollisionPolygonNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { //// -NavigationMeshNode3DGizmoPlugin::NavigationMeshNode3DGizmoPlugin() { +NavigationRegion3DGizmoPlugin::NavigationRegion3DGizmoPlugin() { create_material("navigation_edge_material", EDITOR_DEF("editors/3d_gizmos/gizmo_colors/navigation_edge", Color(0.5, 1, 1))); create_material("navigation_edge_material_disabled", EDITOR_DEF("editors/3d_gizmos/gizmo_colors/navigation_edge_disabled", Color(0.7, 0.7, 0.7))); create_material("navigation_solid_material", EDITOR_DEF("editors/3d_gizmos/gizmo_colors/navigation_solid", Color(0.5, 1, 1, 0.4))); create_material("navigation_solid_material_disabled", EDITOR_DEF("editors/3d_gizmos/gizmo_colors/navigation_solid_disabled", Color(0.7, 0.7, 0.7, 0.4))); } -bool NavigationMeshNode3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { +bool NavigationRegion3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { return Object::cast_to<NavigationRegion3D>(p_spatial) != nullptr; } -String NavigationMeshNode3DGizmoPlugin::get_name() const { +String NavigationRegion3DGizmoPlugin::get_name() const { return "NavigationRegion3D"; } -int NavigationMeshNode3DGizmoPlugin::get_priority() const { +int NavigationRegion3DGizmoPlugin::get_priority() const { return -1; } -void NavigationMeshNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { +void NavigationRegion3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { NavigationRegion3D *navmesh = Object::cast_to<NavigationRegion3D>(p_gizmo->get_spatial_node()); @@ -4078,25 +4078,25 @@ void JointGizmosDrawer::draw_cone(const Transform &p_offset, const Basis &p_base //// -JointNode3DGizmoPlugin::JointNode3DGizmoPlugin() { +Joint3DGizmoPlugin::Joint3DGizmoPlugin() { create_material("joint_material", EDITOR_DEF("editors/3d_gizmos/gizmo_colors/joint", Color(0.5, 0.8, 1))); create_material("joint_body_a_material", EDITOR_DEF("editors/3d_gizmos/gizmo_colors/joint_body_a", Color(0.6, 0.8, 1))); create_material("joint_body_b_material", EDITOR_DEF("editors/3d_gizmos/gizmo_colors/joint_body_b", Color(0.6, 0.9, 1))); } -bool JointNode3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { +bool Joint3DGizmoPlugin::has_gizmo(Node3D *p_spatial) { return Object::cast_to<Joint3D>(p_spatial) != nullptr; } -String JointNode3DGizmoPlugin::get_name() const { - return "Joints"; +String Joint3DGizmoPlugin::get_name() const { + return "Joint3D"; } -int JointNode3DGizmoPlugin::get_priority() const { +int Joint3DGizmoPlugin::get_priority() const { return -1; } -void JointNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { +void Joint3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { Joint3D *joint = Object::cast_to<Joint3D>(p_gizmo->get_spatial_node()); p_gizmo->clear(); @@ -4242,7 +4242,7 @@ void JointNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { } } -void JointNode3DGizmoPlugin::CreatePinJointGizmo(const Transform &p_offset, Vector<Vector3> &r_cursor_points) { +void Joint3DGizmoPlugin::CreatePinJointGizmo(const Transform &p_offset, Vector<Vector3> &r_cursor_points) { float cs = 0.25; r_cursor_points.push_back(p_offset.translated(Vector3(+cs, 0, 0)).origin); @@ -4253,7 +4253,7 @@ void JointNode3DGizmoPlugin::CreatePinJointGizmo(const Transform &p_offset, Vect r_cursor_points.push_back(p_offset.translated(Vector3(0, 0, -cs)).origin); } -void JointNode3DGizmoPlugin::CreateHingeJointGizmo(const Transform &p_offset, const Transform &p_trs_joint, const Transform &p_trs_body_a, const Transform &p_trs_body_b, real_t p_limit_lower, real_t p_limit_upper, bool p_use_limit, Vector<Vector3> &r_common_points, Vector<Vector3> *r_body_a_points, Vector<Vector3> *r_body_b_points) { +void Joint3DGizmoPlugin::CreateHingeJointGizmo(const Transform &p_offset, const Transform &p_trs_joint, const Transform &p_trs_body_a, const Transform &p_trs_body_b, real_t p_limit_lower, real_t p_limit_upper, bool p_use_limit, Vector<Vector3> &r_common_points, Vector<Vector3> *r_body_a_points, Vector<Vector3> *r_body_b_points) { r_common_points.push_back(p_offset.translated(Vector3(0, 0, 0.5)).origin); r_common_points.push_back(p_offset.translated(Vector3(0, 0, -0.5)).origin); @@ -4285,7 +4285,7 @@ void JointNode3DGizmoPlugin::CreateHingeJointGizmo(const Transform &p_offset, co } } -void JointNode3DGizmoPlugin::CreateSliderJointGizmo(const Transform &p_offset, const Transform &p_trs_joint, const Transform &p_trs_body_a, const Transform &p_trs_body_b, real_t p_angular_limit_lower, real_t p_angular_limit_upper, real_t p_linear_limit_lower, real_t p_linear_limit_upper, Vector<Vector3> &r_points, Vector<Vector3> *r_body_a_points, Vector<Vector3> *r_body_b_points) { +void Joint3DGizmoPlugin::CreateSliderJointGizmo(const Transform &p_offset, const Transform &p_trs_joint, const Transform &p_trs_body_a, const Transform &p_trs_body_b, real_t p_angular_limit_lower, real_t p_angular_limit_upper, real_t p_linear_limit_lower, real_t p_linear_limit_upper, Vector<Vector3> &r_points, Vector<Vector3> *r_body_a_points, Vector<Vector3> *r_body_b_points) { p_linear_limit_lower = -p_linear_limit_lower; p_linear_limit_upper = -p_linear_limit_upper; @@ -4345,7 +4345,7 @@ void JointNode3DGizmoPlugin::CreateSliderJointGizmo(const Transform &p_offset, c true); } -void JointNode3DGizmoPlugin::CreateConeTwistJointGizmo(const Transform &p_offset, const Transform &p_trs_joint, const Transform &p_trs_body_a, const Transform &p_trs_body_b, real_t p_swing, real_t p_twist, Vector<Vector3> *r_body_a_points, Vector<Vector3> *r_body_b_points) { +void Joint3DGizmoPlugin::CreateConeTwistJointGizmo(const Transform &p_offset, const Transform &p_trs_joint, const Transform &p_trs_body_a, const Transform &p_trs_body_b, real_t p_swing, real_t p_twist, Vector<Vector3> *r_body_a_points, Vector<Vector3> *r_body_b_points) { if (r_body_a_points) JointGizmosDrawer::draw_cone( @@ -4364,7 +4364,7 @@ void JointNode3DGizmoPlugin::CreateConeTwistJointGizmo(const Transform &p_offset *r_body_b_points); } -void JointNode3DGizmoPlugin::CreateGeneric6DOFJointGizmo( +void Joint3DGizmoPlugin::CreateGeneric6DOFJointGizmo( const Transform &p_offset, const Transform &p_trs_joint, const Transform &p_trs_body_a, diff --git a/editor/node_3d_editor_gizmos.h b/editor/node_3d_editor_gizmos.h index f8339b4c6c..889b0e8315 100644 --- a/editor/node_3d_editor_gizmos.h +++ b/editor/node_3d_editor_gizmos.h @@ -36,9 +36,9 @@ class Camera3D; -class LightNode3DGizmoPlugin : public EditorNode3DGizmoPlugin { +class Light3DGizmoPlugin : public EditorNode3DGizmoPlugin { - GDCLASS(LightNode3DGizmoPlugin, EditorNode3DGizmoPlugin); + GDCLASS(Light3DGizmoPlugin, EditorNode3DGizmoPlugin); public: bool has_gizmo(Node3D *p_spatial); @@ -51,12 +51,12 @@ public: void commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false); void redraw(EditorNode3DGizmo *p_gizmo); - LightNode3DGizmoPlugin(); + Light3DGizmoPlugin(); }; -class AudioStreamPlayer3DNode3DGizmoPlugin : public EditorNode3DGizmoPlugin { +class AudioStreamPlayer3DGizmoPlugin : public EditorNode3DGizmoPlugin { - GDCLASS(AudioStreamPlayer3DNode3DGizmoPlugin, EditorNode3DGizmoPlugin); + GDCLASS(AudioStreamPlayer3DGizmoPlugin, EditorNode3DGizmoPlugin); public: bool has_gizmo(Node3D *p_spatial); @@ -69,12 +69,12 @@ public: void commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false); void redraw(EditorNode3DGizmo *p_gizmo); - AudioStreamPlayer3DNode3DGizmoPlugin(); + AudioStreamPlayer3DGizmoPlugin(); }; -class CameraNode3DGizmoPlugin : public EditorNode3DGizmoPlugin { +class Camera3DGizmoPlugin : public EditorNode3DGizmoPlugin { - GDCLASS(CameraNode3DGizmoPlugin, EditorNode3DGizmoPlugin); + GDCLASS(Camera3DGizmoPlugin, EditorNode3DGizmoPlugin); public: bool has_gizmo(Node3D *p_spatial); @@ -87,12 +87,12 @@ public: void commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false); void redraw(EditorNode3DGizmo *p_gizmo); - CameraNode3DGizmoPlugin(); + Camera3DGizmoPlugin(); }; -class MeshInstanceNode3DGizmoPlugin : public EditorNode3DGizmoPlugin { +class MeshInstance3DGizmoPlugin : public EditorNode3DGizmoPlugin { - GDCLASS(MeshInstanceNode3DGizmoPlugin, EditorNode3DGizmoPlugin); + GDCLASS(MeshInstance3DGizmoPlugin, EditorNode3DGizmoPlugin); public: bool has_gizmo(Node3D *p_spatial); @@ -101,12 +101,12 @@ public: bool can_be_hidden() const; void redraw(EditorNode3DGizmo *p_gizmo); - MeshInstanceNode3DGizmoPlugin(); + MeshInstance3DGizmoPlugin(); }; -class Sprite3DNode3DGizmoPlugin : public EditorNode3DGizmoPlugin { +class Sprite3DGizmoPlugin : public EditorNode3DGizmoPlugin { - GDCLASS(Sprite3DNode3DGizmoPlugin, EditorNode3DGizmoPlugin); + GDCLASS(Sprite3DGizmoPlugin, EditorNode3DGizmoPlugin); public: bool has_gizmo(Node3D *p_spatial); @@ -115,12 +115,12 @@ public: bool can_be_hidden() const; void redraw(EditorNode3DGizmo *p_gizmo); - Sprite3DNode3DGizmoPlugin(); + Sprite3DGizmoPlugin(); }; -class Position3DNode3DGizmoPlugin : public EditorNode3DGizmoPlugin { +class Position3DGizmoPlugin : public EditorNode3DGizmoPlugin { - GDCLASS(Position3DNode3DGizmoPlugin, EditorNode3DGizmoPlugin); + GDCLASS(Position3DGizmoPlugin, EditorNode3DGizmoPlugin); Ref<ArrayMesh> pos3d_mesh; Vector<Vector3> cursor_points; @@ -131,12 +131,12 @@ public: int get_priority() const; void redraw(EditorNode3DGizmo *p_gizmo); - Position3DNode3DGizmoPlugin(); + Position3DGizmoPlugin(); }; -class SkeletonNode3DGizmoPlugin : public EditorNode3DGizmoPlugin { +class Skeleton3DGizmoPlugin : public EditorNode3DGizmoPlugin { - GDCLASS(SkeletonNode3DGizmoPlugin, EditorNode3DGizmoPlugin); + GDCLASS(Skeleton3DGizmoPlugin, EditorNode3DGizmoPlugin); public: bool has_gizmo(Node3D *p_spatial); @@ -144,12 +144,12 @@ public: int get_priority() const; void redraw(EditorNode3DGizmo *p_gizmo); - SkeletonNode3DGizmoPlugin(); + Skeleton3DGizmoPlugin(); }; -class PhysicalBoneNode3DGizmoPlugin : public EditorNode3DGizmoPlugin { +class PhysicalBone3DGizmoPlugin : public EditorNode3DGizmoPlugin { - GDCLASS(PhysicalBoneNode3DGizmoPlugin, EditorNode3DGizmoPlugin); + GDCLASS(PhysicalBone3DGizmoPlugin, EditorNode3DGizmoPlugin); public: bool has_gizmo(Node3D *p_spatial); @@ -157,12 +157,12 @@ public: int get_priority() const; void redraw(EditorNode3DGizmo *p_gizmo); - PhysicalBoneNode3DGizmoPlugin(); + PhysicalBone3DGizmoPlugin(); }; -class RayCastNode3DGizmoPlugin : public EditorNode3DGizmoPlugin { +class RayCast3DGizmoPlugin : public EditorNode3DGizmoPlugin { - GDCLASS(RayCastNode3DGizmoPlugin, EditorNode3DGizmoPlugin); + GDCLASS(RayCast3DGizmoPlugin, EditorNode3DGizmoPlugin); public: bool has_gizmo(Node3D *p_spatial); @@ -170,12 +170,12 @@ public: int get_priority() const; void redraw(EditorNode3DGizmo *p_gizmo); - RayCastNode3DGizmoPlugin(); + RayCast3DGizmoPlugin(); }; -class SpringArmNode3DGizmoPlugin : public EditorNode3DGizmoPlugin { +class SpringArm3DGizmoPlugin : public EditorNode3DGizmoPlugin { - GDCLASS(SpringArmNode3DGizmoPlugin, EditorNode3DGizmoPlugin); + GDCLASS(SpringArm3DGizmoPlugin, EditorNode3DGizmoPlugin); public: bool has_gizmo(Node3D *p_spatial); @@ -183,12 +183,12 @@ public: int get_priority() const; void redraw(EditorNode3DGizmo *p_gizmo); - SpringArmNode3DGizmoPlugin(); + SpringArm3DGizmoPlugin(); }; -class VehicleWheelNode3DGizmoPlugin : public EditorNode3DGizmoPlugin { +class VehicleWheel3DGizmoPlugin : public EditorNode3DGizmoPlugin { - GDCLASS(VehicleWheelNode3DGizmoPlugin, EditorNode3DGizmoPlugin); + GDCLASS(VehicleWheel3DGizmoPlugin, EditorNode3DGizmoPlugin); public: bool has_gizmo(Node3D *p_spatial); @@ -196,12 +196,12 @@ public: int get_priority() const; void redraw(EditorNode3DGizmo *p_gizmo); - VehicleWheelNode3DGizmoPlugin(); + VehicleWheel3DGizmoPlugin(); }; -class SoftBodyNode3DGizmoPlugin : public EditorNode3DGizmoPlugin { +class SoftBody3DGizmoPlugin : public EditorNode3DGizmoPlugin { - GDCLASS(SoftBodyNode3DGizmoPlugin, EditorNode3DGizmoPlugin); + GDCLASS(SoftBody3DGizmoPlugin, EditorNode3DGizmoPlugin); public: bool has_gizmo(Node3D *p_spatial); @@ -215,12 +215,12 @@ public: void commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel); bool is_handle_highlighted(const EditorNode3DGizmo *p_gizmo, int idx) const; - SoftBodyNode3DGizmoPlugin(); + SoftBody3DGizmoPlugin(); }; -class VisibilityNotifierGizmoPlugin : public EditorNode3DGizmoPlugin { +class VisibilityNotifier3DGizmoPlugin : public EditorNode3DGizmoPlugin { - GDCLASS(VisibilityNotifierGizmoPlugin, EditorNode3DGizmoPlugin); + GDCLASS(VisibilityNotifier3DGizmoPlugin, EditorNode3DGizmoPlugin); public: bool has_gizmo(Node3D *p_spatial); @@ -233,7 +233,7 @@ public: void set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point); void commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false); - VisibilityNotifierGizmoPlugin(); + VisibilityNotifier3DGizmoPlugin(); }; class CPUParticles3DGizmoPlugin : public EditorNode3DGizmoPlugin { @@ -322,9 +322,9 @@ public: BakedIndirectLightGizmoPlugin(); }; #endif -class CollisionShapeNode3DGizmoPlugin : public EditorNode3DGizmoPlugin { +class CollisionShape3DGizmoPlugin : public EditorNode3DGizmoPlugin { - GDCLASS(CollisionShapeNode3DGizmoPlugin, EditorNode3DGizmoPlugin); + GDCLASS(CollisionShape3DGizmoPlugin, EditorNode3DGizmoPlugin); public: bool has_gizmo(Node3D *p_spatial); @@ -337,23 +337,23 @@ public: void set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point); void commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false); - CollisionShapeNode3DGizmoPlugin(); + CollisionShape3DGizmoPlugin(); }; -class CollisionPolygonNode3DGizmoPlugin : public EditorNode3DGizmoPlugin { - GDCLASS(CollisionPolygonNode3DGizmoPlugin, EditorNode3DGizmoPlugin); +class CollisionPolygon3DGizmoPlugin : public EditorNode3DGizmoPlugin { + GDCLASS(CollisionPolygon3DGizmoPlugin, EditorNode3DGizmoPlugin); public: bool has_gizmo(Node3D *p_spatial); String get_name() const; int get_priority() const; void redraw(EditorNode3DGizmo *p_gizmo); - CollisionPolygonNode3DGizmoPlugin(); + CollisionPolygon3DGizmoPlugin(); }; -class NavigationMeshNode3DGizmoPlugin : public EditorNode3DGizmoPlugin { +class NavigationRegion3DGizmoPlugin : public EditorNode3DGizmoPlugin { - GDCLASS(NavigationMeshNode3DGizmoPlugin, EditorNode3DGizmoPlugin); + GDCLASS(NavigationRegion3DGizmoPlugin, EditorNode3DGizmoPlugin); struct _EdgeKey { @@ -369,7 +369,7 @@ public: int get_priority() const; void redraw(EditorNode3DGizmo *p_gizmo); - NavigationMeshNode3DGizmoPlugin(); + NavigationRegion3DGizmoPlugin(); }; class JointGizmosDrawer { @@ -387,9 +387,9 @@ public: static void draw_cone(const Transform &p_offset, const Basis &p_base, real_t p_swing, real_t p_twist, Vector<Vector3> &r_points); }; -class JointNode3DGizmoPlugin : public EditorNode3DGizmoPlugin { +class Joint3DGizmoPlugin : public EditorNode3DGizmoPlugin { - GDCLASS(JointNode3DGizmoPlugin, EditorNode3DGizmoPlugin); + GDCLASS(Joint3DGizmoPlugin, EditorNode3DGizmoPlugin); public: bool has_gizmo(Node3D *p_spatial); @@ -428,7 +428,7 @@ public: Vector<Vector3> *r_body_a_points, Vector<Vector3> *r_body_b_points); - JointNode3DGizmoPlugin(); + Joint3DGizmoPlugin(); }; #endif // SPATIAL_EDITOR_GIZMOS_H diff --git a/editor/plugins/animation_state_machine_editor.cpp b/editor/plugins/animation_state_machine_editor.cpp index 9267c0df5c..c06f62a8c1 100644 --- a/editor/plugins/animation_state_machine_editor.cpp +++ b/editor/plugins/animation_state_machine_editor.cpp @@ -1362,7 +1362,6 @@ AnimationNodeStateMachineEditor::AnimationNodeStateMachineEditor() { name_edit = memnew(LineEdit); name_edit_popup->add_child(name_edit); name_edit->set_anchors_and_margins_preset(PRESET_WIDE); - name_edit_popup->add_child(name_edit); name_edit->connect("text_entered", callable_mp(this, &AnimationNodeStateMachineEditor::_name_edited)); name_edit->connect("focus_exited", callable_mp(this, &AnimationNodeStateMachineEditor::_name_edited_focus_out)); diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index d8b9fb4d8f..2f7747d0ff 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -48,7 +48,7 @@ #include "scene/2d/touch_screen_button.h" #include "scene/gui/grid_container.h" #include "scene/gui/nine_patch_rect.h" -#include "scene/gui/viewport_container.h" +#include "scene/gui/subviewport_container.h" #include "scene/main/canvas_layer.h" #include "scene/main/window.h" #include "scene/resources/packed_scene.h" @@ -5434,7 +5434,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { viewport_scrollable->set_h_size_flags(Control::SIZE_EXPAND_FILL); viewport_scrollable->connect("draw", callable_mp(this, &CanvasItemEditor::_update_scrollbars)); - ViewportContainer *scene_tree = memnew(ViewportContainer); + SubViewportContainer *scene_tree = memnew(SubViewportContainer); viewport_scrollable->add_child(scene_tree); scene_tree->set_stretch(true); scene_tree->set_anchors_and_margins_preset(Control::PRESET_WIDE); diff --git a/editor/plugins/material_editor_plugin.cpp b/editor/plugins/material_editor_plugin.cpp index 5623805201..00e8a05e4e 100644 --- a/editor/plugins/material_editor_plugin.cpp +++ b/editor/plugins/material_editor_plugin.cpp @@ -31,7 +31,7 @@ #include "material_editor_plugin.h" #include "editor/editor_scale.h" -#include "scene/gui/viewport_container.h" +#include "scene/gui/subviewport_container.h" #include "scene/resources/particles_material.h" #include "scene/resources/sky_material.h" @@ -110,7 +110,7 @@ void MaterialEditor::_bind_methods() { MaterialEditor::MaterialEditor() { - vc = memnew(ViewportContainer); + vc = memnew(SubViewportContainer); vc->set_stretch(true); add_child(vc); vc->set_anchors_and_margins_preset(PRESET_WIDE); diff --git a/editor/plugins/material_editor_plugin.h b/editor/plugins/material_editor_plugin.h index 0938e79ca2..50036e4f72 100644 --- a/editor/plugins/material_editor_plugin.h +++ b/editor/plugins/material_editor_plugin.h @@ -41,13 +41,13 @@ #include "scene/3d/mesh_instance_3d.h" #include "scene/resources/material.h" -class ViewportContainer; +class SubViewportContainer; class MaterialEditor : public Control { GDCLASS(MaterialEditor, Control); - ViewportContainer *vc; + SubViewportContainer *vc; SubViewport *viewport; MeshInstance3D *sphere_instance; MeshInstance3D *box_instance; diff --git a/editor/plugins/mesh_editor_plugin.h b/editor/plugins/mesh_editor_plugin.h index 59810517d9..072e21f260 100644 --- a/editor/plugins/mesh_editor_plugin.h +++ b/editor/plugins/mesh_editor_plugin.h @@ -36,12 +36,12 @@ #include "scene/3d/camera_3d.h" #include "scene/3d/light_3d.h" #include "scene/3d/mesh_instance_3d.h" -#include "scene/gui/viewport_container.h" +#include "scene/gui/subviewport_container.h" #include "scene/resources/material.h" -class MeshEditor : public ViewportContainer { +class MeshEditor : public SubViewportContainer { - GDCLASS(MeshEditor, ViewportContainer); + GDCLASS(MeshEditor, SubViewportContainer); float rot_x; float rot_y; diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index afd8d2d075..1c16ed6b58 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -48,7 +48,7 @@ #include "scene/3d/mesh_instance_3d.h" #include "scene/3d/physics_body_3d.h" #include "scene/3d/visual_instance_3d.h" -#include "scene/gui/viewport_container.h" +#include "scene/gui/subviewport_container.h" #include "scene/resources/packed_scene.h" #include "scene/resources/surface_tool.h" #include "servers/display_server.h" @@ -418,12 +418,12 @@ Vector3 Node3DEditorViewport::_get_camera_position() const { Point2 Node3DEditorViewport::_point_to_screen(const Vector3 &p_point) { - return camera->unproject_position(p_point) * viewport_container->get_stretch_shrink(); + return camera->unproject_position(p_point) * subviewport_container->get_stretch_shrink(); } Vector3 Node3DEditorViewport::_get_ray_pos(const Vector2 &p_pos) const { - return camera->project_ray_origin(p_pos / viewport_container->get_stretch_shrink()); + return camera->project_ray_origin(p_pos / subviewport_container->get_stretch_shrink()); } Vector3 Node3DEditorViewport::_get_camera_normal() const { @@ -433,7 +433,7 @@ Vector3 Node3DEditorViewport::_get_camera_normal() const { Vector3 Node3DEditorViewport::_get_ray(const Vector2 &p_pos) const { - return camera->project_ray_normal(p_pos / viewport_container->get_stretch_shrink()); + return camera->project_ray_normal(p_pos / subviewport_container->get_stretch_shrink()); } void Node3DEditorViewport::_clear_selected() { @@ -494,7 +494,7 @@ ObjectID Node3DEditorViewport::_select_ray(const Point2 &p_pos, bool p_append, b Vector3 ray = _get_ray(p_pos); Vector3 pos = _get_ray_pos(p_pos); - Vector2 shrinked_pos = p_pos / viewport_container->get_stretch_shrink(); + Vector2 shrinked_pos = p_pos / subviewport_container->get_stretch_shrink(); Vector<ObjectID> instances = RenderingServer::get_singleton()->instances_cull_ray(pos, ray, get_tree()->get_root()->get_world()->get_scenario()); Set<Ref<EditorNode3DGizmo>> found_gizmos; @@ -2472,8 +2472,8 @@ void Node3DEditorViewport::_notification(int p_what) { bool shrink = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(VIEW_HALF_RESOLUTION)); - if (shrink != (viewport_container->get_stretch_shrink() > 1)) { - viewport_container->set_stretch_shrink(shrink ? 2 : 1); + if (shrink != (subviewport_container->get_stretch_shrink() > 1)) { + subviewport_container->set_stretch_shrink(shrink ? 2 : 1); } //update msaa if changed @@ -3000,6 +3000,7 @@ void Node3DEditorViewport::_menu_option(int p_option) { case VIEW_DISPLAY_DEBUG_GIPROBE_EMISSION: case VIEW_DISPLAY_DEBUG_SCENE_LUMINANCE: case VIEW_DISPLAY_DEBUG_SSAO: + case VIEW_DISPLAY_DEBUG_PSSM_SPLITS: case VIEW_DISPLAY_DEBUG_ROUGHNESS_LIMITER: { static const int display_options[] = { @@ -3018,6 +3019,7 @@ void Node3DEditorViewport::_menu_option(int p_option) { VIEW_DISPLAY_DEBUG_SCENE_LUMINANCE, VIEW_DISPLAY_DEBUG_SSAO, VIEW_DISPLAY_DEBUG_ROUGHNESS_LIMITER, + VIEW_DISPLAY_DEBUG_PSSM_SPLITS, VIEW_MAX }; static const Viewport::DebugDraw debug_draw_modes[] = { @@ -3036,6 +3038,7 @@ void Node3DEditorViewport::_menu_option(int p_option) { Viewport::DEBUG_DRAW_SCENE_LUMINANCE, Viewport::DEBUG_DRAW_SSAO, Viewport::DEBUG_DRAW_ROUGHNESS_LIMITER, + Viewport::DEBUG_DRAW_PSSM_SPLITS, }; int idx = 0; @@ -3237,8 +3240,8 @@ void Node3DEditorViewport::update_transform_gizmo_view() { const int viewport_base_height = 400 * MAX(1, EDSCALE); gizmo_scale = (gizmo_size / Math::abs(dd)) * MAX(1, EDSCALE) * - MIN(viewport_base_height, viewport_container->get_size().height) / viewport_base_height / - viewport_container->get_stretch_shrink(); + MIN(viewport_base_height, subviewport_container->get_size().height) / viewport_base_height / + subviewport_container->get_stretch_shrink(); Vector3 scale = Vector3(1, 1, 1) * gizmo_scale; xform.basis.scale(scale); @@ -3398,7 +3401,7 @@ Dictionary Node3DEditorViewport::get_state() const { d["gizmos"] = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(VIEW_GIZMOS)); d["information"] = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(VIEW_INFORMATION)); d["fps"] = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(VIEW_FPS)); - d["half_res"] = viewport_container->get_stretch_shrink() > 1; + d["half_res"] = subviewport_container->get_stretch_shrink() > 1; d["cinematic_preview"] = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(VIEW_CINEMATIC_PREVIEW)); if (previewing) d["previewing"] = EditorNode::get_singleton()->get_edited_scene()->get_path_to(previewing); @@ -3829,8 +3832,8 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, Edito zoom_indicator_delay = 0.0; spatial_editor = p_spatial_editor; - ViewportContainer *c = memnew(ViewportContainer); - viewport_container = c; + SubViewportContainer *c = memnew(SubViewportContainer); + subviewport_container = c; c->set_stretch(true); add_child(c); c->set_anchors_and_margins_preset(Control::PRESET_WIDE); @@ -3887,6 +3890,8 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, Edito view_menu->get_popup()->add_radio_check_shortcut(ED_SHORTCUT("spatial_editor/view_display_lighting", TTR("Display Lighting")), VIEW_DISPLAY_LIGHTING); view_menu->get_popup()->add_radio_check_shortcut(ED_SHORTCUT("spatial_editor/view_display_unshaded", TTR("Display Unshaded")), VIEW_DISPLAY_SHADELESS); view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(VIEW_DISPLAY_NORMAL), true); + display_submenu->add_radio_check_item(TTR("Directional Shadow Splits"), VIEW_DISPLAY_DEBUG_PSSM_SPLITS); + display_submenu->add_separator(); display_submenu->add_radio_check_item(TTR("Normal Buffer"), VIEW_DISPLAY_NORMAL_BUFFER); display_submenu->add_separator(); display_submenu->add_radio_check_item(TTR("Shadow Atlas"), VIEW_DISPLAY_DEBUG_SHADOW_ATLAS); @@ -5907,28 +5912,28 @@ void Node3DEditor::_node_removed(Node *p_node) { } void Node3DEditor::_register_all_gizmos() { - add_gizmo_plugin(Ref<CameraNode3DGizmoPlugin>(memnew(CameraNode3DGizmoPlugin))); - add_gizmo_plugin(Ref<LightNode3DGizmoPlugin>(memnew(LightNode3DGizmoPlugin))); - add_gizmo_plugin(Ref<AudioStreamPlayer3DNode3DGizmoPlugin>(memnew(AudioStreamPlayer3DNode3DGizmoPlugin))); - add_gizmo_plugin(Ref<MeshInstanceNode3DGizmoPlugin>(memnew(MeshInstanceNode3DGizmoPlugin))); - add_gizmo_plugin(Ref<SoftBodyNode3DGizmoPlugin>(memnew(SoftBodyNode3DGizmoPlugin))); - add_gizmo_plugin(Ref<Sprite3DNode3DGizmoPlugin>(memnew(Sprite3DNode3DGizmoPlugin))); - add_gizmo_plugin(Ref<SkeletonNode3DGizmoPlugin>(memnew(SkeletonNode3DGizmoPlugin))); - add_gizmo_plugin(Ref<Position3DNode3DGizmoPlugin>(memnew(Position3DNode3DGizmoPlugin))); - add_gizmo_plugin(Ref<RayCastNode3DGizmoPlugin>(memnew(RayCastNode3DGizmoPlugin))); - add_gizmo_plugin(Ref<SpringArmNode3DGizmoPlugin>(memnew(SpringArmNode3DGizmoPlugin))); - add_gizmo_plugin(Ref<VehicleWheelNode3DGizmoPlugin>(memnew(VehicleWheelNode3DGizmoPlugin))); - add_gizmo_plugin(Ref<VisibilityNotifierGizmoPlugin>(memnew(VisibilityNotifierGizmoPlugin))); + add_gizmo_plugin(Ref<Camera3DGizmoPlugin>(memnew(Camera3DGizmoPlugin))); + add_gizmo_plugin(Ref<Light3DGizmoPlugin>(memnew(Light3DGizmoPlugin))); + add_gizmo_plugin(Ref<AudioStreamPlayer3DGizmoPlugin>(memnew(AudioStreamPlayer3DGizmoPlugin))); + add_gizmo_plugin(Ref<MeshInstance3DGizmoPlugin>(memnew(MeshInstance3DGizmoPlugin))); + add_gizmo_plugin(Ref<SoftBody3DGizmoPlugin>(memnew(SoftBody3DGizmoPlugin))); + add_gizmo_plugin(Ref<Sprite3DGizmoPlugin>(memnew(Sprite3DGizmoPlugin))); + add_gizmo_plugin(Ref<Skeleton3DGizmoPlugin>(memnew(Skeleton3DGizmoPlugin))); + add_gizmo_plugin(Ref<Position3DGizmoPlugin>(memnew(Position3DGizmoPlugin))); + add_gizmo_plugin(Ref<RayCast3DGizmoPlugin>(memnew(RayCast3DGizmoPlugin))); + add_gizmo_plugin(Ref<SpringArm3DGizmoPlugin>(memnew(SpringArm3DGizmoPlugin))); + add_gizmo_plugin(Ref<VehicleWheel3DGizmoPlugin>(memnew(VehicleWheel3DGizmoPlugin))); + add_gizmo_plugin(Ref<VisibilityNotifier3DGizmoPlugin>(memnew(VisibilityNotifier3DGizmoPlugin))); add_gizmo_plugin(Ref<GPUParticles3DGizmoPlugin>(memnew(GPUParticles3DGizmoPlugin))); add_gizmo_plugin(Ref<CPUParticles3DGizmoPlugin>(memnew(CPUParticles3DGizmoPlugin))); add_gizmo_plugin(Ref<ReflectionProbeGizmoPlugin>(memnew(ReflectionProbeGizmoPlugin))); add_gizmo_plugin(Ref<GIProbeGizmoPlugin>(memnew(GIProbeGizmoPlugin))); // add_gizmo_plugin(Ref<BakedIndirectLightGizmoPlugin>(memnew(BakedIndirectLightGizmoPlugin))); - add_gizmo_plugin(Ref<CollisionShapeNode3DGizmoPlugin>(memnew(CollisionShapeNode3DGizmoPlugin))); - add_gizmo_plugin(Ref<CollisionPolygonNode3DGizmoPlugin>(memnew(CollisionPolygonNode3DGizmoPlugin))); - add_gizmo_plugin(Ref<NavigationMeshNode3DGizmoPlugin>(memnew(NavigationMeshNode3DGizmoPlugin))); - add_gizmo_plugin(Ref<JointNode3DGizmoPlugin>(memnew(JointNode3DGizmoPlugin))); - add_gizmo_plugin(Ref<PhysicalBoneNode3DGizmoPlugin>(memnew(PhysicalBoneNode3DGizmoPlugin))); + add_gizmo_plugin(Ref<CollisionShape3DGizmoPlugin>(memnew(CollisionShape3DGizmoPlugin))); + add_gizmo_plugin(Ref<CollisionPolygon3DGizmoPlugin>(memnew(CollisionPolygon3DGizmoPlugin))); + add_gizmo_plugin(Ref<NavigationRegion3DGizmoPlugin>(memnew(NavigationRegion3DGizmoPlugin))); + add_gizmo_plugin(Ref<Joint3DGizmoPlugin>(memnew(Joint3DGizmoPlugin))); + add_gizmo_plugin(Ref<PhysicalBone3DGizmoPlugin>(memnew(PhysicalBone3DGizmoPlugin))); } void Node3DEditor::_bind_methods() { diff --git a/editor/plugins/node_3d_editor_plugin.h b/editor/plugins/node_3d_editor_plugin.h index e485edae02..bb83e7f626 100644 --- a/editor/plugins/node_3d_editor_plugin.h +++ b/editor/plugins/node_3d_editor_plugin.h @@ -43,7 +43,7 @@ class Camera3D; class Node3DEditor; class EditorNode3DGizmoPlugin; class Node3DEditorViewport; -class ViewportContainer; +class SubViewportContainer; class EditorNode3DGizmo : public Node3DGizmo { @@ -218,6 +218,7 @@ class Node3DEditorViewport : public Control { VIEW_DISPLAY_DEBUG_SCENE_LUMINANCE, VIEW_DISPLAY_DEBUG_SSAO, VIEW_DISPLAY_DEBUG_ROUGHNESS_LIMITER, + VIEW_DISPLAY_DEBUG_PSSM_SPLITS, VIEW_LOCK_ROTATION, VIEW_CINEMATIC_PREVIEW, VIEW_AUTO_ORTHOGONAL, @@ -256,7 +257,7 @@ private: UndoRedo *undo_redo; CheckBox *preview_camera; - ViewportContainer *viewport_container; + SubViewportContainer *subviewport_container; MenuButton *view_menu; PopupMenu *display_submenu; diff --git a/editor/plugins/path_3d_editor_plugin.cpp b/editor/plugins/path_3d_editor_plugin.cpp index 3ee8225418..d3ece9556d 100644 --- a/editor/plugins/path_3d_editor_plugin.cpp +++ b/editor/plugins/path_3d_editor_plugin.cpp @@ -34,7 +34,7 @@ #include "node_3d_editor_plugin.h" #include "scene/resources/curve.h" -String PathNode3DGizmo::get_handle_name(int p_idx) const { +String Path3DGizmo::get_handle_name(int p_idx) const { Ref<Curve3D> c = path->get_curve(); if (c.is_null()) @@ -57,7 +57,7 @@ String PathNode3DGizmo::get_handle_name(int p_idx) const { return n; } -Variant PathNode3DGizmo::get_handle_value(int p_idx) { +Variant Path3DGizmo::get_handle_value(int p_idx) { Ref<Curve3D> c = path->get_curve(); if (c.is_null()) @@ -84,7 +84,7 @@ Variant PathNode3DGizmo::get_handle_value(int p_idx) { return ofs; } -void PathNode3DGizmo::set_handle(int p_idx, Camera3D *p_camera, const Point2 &p_point) { +void Path3DGizmo::set_handle(int p_idx, Camera3D *p_camera, const Point2 &p_point) { Ref<Curve3D> c = path->get_curve(); if (c.is_null()) @@ -154,7 +154,7 @@ void PathNode3DGizmo::set_handle(int p_idx, Camera3D *p_camera, const Point2 &p_ } } -void PathNode3DGizmo::commit_handle(int p_idx, const Variant &p_restore, bool p_cancel) { +void Path3DGizmo::commit_handle(int p_idx, const Variant &p_restore, bool p_cancel) { Ref<Curve3D> c = path->get_curve(); if (c.is_null()) @@ -217,7 +217,7 @@ void PathNode3DGizmo::commit_handle(int p_idx, const Variant &p_restore, bool p_ } } -void PathNode3DGizmo::redraw() { +void Path3DGizmo::redraw() { clear(); @@ -286,7 +286,7 @@ void PathNode3DGizmo::redraw() { } } -PathNode3DGizmo::PathNode3DGizmo(Path3D *p_path) { +Path3DGizmo::Path3DGizmo(Path3D *p_path) { path = p_path; set_spatial_node(p_path); @@ -563,7 +563,7 @@ Path3DEditorPlugin::Path3DEditorPlugin(EditorNode *p_node) { mirror_handle_angle = true; mirror_handle_length = true; - Ref<PathNode3DGizmoPlugin> gizmo_plugin; + Ref<Path3DGizmoPlugin> gizmo_plugin; gizmo_plugin.instance(); Node3DEditor::get_singleton()->add_gizmo_plugin(gizmo_plugin); @@ -627,24 +627,24 @@ Path3DEditorPlugin::Path3DEditorPlugin(EditorNode *p_node) { Path3DEditorPlugin::~Path3DEditorPlugin() { } -Ref<EditorNode3DGizmo> PathNode3DGizmoPlugin::create_gizmo(Node3D *p_spatial) { - Ref<PathNode3DGizmo> ref; +Ref<EditorNode3DGizmo> Path3DGizmoPlugin::create_gizmo(Node3D *p_spatial) { + Ref<Path3DGizmo> ref; Path3D *path = Object::cast_to<Path3D>(p_spatial); - if (path) ref = Ref<PathNode3DGizmo>(memnew(PathNode3DGizmo(path))); + if (path) ref = Ref<Path3DGizmo>(memnew(Path3DGizmo(path))); return ref; } -String PathNode3DGizmoPlugin::get_name() const { +String Path3DGizmoPlugin::get_name() const { return "Path3D"; } -int PathNode3DGizmoPlugin::get_priority() const { +int Path3DGizmoPlugin::get_priority() const { return -1; } -PathNode3DGizmoPlugin::PathNode3DGizmoPlugin() { +Path3DGizmoPlugin::Path3DGizmoPlugin() { Color path_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/path", Color(0.5, 0.5, 1.0, 0.8)); create_material("path_material", path_color); diff --git a/editor/plugins/path_3d_editor_plugin.h b/editor/plugins/path_3d_editor_plugin.h index 715f8d1bb5..3f18cadacd 100644 --- a/editor/plugins/path_3d_editor_plugin.h +++ b/editor/plugins/path_3d_editor_plugin.h @@ -34,9 +34,9 @@ #include "editor/node_3d_editor_gizmos.h" #include "scene/3d/path_3d.h" -class PathNode3DGizmo : public EditorNode3DGizmo { +class Path3DGizmo : public EditorNode3DGizmo { - GDCLASS(PathNode3DGizmo, EditorNode3DGizmo); + GDCLASS(Path3DGizmo, EditorNode3DGizmo); Path3D *path; mutable Vector3 original; @@ -50,12 +50,12 @@ public: virtual void commit_handle(int p_idx, const Variant &p_restore, bool p_cancel = false); virtual void redraw(); - PathNode3DGizmo(Path3D *p_path = nullptr); + Path3DGizmo(Path3D *p_path = nullptr); }; -class PathNode3DGizmoPlugin : public EditorNode3DGizmoPlugin { +class Path3DGizmoPlugin : public EditorNode3DGizmoPlugin { - GDCLASS(PathNode3DGizmoPlugin, EditorNode3DGizmoPlugin); + GDCLASS(Path3DGizmoPlugin, EditorNode3DGizmoPlugin); protected: Ref<EditorNode3DGizmo> create_gizmo(Node3D *p_spatial); @@ -63,7 +63,7 @@ protected: public: String get_name() const; int get_priority() const; - PathNode3DGizmoPlugin(); + Path3DGizmoPlugin(); }; class Path3DEditorPlugin : public EditorPlugin { diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index dd80fff008..0b97ade278 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -1243,7 +1243,7 @@ void ScriptEditor::_menu_option(int p_option) { file_system_dock->navigate_to_path(path); // Ensure that the FileSystem dock is visible. TabContainer *tab_container = (TabContainer *)file_system_dock->get_parent_control(); - tab_container->set_current_tab(file_system_dock->get_position_in_parent()); + tab_container->set_current_tab(file_system_dock->get_index()); } } break; case CLOSE_DOCS: { diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp index cd69c1e6f9..8892d13f51 100644 --- a/editor/plugins/texture_region_editor_plugin.cpp +++ b/editor/plugins/texture_region_editor_plugin.cpp @@ -1030,6 +1030,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode *p_editor) { hscroll->connect("value_changed", callable_mp(this, &TextureRegionEditor::_scroll_changed)); updating_scroll = false; + autoslice_is_dirty = true; } void TextureRegionEditorPlugin::edit(Object *p_object) { diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index b1bd6392d8..294ce2c4cd 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -556,6 +556,17 @@ void VisualShaderEditor::_update_graph() { uniform_name->connect("text_entered", callable_mp(this, &VisualShaderEditor::_line_edit_changed), varray(uniform_name, nodes[n_i])); uniform_name->connect("focus_exited", callable_mp(this, &VisualShaderEditor::_line_edit_focus_out), varray(uniform_name, nodes[n_i])); + String error = vsnode->get_warning(visual_shader->get_mode(), type); + if (error != String()) { + offset = memnew(Control); + offset->set_custom_minimum_size(Size2(0, 4 * EDSCALE)); + node->add_child(offset); + Label *error_label = memnew(Label); + error_label->add_theme_color_override("font_color", get_theme_color("error_color", "Editor")); + error_label->set_text(error); + node->add_child(error_label); + } + if (vsnode->get_input_port_count() == 0 && vsnode->get_output_port_count() == 1 && vsnode->get_output_port_name(0) == "") { //shortcut VisualShaderNode::PortType port_right = vsnode->get_output_port_type(0); diff --git a/editor/project_export.cpp b/editor/project_export.cpp index b30cd89c96..04ec5ae043 100644 --- a/editor/project_export.cpp +++ b/editor/project_export.cpp @@ -1205,12 +1205,9 @@ ProjectExportDialog::ProjectExportDialog() { custom_features = memnew(LineEdit); custom_features->connect("text_changed", callable_mp(this, &ProjectExportDialog::_custom_features_changed)); feature_vb->add_margin_child(TTR("Custom (comma-separated):"), custom_features); - Panel *features_panel = memnew(Panel); custom_feature_display = memnew(RichTextLabel); - features_panel->add_child(custom_feature_display); - custom_feature_display->set_anchors_and_margins_preset(Control::PRESET_WIDE, Control::PRESET_MODE_MINSIZE, 10 * EDSCALE); custom_feature_display->set_v_size_flags(Control::SIZE_EXPAND_FILL); - feature_vb->add_margin_child(TTR("Feature List:"), features_panel, true); + feature_vb->add_margin_child(TTR("Feature List:"), custom_feature_display, true); sections->add_child(feature_vb); // Script export parameters. diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index 444cae42c5..978c95b9c8 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -257,7 +257,7 @@ void CustomPropertyEditor::_menu_option(int p_which) { file_system_dock->navigate_to_path(r->get_path()); // Ensure that the FileSystem dock is visible. TabContainer *tab_container = (TabContainer *)file_system_dock->get_parent_control(); - tab_container->set_current_tab(file_system_dock->get_position_in_parent()); + tab_container->set_current_tab(file_system_dock->get_index()); } break; default: { diff --git a/editor/quick_open.cpp b/editor/quick_open.cpp index 4d9870235d..1b4439f0a8 100644 --- a/editor/quick_open.cpp +++ b/editor/quick_open.cpp @@ -265,8 +265,7 @@ void EditorQuickOpen::_notification(int p_what) { connect("confirmed", callable_mp(this, &EditorQuickOpen::_confirmed)); search_box->set_clear_button_enabled(true); - [[fallthrough]]; - } + } break; case NOTIFICATION_EXIT_TREE: { disconnect("confirmed", callable_mp(this, &EditorQuickOpen::_confirmed)); } break; diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index eaefd04c6b..a729f62123 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -1535,7 +1535,7 @@ void SceneTreeDock::_do_reparent(Node *p_new_parent, int p_position_in_parent, V if (p_nodes[ni] == p_new_parent) return; // Attempt to reparent to itself. - if (p_nodes[ni]->get_parent() != p_new_parent || p_position_in_parent + ni != p_nodes[ni]->get_position_in_parent()) + if (p_nodes[ni]->get_parent() != p_new_parent || p_position_in_parent + ni != p_nodes[ni]->get_index()) no_change = false; } @@ -1644,7 +1644,7 @@ void SceneTreeDock::_do_reparent(Node *p_new_parent, int p_position_in_parent, V owners.push_back(E->get()); } - int child_pos = node->get_position_in_parent(); + int child_pos = node->get_index(); editor_data->get_undo_redo().add_undo_method(node->get_parent(), "add_child", node); editor_data->get_undo_redo().add_undo_method(node->get_parent(), "move_child", node, child_pos); @@ -1918,7 +1918,7 @@ Node *SceneTreeDock::_get_selection_group_tail(Node *p_node, List<Node *> p_list Node *tail = p_node; Node *parent = tail->get_parent(); - for (int i = p_node->get_position_in_parent(); i < parent->get_child_count(); i++) { + for (int i = p_node->get_index(); i < parent->get_child_count(); i++) { Node *sibling = parent->get_child(i); if (p_list.find(sibling)) |