diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-03-27 08:44:44 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2020-03-27 16:26:34 +0100 |
commit | d1acbbce7f123c2b5fccdefc6417787dc91b6ced (patch) | |
tree | 3143b3548ee2e46c4a56881f1284f962cc2ae878 /editor/plugins | |
parent | c3a760c5079670854b5f0c197c15218b1606bb2d (diff) |
Rename more 2D and 3D nodes to follow convention
Rename editor plugins to match the new node names.
Diffstat (limited to 'editor/plugins')
-rw-r--r-- | editor/plugins/animation_player_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/camera_3d_editor_plugin.cpp (renamed from editor/plugins/camera_editor_plugin.cpp) | 28 | ||||
-rw-r--r-- | editor/plugins/camera_3d_editor_plugin.h (renamed from editor/plugins/camera_editor_plugin.h) | 16 | ||||
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 12 | ||||
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.h | 2 | ||||
-rw-r--r-- | editor/plugins/collision_polygon_3d_editor_plugin.cpp (renamed from editor/plugins/collision_polygon_editor_plugin.cpp) | 38 | ||||
-rw-r--r-- | editor/plugins/collision_polygon_3d_editor_plugin.h (renamed from editor/plugins/collision_polygon_editor_plugin.h) | 12 | ||||
-rw-r--r-- | editor/plugins/cpu_particles_2d_editor_plugin.cpp | 5 | ||||
-rw-r--r-- | editor/plugins/cpu_particles_3d_editor_plugin.cpp (renamed from editor/plugins/cpu_particles_editor_plugin.cpp) | 38 | ||||
-rw-r--r-- | editor/plugins/cpu_particles_3d_editor_plugin.h (renamed from editor/plugins/cpu_particles_editor_plugin.h) | 22 | ||||
-rw-r--r-- | editor/plugins/gpu_particles_2d_editor_plugin.cpp (renamed from editor/plugins/particles_2d_editor_plugin.cpp) | 44 | ||||
-rw-r--r-- | editor/plugins/gpu_particles_2d_editor_plugin.h (renamed from editor/plugins/particles_2d_editor_plugin.h) | 14 | ||||
-rw-r--r-- | editor/plugins/gpu_particles_3d_editor_plugin.cpp (renamed from editor/plugins/particles_editor_plugin.cpp) | 60 | ||||
-rw-r--r-- | editor/plugins/gpu_particles_3d_editor_plugin.h (renamed from editor/plugins/particles_editor_plugin.h) | 26 | ||||
-rw-r--r-- | editor/plugins/gradient_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/material_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/mesh_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/mesh_instance_3d_editor_plugin.cpp (renamed from editor/plugins/mesh_instance_editor_plugin.cpp) | 52 | ||||
-rw-r--r-- | editor/plugins/mesh_instance_3d_editor_plugin.h (renamed from editor/plugins/mesh_instance_editor_plugin.h) | 20 | ||||
-rw-r--r-- | editor/plugins/mesh_library_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/multimesh_editor_plugin.cpp | 4 | ||||
-rw-r--r-- | editor/plugins/navigation_polygon_editor_plugin.h | 2 | ||||
-rw-r--r-- | editor/plugins/node_3d_editor_plugin.cpp (renamed from editor/plugins/spatial_editor_plugin.cpp) | 6 | ||||
-rw-r--r-- | editor/plugins/node_3d_editor_plugin.h (renamed from editor/plugins/spatial_editor_plugin.h) | 2 | ||||
-rw-r--r-- | editor/plugins/path_3d_editor_plugin.cpp (renamed from editor/plugins/path_editor_plugin.cpp) | 66 | ||||
-rw-r--r-- | editor/plugins/path_3d_editor_plugin.h (renamed from editor/plugins/path_editor_plugin.h) | 14 | ||||
-rw-r--r-- | editor/plugins/physical_bone_3d_editor_plugin.cpp (renamed from editor/plugins/physical_bone_plugin.cpp) | 33 | ||||
-rw-r--r-- | editor/plugins/physical_bone_3d_editor_plugin.h (renamed from editor/plugins/physical_bone_plugin.h) | 18 | ||||
-rw-r--r-- | editor/plugins/skeleton_3d_editor_plugin.cpp (renamed from editor/plugins/skeleton_editor_plugin.cpp) | 42 | ||||
-rw-r--r-- | editor/plugins/skeleton_3d_editor_plugin.h (renamed from editor/plugins/skeleton_editor_plugin.h) | 30 | ||||
-rw-r--r-- | editor/plugins/skeleton_ik_3d_editor_plugin.cpp (renamed from editor/plugins/skeleton_ik_editor_plugin.cpp) | 22 | ||||
-rw-r--r-- | editor/plugins/skeleton_ik_3d_editor_plugin.h (renamed from editor/plugins/skeleton_ik_editor_plugin.h) | 16 | ||||
-rw-r--r-- | editor/plugins/sprite_2d_editor_plugin.cpp (renamed from editor/plugins/sprite_editor_plugin.cpp) | 58 | ||||
-rw-r--r-- | editor/plugins/sprite_2d_editor_plugin.h (renamed from editor/plugins/sprite_editor_plugin.h) | 20 |
34 files changed, 366 insertions, 366 deletions
diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp index b75c56dd47..41af2ab0cc 100644 --- a/editor/plugins/animation_player_editor_plugin.cpp +++ b/editor/plugins/animation_player_editor_plugin.cpp @@ -39,7 +39,7 @@ #include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/plugins/canvas_item_editor_plugin.h" // For onion skinning. -#include "editor/plugins/spatial_editor_plugin.h" // For onion skinning. +#include "editor/plugins/node_3d_editor_plugin.h" // For onion skinning. #include "scene/main/window.h" #include "servers/visual_server.h" diff --git a/editor/plugins/camera_editor_plugin.cpp b/editor/plugins/camera_3d_editor_plugin.cpp index 2b6dd379e2..3d9b74c2da 100644 --- a/editor/plugins/camera_editor_plugin.cpp +++ b/editor/plugins/camera_3d_editor_plugin.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* camera_editor_plugin.cpp */ +/* camera_3d_editor_plugin.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,11 +28,11 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "camera_editor_plugin.h" +#include "camera_3d_editor_plugin.h" -#include "spatial_editor_plugin.h" +#include "node_3d_editor_plugin.h" -void CameraEditor::_node_removed(Node *p_node) { +void Camera3DEditor::_node_removed(Node *p_node) { if (p_node == node) { node = NULL; @@ -41,16 +41,16 @@ void CameraEditor::_node_removed(Node *p_node) { } } -void CameraEditor::_pressed() { +void Camera3DEditor::_pressed() { Node *sn = (node && preview->is_pressed()) ? node : NULL; Node3DEditor::get_singleton()->set_custom_camera(sn); } -void CameraEditor::_bind_methods() { +void Camera3DEditor::_bind_methods() { } -void CameraEditor::edit(Node *p_camera) { +void Camera3DEditor::edit(Node *p_camera) { node = p_camera; @@ -66,7 +66,7 @@ void CameraEditor::edit(Node *p_camera) { } } -CameraEditor::CameraEditor() { +Camera3DEditor::Camera3DEditor() { preview = memnew(Button); add_child(preview); @@ -79,21 +79,21 @@ CameraEditor::CameraEditor() { preview->set_margin(MARGIN_RIGHT, 0); preview->set_margin(MARGIN_TOP, 0); preview->set_margin(MARGIN_BOTTOM, 10); - preview->connect("pressed", callable_mp(this, &CameraEditor::_pressed)); + preview->connect("pressed", callable_mp(this, &Camera3DEditor::_pressed)); } -void CameraEditorPlugin::edit(Object *p_object) { +void Camera3DEditorPlugin::edit(Object *p_object) { Node3DEditor::get_singleton()->set_can_preview(Object::cast_to<Camera3D>(p_object)); //camera_editor->edit(Object::cast_to<Node>(p_object)); } -bool CameraEditorPlugin::handles(Object *p_object) const { +bool Camera3DEditorPlugin::handles(Object *p_object) const { return p_object->is_class("Camera3D"); } -void CameraEditorPlugin::make_visible(bool p_visible) { +void Camera3DEditorPlugin::make_visible(bool p_visible) { if (p_visible) { //Node3DEditor::get_singleton()->set_can_preview(Object::cast_to<Camera>(p_object)); @@ -102,7 +102,7 @@ void CameraEditorPlugin::make_visible(bool p_visible) { } } -CameraEditorPlugin::CameraEditorPlugin(EditorNode *p_node) { +Camera3DEditorPlugin::Camera3DEditorPlugin(EditorNode *p_node) { editor = p_node; /* camera_editor = memnew( CameraEditor ); @@ -120,5 +120,5 @@ CameraEditorPlugin::CameraEditorPlugin(EditorNode *p_node) { */ } -CameraEditorPlugin::~CameraEditorPlugin() { +Camera3DEditorPlugin::~Camera3DEditorPlugin() { } diff --git a/editor/plugins/camera_editor_plugin.h b/editor/plugins/camera_3d_editor_plugin.h index 3e59d49371..1e57ac7cd2 100644 --- a/editor/plugins/camera_editor_plugin.h +++ b/editor/plugins/camera_3d_editor_plugin.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* camera_editor_plugin.h */ +/* camera_3d_editor_plugin.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -35,9 +35,9 @@ #include "editor/editor_plugin.h" #include "scene/3d/camera_3d.h" -class CameraEditor : public Control { +class Camera3DEditor : public Control { - GDCLASS(CameraEditor, Control); + GDCLASS(Camera3DEditor, Control); Panel *panel; Button *preview; @@ -51,12 +51,12 @@ protected: public: void edit(Node *p_camera); - CameraEditor(); + Camera3DEditor(); }; -class CameraEditorPlugin : public EditorPlugin { +class Camera3DEditorPlugin : public EditorPlugin { - GDCLASS(CameraEditorPlugin, EditorPlugin); + GDCLASS(Camera3DEditorPlugin, EditorPlugin); //CameraEditor *camera_editor; EditorNode *editor; @@ -68,8 +68,8 @@ public: virtual bool handles(Object *p_object) const; virtual void make_visible(bool p_visible); - CameraEditorPlugin(EditorNode *p_node); - ~CameraEditorPlugin(); + Camera3DEditorPlugin(EditorNode *p_node); + ~Camera3DEditorPlugin(); }; #endif // CAMERA_EDITOR_PLUGIN_H diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index dbd1f68f00..ba9cba5515 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -40,8 +40,8 @@ #include "editor/editor_settings.h" #include "editor/plugins/animation_player_editor_plugin.h" #include "editor/plugins/script_editor_plugin.h" +#include "scene/2d/gpu_particles_2d.h" #include "scene/2d/light_2d.h" -#include "scene/2d/particles_2d.h" #include "scene/2d/polygon_2d.h" #include "scene/2d/skeleton_2d.h" #include "scene/2d/sprite_2d.h" @@ -6083,8 +6083,8 @@ void CanvasItemEditorViewport::_perform_drop_data() { Node *child; if (default_type == "Light2D") child = memnew(Light2D); - else if (default_type == "Particles2D") - child = memnew(Particles2D); + else if (default_type == "GPUParticles2D") + child = memnew(GPUParticles2D); else if (default_type == "Polygon2D") child = memnew(Polygon2D); else if (default_type == "TouchScreenButton") @@ -6247,11 +6247,11 @@ void CanvasItemEditorViewport::_bind_methods() { } CanvasItemEditorViewport::CanvasItemEditorViewport(EditorNode *p_node, CanvasItemEditor *p_canvas_item_editor) { - default_type = "Sprite"; + default_type = "Sprite2D"; // Node2D - types.push_back("Sprite"); + types.push_back("Sprite2D"); types.push_back("Light2D"); - types.push_back("Particles2D"); + types.push_back("GPUParticles2D"); types.push_back("Polygon2D"); types.push_back("TouchScreenButton"); // Control diff --git a/editor/plugins/canvas_item_editor_plugin.h b/editor/plugins/canvas_item_editor_plugin.h index f109b06aa3..34965868e0 100644 --- a/editor/plugins/canvas_item_editor_plugin.h +++ b/editor/plugins/canvas_item_editor_plugin.h @@ -33,12 +33,12 @@ #include "editor/editor_node.h" #include "editor/editor_plugin.h" -#include "scene/2d/canvas_item.h" #include "scene/gui/box_container.h" #include "scene/gui/check_box.h" #include "scene/gui/label.h" #include "scene/gui/panel_container.h" #include "scene/gui/spin_box.h" +#include "scene/main/canvas_item.h" class CanvasItemEditorViewport; diff --git a/editor/plugins/collision_polygon_editor_plugin.cpp b/editor/plugins/collision_polygon_3d_editor_plugin.cpp index 98bd655a03..5b35a4826c 100644 --- a/editor/plugins/collision_polygon_editor_plugin.cpp +++ b/editor/plugins/collision_polygon_3d_editor_plugin.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* collision_polygon_editor_plugin.cpp */ +/* collision_polygon_3d_editor_plugin.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,17 +28,17 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "collision_polygon_editor_plugin.h" +#include "collision_polygon_3d_editor_plugin.h" #include "canvas_item_editor_plugin.h" #include "core/input/input_filter.h" #include "core/os/file_access.h" #include "core/os/keyboard.h" #include "editor/editor_settings.h" +#include "node_3d_editor_plugin.h" #include "scene/3d/camera_3d.h" -#include "spatial_editor_plugin.h" -void Polygon3DEditor::_notification(int p_what) { +void CollisionPolygon3DEditor::_notification(int p_what) { switch (p_what) { @@ -47,7 +47,7 @@ void Polygon3DEditor::_notification(int p_what) { button_create->set_icon(get_theme_icon("Edit", "EditorIcons")); button_edit->set_icon(get_theme_icon("MovePoint", "EditorIcons")); button_edit->set_pressed(true); - get_tree()->connect("node_removed", callable_mp(this, &Polygon3DEditor::_node_removed)); + get_tree()->connect("node_removed", callable_mp(this, &CollisionPolygon3DEditor::_node_removed)); } break; case NOTIFICATION_PROCESS: { @@ -63,7 +63,7 @@ void Polygon3DEditor::_notification(int p_what) { } break; } } -void Polygon3DEditor::_node_removed(Node *p_node) { +void CollisionPolygon3DEditor::_node_removed(Node *p_node) { if (p_node == node) { node = NULL; @@ -74,7 +74,7 @@ void Polygon3DEditor::_node_removed(Node *p_node) { } } -void Polygon3DEditor::_menu_option(int p_option) { +void CollisionPolygon3DEditor::_menu_option(int p_option) { switch (p_option) { @@ -93,7 +93,7 @@ void Polygon3DEditor::_menu_option(int p_option) { } } -void Polygon3DEditor::_wip_close() { +void CollisionPolygon3DEditor::_wip_close() { undo_redo->create_action(TTR("Create Polygon3D")); undo_redo->add_undo_method(node, "set_polygon", node->call("get_polygon")); @@ -109,7 +109,7 @@ void Polygon3DEditor::_wip_close() { undo_redo->commit_action(); } -bool Polygon3DEditor::forward_spatial_gui_input(Camera3D *p_camera, const Ref<InputEvent> &p_event) { +bool CollisionPolygon3DEditor::forward_spatial_gui_input(Camera3D *p_camera, const Ref<InputEvent> &p_event) { if (!node) return false; @@ -360,7 +360,7 @@ bool Polygon3DEditor::forward_spatial_gui_input(Camera3D *p_camera, const Ref<In return false; } -float Polygon3DEditor::_get_depth() { +float CollisionPolygon3DEditor::_get_depth() { if (bool(node->call("_has_editable_3d_polygon_no_depth"))) return 0; @@ -368,7 +368,7 @@ float Polygon3DEditor::_get_depth() { return float(node->call("get_depth")); } -void Polygon3DEditor::_polygon_draw() { +void CollisionPolygon3DEditor::_polygon_draw() { if (!node) return; @@ -489,7 +489,7 @@ void Polygon3DEditor::_polygon_draw() { m->surface_set_material(0, handle_material); } -void Polygon3DEditor::edit(Node *p_collision_polygon) { +void CollisionPolygon3DEditor::edit(Node *p_collision_polygon) { if (p_collision_polygon) { @@ -516,12 +516,12 @@ void Polygon3DEditor::edit(Node *p_collision_polygon) { } } -void Polygon3DEditor::_bind_methods() { +void CollisionPolygon3DEditor::_bind_methods() { - ClassDB::bind_method(D_METHOD("_polygon_draw"), &Polygon3DEditor::_polygon_draw); + ClassDB::bind_method(D_METHOD("_polygon_draw"), &CollisionPolygon3DEditor::_polygon_draw); } -Polygon3DEditor::Polygon3DEditor(EditorNode *p_editor) { +CollisionPolygon3DEditor::CollisionPolygon3DEditor(EditorNode *p_editor) { node = NULL; editor = p_editor; @@ -530,12 +530,12 @@ Polygon3DEditor::Polygon3DEditor(EditorNode *p_editor) { add_child(memnew(VSeparator)); button_create = memnew(ToolButton); add_child(button_create); - button_create->connect("pressed", callable_mp(this, &Polygon3DEditor::_menu_option), varray(MODE_CREATE)); + button_create->connect("pressed", callable_mp(this, &CollisionPolygon3DEditor::_menu_option), varray(MODE_CREATE)); button_create->set_toggle_mode(true); button_edit = memnew(ToolButton); add_child(button_edit); - button_edit->connect("pressed", callable_mp(this, &Polygon3DEditor::_menu_option), varray(MODE_EDIT)); + button_edit->connect("pressed", callable_mp(this, &CollisionPolygon3DEditor::_menu_option), varray(MODE_EDIT)); button_edit->set_toggle_mode(true); mode = MODE_EDIT; @@ -569,7 +569,7 @@ Polygon3DEditor::Polygon3DEditor(EditorNode *p_editor) { snap_ignore = false; } -Polygon3DEditor::~Polygon3DEditor() { +CollisionPolygon3DEditor::~CollisionPolygon3DEditor() { memdelete(imgeom); } @@ -598,7 +598,7 @@ void Polygon3DEditorPlugin::make_visible(bool p_visible) { Polygon3DEditorPlugin::Polygon3DEditorPlugin(EditorNode *p_node) { editor = p_node; - collision_polygon_editor = memnew(Polygon3DEditor(p_node)); + collision_polygon_editor = memnew(CollisionPolygon3DEditor(p_node)); Node3DEditor::get_singleton()->add_control_to_menu_panel(collision_polygon_editor); collision_polygon_editor->hide(); diff --git a/editor/plugins/collision_polygon_editor_plugin.h b/editor/plugins/collision_polygon_3d_editor_plugin.h index 169b07b673..9751b1f79e 100644 --- a/editor/plugins/collision_polygon_editor_plugin.h +++ b/editor/plugins/collision_polygon_3d_editor_plugin.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* collision_polygon_editor_plugin.h */ +/* collision_polygon_3d_editor_plugin.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -40,9 +40,9 @@ class CanvasItemEditor; -class Polygon3DEditor : public HBoxContainer { +class CollisionPolygon3DEditor : public HBoxContainer { - GDCLASS(Polygon3DEditor, HBoxContainer); + GDCLASS(CollisionPolygon3DEditor, HBoxContainer); UndoRedo *undo_redo; enum Mode { @@ -92,15 +92,15 @@ protected: public: virtual bool forward_spatial_gui_input(Camera3D *p_camera, const Ref<InputEvent> &p_event); void edit(Node *p_collision_polygon); - Polygon3DEditor(EditorNode *p_editor); - ~Polygon3DEditor(); + CollisionPolygon3DEditor(EditorNode *p_editor); + ~CollisionPolygon3DEditor(); }; class Polygon3DEditorPlugin : public EditorPlugin { GDCLASS(Polygon3DEditorPlugin, EditorPlugin); - Polygon3DEditor *collision_polygon_editor; + CollisionPolygon3DEditor *collision_polygon_editor; EditorNode *editor; public: diff --git a/editor/plugins/cpu_particles_2d_editor_plugin.cpp b/editor/plugins/cpu_particles_2d_editor_plugin.cpp index 25b8fb8bcb..022663a61d 100644 --- a/editor/plugins/cpu_particles_2d_editor_plugin.cpp +++ b/editor/plugins/cpu_particles_2d_editor_plugin.cpp @@ -241,7 +241,7 @@ void CPUParticles2DEditorPlugin::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { menu->get_popup()->connect("id_pressed", callable_mp(this, &CPUParticles2DEditorPlugin::_menu_callback)); - menu->set_icon(epoints->get_theme_icon("Particles2D", "EditorIcons")); + menu->set_icon(epoints->get_theme_icon("CPUParticles2D", "EditorIcons")); file->connect("file_selected", callable_mp(this, &CPUParticles2DEditorPlugin::_file_selected)); } } @@ -265,8 +265,7 @@ CPUParticles2DEditorPlugin::CPUParticles2DEditorPlugin(EditorNode *p_node) { menu->get_popup()->add_item(TTR("Load Emission Mask"), MENU_LOAD_EMISSION_MASK); menu->get_popup()->add_separator(); menu->get_popup()->add_item(TTR("Restart"), MENU_RESTART); - // menu->get_popup()->add_item(TTR("Clear Emission Mask"), MENU_CLEAR_EMISSION_MASK); - menu->set_text(TTR("Particles")); + menu->set_text(TTR("CPUParticles2D")); menu->set_switch_on_hover(true); toolbar->add_child(menu); diff --git a/editor/plugins/cpu_particles_editor_plugin.cpp b/editor/plugins/cpu_particles_3d_editor_plugin.cpp index 4674903256..887e9e48df 100644 --- a/editor/plugins/cpu_particles_editor_plugin.cpp +++ b/editor/plugins/cpu_particles_3d_editor_plugin.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* cpu_particles_editor_plugin.cpp */ +/* cpu_particles_3d_editor_plugin.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,11 +28,11 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "cpu_particles_editor_plugin.h" +#include "cpu_particles_3d_editor_plugin.h" -#include "editor/plugins/spatial_editor_plugin.h" +#include "editor/plugins/node_3d_editor_plugin.h" -void CPUParticlesEditor::_node_removed(Node *p_node) { +void CPUParticles3DEditor::_node_removed(Node *p_node) { if (p_node == node) { node = NULL; @@ -40,14 +40,14 @@ void CPUParticlesEditor::_node_removed(Node *p_node) { } } -void CPUParticlesEditor::_notification(int p_notification) { +void CPUParticles3DEditor::_notification(int p_notification) { if (p_notification == NOTIFICATION_ENTER_TREE) { - options->set_icon(get_theme_icon("CPUParticles", "EditorIcons")); + options->set_icon(get_theme_icon("CPUParticles3D", "EditorIcons")); } } -void CPUParticlesEditor::_menu_option(int p_option) { +void CPUParticles3DEditor::_menu_option(int p_option) { switch (p_option) { @@ -65,13 +65,13 @@ void CPUParticlesEditor::_menu_option(int p_option) { } } -void CPUParticlesEditor::edit(CPUParticles3D *p_particles) { +void CPUParticles3DEditor::edit(CPUParticles3D *p_particles) { base_node = p_particles; node = p_particles; } -void CPUParticlesEditor::_generate_emission_points() { +void CPUParticles3DEditor::_generate_emission_points() { /// hacer codigo aca Vector<Vector3> points; @@ -91,10 +91,10 @@ void CPUParticlesEditor::_generate_emission_points() { } } -void CPUParticlesEditor::_bind_methods() { +void CPUParticles3DEditor::_bind_methods() { } -CPUParticlesEditor::CPUParticlesEditor() { +CPUParticles3DEditor::CPUParticles3DEditor() { particles_editor_hb = memnew(HBoxContainer); Node3DEditor::get_singleton()->add_control_to_menu_panel(particles_editor_hb); @@ -103,24 +103,24 @@ CPUParticlesEditor::CPUParticlesEditor() { particles_editor_hb->add_child(options); particles_editor_hb->hide(); - options->set_text(TTR("CPUParticles")); + options->set_text(TTR("CPUParticles3D")); options->get_popup()->add_item(TTR("Create Emission Points From Node"), MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_NODE); options->get_popup()->add_separator(); options->get_popup()->add_item(TTR("Restart"), MENU_OPTION_RESTART); - options->get_popup()->connect("id_pressed", callable_mp(this, &CPUParticlesEditor::_menu_option)); + options->get_popup()->connect("id_pressed", callable_mp(this, &CPUParticles3DEditor::_menu_option)); } -void CPUParticlesEditorPlugin::edit(Object *p_object) { +void CPUParticles3DEditorPlugin::edit(Object *p_object) { particles_editor->edit(Object::cast_to<CPUParticles3D>(p_object)); } -bool CPUParticlesEditorPlugin::handles(Object *p_object) const { +bool CPUParticles3DEditorPlugin::handles(Object *p_object) const { return p_object->is_class("CPUParticles3D"); } -void CPUParticlesEditorPlugin::make_visible(bool p_visible) { +void CPUParticles3DEditorPlugin::make_visible(bool p_visible) { if (p_visible) { particles_editor->show(); @@ -132,14 +132,14 @@ void CPUParticlesEditorPlugin::make_visible(bool p_visible) { } } -CPUParticlesEditorPlugin::CPUParticlesEditorPlugin(EditorNode *p_node) { +CPUParticles3DEditorPlugin::CPUParticles3DEditorPlugin(EditorNode *p_node) { editor = p_node; - particles_editor = memnew(CPUParticlesEditor); + particles_editor = memnew(CPUParticles3DEditor); editor->get_viewport()->add_child(particles_editor); particles_editor->hide(); } -CPUParticlesEditorPlugin::~CPUParticlesEditorPlugin() { +CPUParticles3DEditorPlugin::~CPUParticles3DEditorPlugin() { } diff --git a/editor/plugins/cpu_particles_editor_plugin.h b/editor/plugins/cpu_particles_3d_editor_plugin.h index ed47ed1436..aac9cc9a2f 100644 --- a/editor/plugins/cpu_particles_editor_plugin.h +++ b/editor/plugins/cpu_particles_3d_editor_plugin.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* cpu_particles_editor_plugin.h */ +/* cpu_particles_3d_editor_plugin.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -31,12 +31,12 @@ #ifndef CPU_PARTICLES_EDITOR_PLUGIN_H #define CPU_PARTICLES_EDITOR_PLUGIN_H -#include "editor/plugins/particles_editor_plugin.h" +#include "editor/plugins/gpu_particles_3d_editor_plugin.h" #include "scene/3d/cpu_particles_3d.h" -class CPUParticlesEditor : public ParticlesEditorBase { +class CPUParticles3DEditor : public GPUParticles3DEditorBase { - GDCLASS(CPUParticlesEditor, ParticlesEditorBase); + GDCLASS(CPUParticles3DEditor, GPUParticles3DEditorBase); enum Menu { @@ -50,7 +50,7 @@ class CPUParticlesEditor : public ParticlesEditorBase { void _menu_option(int); - friend class CPUParticlesEditorPlugin; + friend class CPUParticles3DEditorPlugin; virtual void _generate_emission_points(); @@ -61,14 +61,14 @@ protected: public: void edit(CPUParticles3D *p_particles); - CPUParticlesEditor(); + CPUParticles3DEditor(); }; -class CPUParticlesEditorPlugin : public EditorPlugin { +class CPUParticles3DEditorPlugin : public EditorPlugin { - GDCLASS(CPUParticlesEditorPlugin, EditorPlugin); + GDCLASS(CPUParticles3DEditorPlugin, EditorPlugin); - CPUParticlesEditor *particles_editor; + CPUParticles3DEditor *particles_editor; EditorNode *editor; public: @@ -78,8 +78,8 @@ public: virtual bool handles(Object *p_object) const; virtual void make_visible(bool p_visible); - CPUParticlesEditorPlugin(EditorNode *p_node); - ~CPUParticlesEditorPlugin(); + CPUParticles3DEditorPlugin(EditorNode *p_node); + ~CPUParticles3DEditorPlugin(); }; #endif // CPU_PARTICLES_EDITOR_PLUGIN_H diff --git a/editor/plugins/particles_2d_editor_plugin.cpp b/editor/plugins/gpu_particles_2d_editor_plugin.cpp index b018ef383e..89bff7ccab 100644 --- a/editor/plugins/particles_2d_editor_plugin.cpp +++ b/editor/plugins/gpu_particles_2d_editor_plugin.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* particles_2d_editor_plugin.cpp */ +/* gpu_particles_2d_editor_plugin.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "particles_2d_editor_plugin.h" +#include "gpu_particles_2d_editor_plugin.h" #include "canvas_item_editor_plugin.h" #include "core/io/image_loader.h" @@ -36,17 +36,17 @@ #include "scene/gui/separator.h" #include "scene/resources/particles_material.h" -void Particles2DEditorPlugin::edit(Object *p_object) { +void GPUParticles2DEditorPlugin::edit(Object *p_object) { - particles = Object::cast_to<Particles2D>(p_object); + particles = Object::cast_to<GPUParticles2D>(p_object); } -bool Particles2DEditorPlugin::handles(Object *p_object) const { +bool GPUParticles2DEditorPlugin::handles(Object *p_object) const { return p_object->is_class("GPUParticles2D"); } -void Particles2DEditorPlugin::make_visible(bool p_visible) { +void GPUParticles2DEditorPlugin::make_visible(bool p_visible) { if (p_visible) { @@ -57,13 +57,13 @@ void Particles2DEditorPlugin::make_visible(bool p_visible) { } } -void Particles2DEditorPlugin::_file_selected(const String &p_file) { +void GPUParticles2DEditorPlugin::_file_selected(const String &p_file) { source_emission_file = p_file; emission_mask->popup_centered(); } -void Particles2DEditorPlugin::_menu_callback(int p_idx) { +void GPUParticles2DEditorPlugin::_menu_callback(int p_idx) { switch (p_idx) { case MENU_GENERATE_VISIBILITY_RECT: { @@ -94,7 +94,7 @@ void Particles2DEditorPlugin::_menu_callback(int p_idx) { cpu_particles->set_z_index(particles->get_z_index()); UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); - ur->create_action(TTR("Convert to CPUParticles")); + ur->create_action(TTR("Convert to CPUParticles2D")); ur->add_do_method(EditorNode::get_singleton()->get_scene_tree_dock(), "replace_node", particles, cpu_particles, true, false); ur->add_do_reference(cpu_particles); ur->add_undo_method(EditorNode::get_singleton()->get_scene_tree_dock(), "replace_node", cpu_particles, particles, false, false); @@ -109,7 +109,7 @@ void Particles2DEditorPlugin::_menu_callback(int p_idx) { } } -void Particles2DEditorPlugin::_generate_visibility_rect() { +void GPUParticles2DEditorPlugin::_generate_visibility_rect() { float time = generate_seconds->get_value(); @@ -149,7 +149,7 @@ void Particles2DEditorPlugin::_generate_visibility_rect() { undo_redo->commit_action(); } -void Particles2DEditorPlugin::_generate_emission_mask() { +void GPUParticles2DEditorPlugin::_generate_emission_mask() { Ref<ParticlesMaterial> pm = particles->get_process_material(); if (!pm.is_valid()) { @@ -345,20 +345,20 @@ void Particles2DEditorPlugin::_generate_emission_mask() { } } -void Particles2DEditorPlugin::_notification(int p_what) { +void GPUParticles2DEditorPlugin::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { - menu->get_popup()->connect("id_pressed", callable_mp(this, &Particles2DEditorPlugin::_menu_callback)); - menu->set_icon(menu->get_theme_icon("Particles2D", "EditorIcons")); - file->connect("file_selected", callable_mp(this, &Particles2DEditorPlugin::_file_selected)); + menu->get_popup()->connect("id_pressed", callable_mp(this, &GPUParticles2DEditorPlugin::_menu_callback)); + menu->set_icon(menu->get_theme_icon("GPUParticles2D", "EditorIcons")); + file->connect("file_selected", callable_mp(this, &GPUParticles2DEditorPlugin::_file_selected)); } } -void Particles2DEditorPlugin::_bind_methods() { +void GPUParticles2DEditorPlugin::_bind_methods() { } -Particles2DEditorPlugin::Particles2DEditorPlugin(EditorNode *p_node) { +GPUParticles2DEditorPlugin::GPUParticles2DEditorPlugin(EditorNode *p_node) { particles = NULL; editor = p_node; @@ -376,10 +376,10 @@ Particles2DEditorPlugin::Particles2DEditorPlugin(EditorNode *p_node) { menu->get_popup()->add_item(TTR("Load Emission Mask"), MENU_LOAD_EMISSION_MASK); // menu->get_popup()->add_item(TTR("Clear Emission Mask"), MENU_CLEAR_EMISSION_MASK); menu->get_popup()->add_separator(); - menu->get_popup()->add_item(TTR("Convert to CPUParticles"), MENU_OPTION_CONVERT_TO_CPU_PARTICLES); + menu->get_popup()->add_item(TTR("Convert to CPUParticles2D"), MENU_OPTION_CONVERT_TO_CPU_PARTICLES); menu->get_popup()->add_separator(); menu->get_popup()->add_item(TTR("Restart"), MENU_RESTART); - menu->set_text(TTR("Particles")); + menu->set_text(TTR("GPUParticles2D")); menu->set_switch_on_hover(true); toolbar->add_child(menu); @@ -411,7 +411,7 @@ Particles2DEditorPlugin::Particles2DEditorPlugin(EditorNode *p_node) { toolbar->add_child(generate_visibility_rect); - generate_visibility_rect->connect("confirmed", callable_mp(this, &Particles2DEditorPlugin::_generate_visibility_rect)); + generate_visibility_rect->connect("confirmed", callable_mp(this, &GPUParticles2DEditorPlugin::_generate_visibility_rect)); emission_mask = memnew(ConfirmationDialog); emission_mask->set_title(TTR("Load Emission Mask")); @@ -428,8 +428,8 @@ Particles2DEditorPlugin::Particles2DEditorPlugin(EditorNode *p_node) { toolbar->add_child(emission_mask); - emission_mask->connect("confirmed", callable_mp(this, &Particles2DEditorPlugin::_generate_emission_mask)); + emission_mask->connect("confirmed", callable_mp(this, &GPUParticles2DEditorPlugin::_generate_emission_mask)); } -Particles2DEditorPlugin::~Particles2DEditorPlugin() { +GPUParticles2DEditorPlugin::~GPUParticles2DEditorPlugin() { } diff --git a/editor/plugins/particles_2d_editor_plugin.h b/editor/plugins/gpu_particles_2d_editor_plugin.h index 29652a1826..904786ffae 100644 --- a/editor/plugins/particles_2d_editor_plugin.h +++ b/editor/plugins/gpu_particles_2d_editor_plugin.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* particles_2d_editor_plugin.h */ +/* gpu_particles_2d_editor_plugin.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -34,13 +34,13 @@ #include "editor/editor_node.h" #include "editor/editor_plugin.h" #include "scene/2d/collision_polygon_2d.h" -#include "scene/2d/particles_2d.h" +#include "scene/2d/gpu_particles_2d.h" #include "scene/gui/box_container.h" #include "scene/gui/file_dialog.h" -class Particles2DEditorPlugin : public EditorPlugin { +class GPUParticles2DEditorPlugin : public EditorPlugin { - GDCLASS(Particles2DEditorPlugin, EditorPlugin); + GDCLASS(GPUParticles2DEditorPlugin, EditorPlugin); enum { @@ -57,7 +57,7 @@ class Particles2DEditorPlugin : public EditorPlugin { EMISSION_MODE_BORDER_DIRECTED }; - Particles2D *particles; + GPUParticles2D *particles; EditorFileDialog *file; EditorNode *editor; @@ -93,8 +93,8 @@ public: virtual bool handles(Object *p_object) const; virtual void make_visible(bool p_visible); - Particles2DEditorPlugin(EditorNode *p_node); - ~Particles2DEditorPlugin(); + GPUParticles2DEditorPlugin(EditorNode *p_node); + ~GPUParticles2DEditorPlugin(); }; #endif // PARTICLES_2D_EDITOR_PLUGIN_H diff --git a/editor/plugins/particles_editor_plugin.cpp b/editor/plugins/gpu_particles_3d_editor_plugin.cpp index 628eb4a7fe..655f03b7e0 100644 --- a/editor/plugins/particles_editor_plugin.cpp +++ b/editor/plugins/gpu_particles_3d_editor_plugin.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* particles_editor_plugin.cpp */ +/* gpu_particles_3d_editor_plugin.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,14 +28,14 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "particles_editor_plugin.h" +#include "gpu_particles_3d_editor_plugin.h" #include "core/io/resource_loader.h" -#include "editor/plugins/spatial_editor_plugin.h" +#include "editor/plugins/node_3d_editor_plugin.h" #include "scene/3d/cpu_particles_3d.h" #include "scene/resources/particles_material.h" -bool ParticlesEditorBase::_generate(Vector<Vector3> &points, Vector<Vector3> &normals) { +bool GPUParticles3DEditorBase::_generate(Vector<Vector3> &points, Vector<Vector3> &normals) { bool use_normals = emission_fill->get_selected() == 1; @@ -161,7 +161,7 @@ bool ParticlesEditorBase::_generate(Vector<Vector3> &points, Vector<Vector3> &no return true; } -void ParticlesEditorBase::_node_selected(const NodePath &p_path) { +void GPUParticles3DEditorBase::_node_selected(const NodePath &p_path) { Node *sel = get_node(p_path); if (!sel) @@ -202,10 +202,10 @@ void ParticlesEditorBase::_node_selected(const NodePath &p_path) { emission_dialog->popup_centered(Size2(300, 130)); } -void ParticlesEditorBase::_bind_methods() { +void GPUParticles3DEditorBase::_bind_methods() { } -ParticlesEditorBase::ParticlesEditorBase() { +GPUParticles3DEditorBase::GPUParticles3DEditorBase() { emission_dialog = memnew(ConfirmationDialog); emission_dialog->set_title(TTR("Create Emitter")); @@ -226,14 +226,14 @@ ParticlesEditorBase::ParticlesEditorBase() { emd_vb->add_margin_child(TTR("Emission Source: "), emission_fill); emission_dialog->get_ok()->set_text(TTR("Create")); - emission_dialog->connect("confirmed", callable_mp(this, &ParticlesEditorBase::_generate_emission_points)); + emission_dialog->connect("confirmed", callable_mp(this, &GPUParticles3DEditorBase::_generate_emission_points)); emission_tree_dialog = memnew(SceneTreeDialog); add_child(emission_tree_dialog); - emission_tree_dialog->connect("selected", callable_mp(this, &ParticlesEditorBase::_node_selected)); + emission_tree_dialog->connect("selected", callable_mp(this, &GPUParticles3DEditorBase::_node_selected)); } -void ParticlesEditor::_node_removed(Node *p_node) { +void GPUParticles3DEditor::_node_removed(Node *p_node) { if (p_node == node) { node = NULL; @@ -241,15 +241,15 @@ void ParticlesEditor::_node_removed(Node *p_node) { } } -void ParticlesEditor::_notification(int p_notification) { +void GPUParticles3DEditor::_notification(int p_notification) { if (p_notification == NOTIFICATION_ENTER_TREE) { - options->set_icon(options->get_popup()->get_theme_icon("Particles", "EditorIcons")); - get_tree()->connect("node_removed", callable_mp(this, &ParticlesEditor::_node_removed)); + options->set_icon(options->get_popup()->get_theme_icon("GPUParticles3D", "EditorIcons")); + get_tree()->connect("node_removed", callable_mp(this, &GPUParticles3DEditor::_node_removed)); } } -void ParticlesEditor::_menu_option(int p_option) { +void GPUParticles3DEditor::_menu_option(int p_option) { switch (p_option) { @@ -282,7 +282,7 @@ void ParticlesEditor::_menu_option(int p_option) { cpu_particles->set_pause_mode(node->get_pause_mode()); UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); - ur->create_action(TTR("Convert to CPUParticles")); + ur->create_action(TTR("Convert to CPUParticles3D")); ur->add_do_method(EditorNode::get_singleton()->get_scene_tree_dock(), "replace_node", node, cpu_particles, true, false); ur->add_do_reference(cpu_particles); ur->add_undo_method(EditorNode::get_singleton()->get_scene_tree_dock(), "replace_node", cpu_particles, node, false, false); @@ -298,7 +298,7 @@ void ParticlesEditor::_menu_option(int p_option) { } } -void ParticlesEditor::_generate_aabb() { +void GPUParticles3DEditor::_generate_aabb() { float time = generate_seconds->get_value(); @@ -340,13 +340,13 @@ void ParticlesEditor::_generate_aabb() { ur->commit_action(); } -void ParticlesEditor::edit(GPUParticles3D *p_particles) { +void GPUParticles3DEditor::edit(GPUParticles3D *p_particles) { base_node = p_particles; node = p_particles; } -void ParticlesEditor::_generate_emission_points() { +void GPUParticles3DEditor::_generate_emission_points() { /// hacer codigo aca Vector<Vector3> points; @@ -419,10 +419,10 @@ void ParticlesEditor::_generate_emission_points() { } } -void ParticlesEditor::_bind_methods() { +void GPUParticles3DEditor::_bind_methods() { } -ParticlesEditor::ParticlesEditor() { +GPUParticles3DEditor::GPUParticles3DEditor() { node = NULL; particles_editor_hb = memnew(HBoxContainer); @@ -432,16 +432,16 @@ ParticlesEditor::ParticlesEditor() { particles_editor_hb->add_child(options); particles_editor_hb->hide(); - options->set_text(TTR("Particles")); + options->set_text(TTR("GPUParticles3D")); options->get_popup()->add_item(TTR("Generate AABB"), MENU_OPTION_GENERATE_AABB); options->get_popup()->add_separator(); options->get_popup()->add_item(TTR("Create Emission Points From Node"), MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_NODE); options->get_popup()->add_separator(); - options->get_popup()->add_item(TTR("Convert to CPUParticles"), MENU_OPTION_CONVERT_TO_CPU_PARTICLES); + options->get_popup()->add_item(TTR("Convert to CPUParticles3D"), MENU_OPTION_CONVERT_TO_CPU_PARTICLES); options->get_popup()->add_separator(); options->get_popup()->add_item(TTR("Restart"), MENU_OPTION_RESTART); - options->get_popup()->connect("id_pressed", callable_mp(this, &ParticlesEditor::_menu_option)); + options->get_popup()->connect("id_pressed", callable_mp(this, &GPUParticles3DEditor::_menu_option)); generate_aabb = memnew(ConfirmationDialog); generate_aabb->set_title(TTR("Generate Visibility AABB")); @@ -455,20 +455,20 @@ ParticlesEditor::ParticlesEditor() { add_child(generate_aabb); - generate_aabb->connect("confirmed", callable_mp(this, &ParticlesEditor::_generate_aabb)); + generate_aabb->connect("confirmed", callable_mp(this, &GPUParticles3DEditor::_generate_aabb)); } -void ParticlesEditorPlugin::edit(Object *p_object) { +void GPUParticles3DEditorPlugin::edit(Object *p_object) { particles_editor->edit(Object::cast_to<GPUParticles3D>(p_object)); } -bool ParticlesEditorPlugin::handles(Object *p_object) const { +bool GPUParticles3DEditorPlugin::handles(Object *p_object) const { return p_object->is_class("GPUParticles3D"); } -void ParticlesEditorPlugin::make_visible(bool p_visible) { +void GPUParticles3DEditorPlugin::make_visible(bool p_visible) { if (p_visible) { particles_editor->show(); @@ -480,14 +480,14 @@ void ParticlesEditorPlugin::make_visible(bool p_visible) { } } -ParticlesEditorPlugin::ParticlesEditorPlugin(EditorNode *p_node) { +GPUParticles3DEditorPlugin::GPUParticles3DEditorPlugin(EditorNode *p_node) { editor = p_node; - particles_editor = memnew(ParticlesEditor); + particles_editor = memnew(GPUParticles3DEditor); editor->get_viewport()->add_child(particles_editor); particles_editor->hide(); } -ParticlesEditorPlugin::~ParticlesEditorPlugin() { +GPUParticles3DEditorPlugin::~GPUParticles3DEditorPlugin() { } diff --git a/editor/plugins/particles_editor_plugin.h b/editor/plugins/gpu_particles_3d_editor_plugin.h index 773f305a2b..d730457d01 100644 --- a/editor/plugins/particles_editor_plugin.h +++ b/editor/plugins/gpu_particles_3d_editor_plugin.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* particles_editor_plugin.h */ +/* gpu_particles_3d_editor_plugin.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -36,9 +36,9 @@ #include "scene/3d/gpu_particles_3d.h" #include "scene/gui/spin_box.h" -class ParticlesEditorBase : public Control { +class GPUParticles3DEditorBase : public Control { - GDCLASS(ParticlesEditorBase, Control); + GDCLASS(GPUParticles3DEditorBase, Control); protected: Node3D *base_node; @@ -61,12 +61,12 @@ protected: static void _bind_methods(); public: - ParticlesEditorBase(); + GPUParticles3DEditorBase(); }; -class ParticlesEditor : public ParticlesEditorBase { +class GPUParticles3DEditor : public GPUParticles3DEditorBase { - GDCLASS(ParticlesEditor, ParticlesEditorBase); + GDCLASS(GPUParticles3DEditor, GPUParticles3DEditorBase); ConfirmationDialog *generate_aabb; SpinBox *generate_seconds; @@ -86,7 +86,7 @@ class ParticlesEditor : public ParticlesEditorBase { void _menu_option(int); - friend class ParticlesEditorPlugin; + friend class GPUParticles3DEditorPlugin; virtual void _generate_emission_points(); @@ -97,14 +97,14 @@ protected: public: void edit(GPUParticles3D *p_particles); - ParticlesEditor(); + GPUParticles3DEditor(); }; -class ParticlesEditorPlugin : public EditorPlugin { +class GPUParticles3DEditorPlugin : public EditorPlugin { - GDCLASS(ParticlesEditorPlugin, EditorPlugin); + GDCLASS(GPUParticles3DEditorPlugin, EditorPlugin); - ParticlesEditor *particles_editor; + GPUParticles3DEditor *particles_editor; EditorNode *editor; public: @@ -114,8 +114,8 @@ public: virtual bool handles(Object *p_object) const; virtual void make_visible(bool p_visible); - ParticlesEditorPlugin(EditorNode *p_node); - ~ParticlesEditorPlugin(); + GPUParticles3DEditorPlugin(EditorNode *p_node); + ~GPUParticles3DEditorPlugin(); }; #endif // PARTICLES_EDITOR_PLUGIN_H diff --git a/editor/plugins/gradient_editor_plugin.cpp b/editor/plugins/gradient_editor_plugin.cpp index ff03fcf159..54b7840124 100644 --- a/editor/plugins/gradient_editor_plugin.cpp +++ b/editor/plugins/gradient_editor_plugin.cpp @@ -32,7 +32,7 @@ #include "canvas_item_editor_plugin.h" #include "editor/editor_scale.h" -#include "spatial_editor_plugin.h" +#include "node_3d_editor_plugin.h" Size2 GradientEditor::get_minimum_size() const { return Size2(0, 60) * EDSCALE; diff --git a/editor/plugins/material_editor_plugin.cpp b/editor/plugins/material_editor_plugin.cpp index 9fe9675c69..8129b9bd86 100644 --- a/editor/plugins/material_editor_plugin.cpp +++ b/editor/plugins/material_editor_plugin.cpp @@ -115,7 +115,7 @@ MaterialEditor::MaterialEditor() { add_child(vc); vc->set_anchors_and_margins_preset(PRESET_WIDE); viewport = memnew(SubViewport); - Ref<World> world; + Ref<World3D> world; world.instance(); viewport->set_world(world); //use own world vc->add_child(viewport); diff --git a/editor/plugins/mesh_editor_plugin.cpp b/editor/plugins/mesh_editor_plugin.cpp index d7dd777cd3..a8b455fdd2 100644 --- a/editor/plugins/mesh_editor_plugin.cpp +++ b/editor/plugins/mesh_editor_plugin.cpp @@ -116,7 +116,7 @@ void MeshEditor::_bind_methods() { MeshEditor::MeshEditor() { viewport = memnew(SubViewport); - Ref<World> world; + Ref<World3D> world; world.instance(); viewport->set_world(world); //use own world add_child(viewport); diff --git a/editor/plugins/mesh_instance_editor_plugin.cpp b/editor/plugins/mesh_instance_3d_editor_plugin.cpp index dce69e53ca..a4e7b2df08 100644 --- a/editor/plugins/mesh_instance_editor_plugin.cpp +++ b/editor/plugins/mesh_instance_3d_editor_plugin.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* mesh_instance_editor_plugin.cpp */ +/* mesh_instance_3d_editor_plugin.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,16 +28,16 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "mesh_instance_editor_plugin.h" +#include "mesh_instance_3d_editor_plugin.h" #include "editor/editor_scale.h" +#include "node_3d_editor_plugin.h" #include "scene/3d/collision_shape_3d.h" #include "scene/3d/navigation_region_3d.h" #include "scene/3d/physics_body_3d.h" #include "scene/gui/box_container.h" -#include "spatial_editor_plugin.h" -void MeshInstanceEditor::_node_removed(Node *p_node) { +void MeshInstance3DEditor::_node_removed(Node *p_node) { if (p_node == node) { node = NULL; @@ -45,12 +45,12 @@ void MeshInstanceEditor::_node_removed(Node *p_node) { } } -void MeshInstanceEditor::edit(MeshInstance3D *p_mesh) { +void MeshInstance3DEditor::edit(MeshInstance3D *p_mesh) { node = p_mesh; } -void MeshInstanceEditor::_menu_option(int p_option) { +void MeshInstance3DEditor::_menu_option(int p_option) { Ref<Mesh> mesh = node->get_mesh(); if (mesh.is_null()) { @@ -291,20 +291,20 @@ void MeshInstanceEditor::_menu_option(int p_option) { } } -struct MeshInstanceEditorEdgeSort { +struct MeshInstance3DEditorEdgeSort { Vector2 a; Vector2 b; - bool operator<(const MeshInstanceEditorEdgeSort &p_b) const { + bool operator<(const MeshInstance3DEditorEdgeSort &p_b) const { if (a == p_b.a) return b < p_b.b; else return a < p_b.a; } - MeshInstanceEditorEdgeSort() {} - MeshInstanceEditorEdgeSort(const Vector2 &p_a, const Vector2 &p_b) { + MeshInstance3DEditorEdgeSort() {} + MeshInstance3DEditorEdgeSort(const Vector2 &p_a, const Vector2 &p_b) { if (p_a < p_b) { a = p_a; b = p_b; @@ -315,12 +315,12 @@ struct MeshInstanceEditorEdgeSort { } }; -void MeshInstanceEditor::_create_uv_lines(int p_layer) { +void MeshInstance3DEditor::_create_uv_lines(int p_layer) { Ref<Mesh> mesh = node->get_mesh(); ERR_FAIL_COND(!mesh.is_valid()); - Set<MeshInstanceEditorEdgeSort> edges; + Set<MeshInstance3DEditorEdgeSort> edges; uv_lines.clear(); for (int i = 0; i < mesh->get_surface_count(); i++) { if (mesh->surface_get_primitive_type(i) != Mesh::PRIMITIVE_TRIANGLES) @@ -355,7 +355,7 @@ void MeshInstanceEditor::_create_uv_lines(int p_layer) { for (int k = 0; k < 3; k++) { - MeshInstanceEditorEdgeSort edge; + MeshInstance3DEditorEdgeSort edge; if (use_indices) { edge.a = r[ri[j + k]]; edge.b = r[ri[j + ((k + 1) % 3)]]; @@ -377,7 +377,7 @@ void MeshInstanceEditor::_create_uv_lines(int p_layer) { debug_uv_dialog->popup_centered(); } -void MeshInstanceEditor::_debug_uv_draw() { +void MeshInstance3DEditor::_debug_uv_draw() { if (uv_lines.size() == 0) return; @@ -388,7 +388,7 @@ void MeshInstanceEditor::_debug_uv_draw() { debug_uv->draw_multiline(uv_lines, Color(1.0, 0.8, 0.7)); } -void MeshInstanceEditor::_create_outline_mesh() { +void MeshInstance3DEditor::_create_outline_mesh() { Ref<Mesh> mesh = node->get_mesh(); if (mesh.is_null()) { @@ -434,10 +434,10 @@ void MeshInstanceEditor::_create_outline_mesh() { ur->commit_action(); } -void MeshInstanceEditor::_bind_methods() { +void MeshInstance3DEditor::_bind_methods() { } -MeshInstanceEditor::MeshInstanceEditor() { +MeshInstance3DEditor::MeshInstance3DEditor() { options = memnew(MenuButton); options->set_switch_on_hover(true); @@ -465,7 +465,7 @@ MeshInstanceEditor::MeshInstanceEditor() { options->get_popup()->add_item(TTR("View UV2"), MENU_OPTION_DEBUG_UV2); options->get_popup()->add_item(TTR("Unwrap UV2 for Lightmap/AO"), MENU_OPTION_CREATE_UV2); - options->get_popup()->connect("id_pressed", callable_mp(this, &MeshInstanceEditor::_menu_option)); + options->get_popup()->connect("id_pressed", callable_mp(this, &MeshInstance3DEditor::_menu_option)); outline_dialog = memnew(ConfirmationDialog); outline_dialog->set_title(TTR("Create Outline Mesh")); @@ -483,7 +483,7 @@ MeshInstanceEditor::MeshInstanceEditor() { outline_dialog_vbc->add_margin_child(TTR("Outline Size:"), outline_size); add_child(outline_dialog); - outline_dialog->connect("confirmed", callable_mp(this, &MeshInstanceEditor::_create_outline_mesh)); + outline_dialog->connect("confirmed", callable_mp(this, &MeshInstance3DEditor::_create_outline_mesh)); err_dialog = memnew(AcceptDialog); add_child(err_dialog); @@ -493,21 +493,21 @@ MeshInstanceEditor::MeshInstanceEditor() { add_child(debug_uv_dialog); debug_uv = memnew(Control); debug_uv->set_custom_minimum_size(Size2(600, 600) * EDSCALE); - debug_uv->connect("draw", callable_mp(this, &MeshInstanceEditor::_debug_uv_draw)); + debug_uv->connect("draw", callable_mp(this, &MeshInstance3DEditor::_debug_uv_draw)); debug_uv_dialog->add_child(debug_uv); } -void MeshInstanceEditorPlugin::edit(Object *p_object) { +void MeshInstance3DEditorPlugin::edit(Object *p_object) { mesh_editor->edit(Object::cast_to<MeshInstance3D>(p_object)); } -bool MeshInstanceEditorPlugin::handles(Object *p_object) const { +bool MeshInstance3DEditorPlugin::handles(Object *p_object) const { return p_object->is_class("MeshInstance3D"); } -void MeshInstanceEditorPlugin::make_visible(bool p_visible) { +void MeshInstance3DEditorPlugin::make_visible(bool p_visible) { if (p_visible) { mesh_editor->options->show(); @@ -518,14 +518,14 @@ void MeshInstanceEditorPlugin::make_visible(bool p_visible) { } } -MeshInstanceEditorPlugin::MeshInstanceEditorPlugin(EditorNode *p_node) { +MeshInstance3DEditorPlugin::MeshInstance3DEditorPlugin(EditorNode *p_node) { editor = p_node; - mesh_editor = memnew(MeshInstanceEditor); + mesh_editor = memnew(MeshInstance3DEditor); editor->get_viewport()->add_child(mesh_editor); mesh_editor->options->hide(); } -MeshInstanceEditorPlugin::~MeshInstanceEditorPlugin() { +MeshInstance3DEditorPlugin::~MeshInstance3DEditorPlugin() { } diff --git a/editor/plugins/mesh_instance_editor_plugin.h b/editor/plugins/mesh_instance_3d_editor_plugin.h index 68354388ba..a5d90c42d5 100644 --- a/editor/plugins/mesh_instance_editor_plugin.h +++ b/editor/plugins/mesh_instance_3d_editor_plugin.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* mesh_instance_editor_plugin.h */ +/* mesh_instance_3d_editor_plugin.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -36,9 +36,9 @@ #include "scene/3d/mesh_instance_3d.h" #include "scene/gui/spin_box.h" -class MeshInstanceEditor : public Control { +class MeshInstance3DEditor : public Control { - GDCLASS(MeshInstanceEditor, Control); + GDCLASS(MeshInstance3DEditor, Control); enum Menu { @@ -70,7 +70,7 @@ class MeshInstanceEditor : public Control { void _create_outline_mesh(); void _create_uv_lines(int p_layer); - friend class MeshInstanceEditorPlugin; + friend class MeshInstance3DEditorPlugin; void _debug_uv_draw(); @@ -80,14 +80,14 @@ protected: public: void edit(MeshInstance3D *p_mesh); - MeshInstanceEditor(); + MeshInstance3DEditor(); }; -class MeshInstanceEditorPlugin : public EditorPlugin { +class MeshInstance3DEditorPlugin : public EditorPlugin { - GDCLASS(MeshInstanceEditorPlugin, EditorPlugin); + GDCLASS(MeshInstance3DEditorPlugin, EditorPlugin); - MeshInstanceEditor *mesh_editor; + MeshInstance3DEditor *mesh_editor; EditorNode *editor; public: @@ -97,8 +97,8 @@ public: virtual bool handles(Object *p_object) const; virtual void make_visible(bool p_visible); - MeshInstanceEditorPlugin(EditorNode *p_node); - ~MeshInstanceEditorPlugin(); + MeshInstance3DEditorPlugin(EditorNode *p_node); + ~MeshInstance3DEditorPlugin(); }; #endif // MESH_EDITOR_PLUGIN_H diff --git a/editor/plugins/mesh_library_editor_plugin.cpp b/editor/plugins/mesh_library_editor_plugin.cpp index 88a6254c5c..a3e3d88ae2 100644 --- a/editor/plugins/mesh_library_editor_plugin.cpp +++ b/editor/plugins/mesh_library_editor_plugin.cpp @@ -33,12 +33,12 @@ #include "editor/editor_node.h" #include "editor/editor_settings.h" #include "main/main.h" +#include "node_3d_editor_plugin.h" #include "scene/3d/mesh_instance_3d.h" #include "scene/3d/navigation_region_3d.h" #include "scene/3d/physics_body_3d.h" #include "scene/main/window.h" #include "scene/resources/packed_scene.h" -#include "spatial_editor_plugin.h" void MeshLibraryEditor::edit(const Ref<MeshLibrary> &p_mesh_library) { diff --git a/editor/plugins/multimesh_editor_plugin.cpp b/editor/plugins/multimesh_editor_plugin.cpp index dd2781aea7..658e3ea565 100644 --- a/editor/plugins/multimesh_editor_plugin.cpp +++ b/editor/plugins/multimesh_editor_plugin.cpp @@ -30,9 +30,9 @@ #include "multimesh_editor_plugin.h" +#include "node_3d_editor_plugin.h" #include "scene/3d/mesh_instance_3d.h" #include "scene/gui/box_container.h" -#include "spatial_editor_plugin.h" void MultiMeshEditor::_node_removed(Node *p_node) { @@ -287,7 +287,7 @@ MultiMeshEditor::MultiMeshEditor() { Node3DEditor::get_singleton()->add_control_to_menu_panel(options); options->set_text("MultiMesh"); - options->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("MultiMeshInstance", "EditorIcons")); + options->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("MultiMeshInstance3D", "EditorIcons")); options->get_popup()->add_item(TTR("Populate Surface")); options->get_popup()->connect("id_pressed", callable_mp(this, &MultiMeshEditor::_menu_option)); diff --git a/editor/plugins/navigation_polygon_editor_plugin.h b/editor/plugins/navigation_polygon_editor_plugin.h index 10f8cbc0a5..0bc35e2498 100644 --- a/editor/plugins/navigation_polygon_editor_plugin.h +++ b/editor/plugins/navigation_polygon_editor_plugin.h @@ -32,7 +32,7 @@ #define NAVIGATIONPOLYGONEDITORPLUGIN_H #include "editor/plugins/abstract_polygon_2d_editor.h" -#include "scene/2d/navigation_polygon.h" +#include "scene/2d/navigation_region_2d.h" class NavigationPolygonEditor : public AbstractPolygon2DEditor { diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index 318f3d6b09..07eaf3f63f 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* spatial_editor_plugin.cpp */ +/* node_3d_editor_plugin.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "spatial_editor_plugin.h" +#include "node_3d_editor_plugin.h" #include "core/input/input_filter.h" #include "core/math/camera_matrix.h" @@ -40,9 +40,9 @@ #include "editor/editor_node.h" #include "editor/editor_scale.h" #include "editor/editor_settings.h" +#include "editor/node_3d_editor_gizmos.h" #include "editor/plugins/animation_player_editor_plugin.h" #include "editor/plugins/script_editor_plugin.h" -#include "editor/spatial_editor_gizmos.h" #include "scene/3d/camera_3d.h" #include "scene/3d/collision_shape_3d.h" #include "scene/3d/mesh_instance_3d.h" diff --git a/editor/plugins/spatial_editor_plugin.h b/editor/plugins/node_3d_editor_plugin.h index 819178408b..af6bc43b80 100644 --- a/editor/plugins/spatial_editor_plugin.h +++ b/editor/plugins/node_3d_editor_plugin.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* spatial_editor_plugin.h */ +/* node_3d_editor_plugin.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/editor/plugins/path_editor_plugin.cpp b/editor/plugins/path_3d_editor_plugin.cpp index e54fd17a5b..f3729a3e89 100644 --- a/editor/plugins/path_editor_plugin.cpp +++ b/editor/plugins/path_3d_editor_plugin.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* path_editor_plugin.cpp */ +/* path_3d_editor_plugin.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,11 +28,11 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "path_editor_plugin.h" +#include "path_3d_editor_plugin.h" #include "core/os/keyboard.h" +#include "node_3d_editor_plugin.h" #include "scene/resources/curve.h" -#include "spatial_editor_plugin.h" String PathNode3DGizmo::get_handle_name(int p_idx) const { @@ -130,10 +130,10 @@ void PathNode3DGizmo::set_handle(int p_idx, Camera3D *p_camera, const Point2 &p_ // Setting curve in/out positions if (p.intersects_ray(ray_from, ray_dir, &inters)) { - if (!PathEditorPlugin::singleton->is_handle_clicked()) { + if (!Path3DEditorPlugin::singleton->is_handle_clicked()) { orig_in_length = c->get_point_in(idx).length(); orig_out_length = c->get_point_out(idx).length(); - PathEditorPlugin::singleton->set_handle_clicked(true); + Path3DEditorPlugin::singleton->set_handle_clicked(true); } Vector3 local = gi.xform(inters) - base; @@ -144,12 +144,12 @@ void PathNode3DGizmo::set_handle(int p_idx, Camera3D *p_camera, const Point2 &p_ if (t == 0) { c->set_point_in(idx, local); - if (PathEditorPlugin::singleton->mirror_angle_enabled()) - c->set_point_out(idx, PathEditorPlugin::singleton->mirror_length_enabled() ? -local : (-local.normalized() * orig_out_length)); + if (Path3DEditorPlugin::singleton->mirror_angle_enabled()) + c->set_point_out(idx, Path3DEditorPlugin::singleton->mirror_length_enabled() ? -local : (-local.normalized() * orig_out_length)); } else { c->set_point_out(idx, local); - if (PathEditorPlugin::singleton->mirror_angle_enabled()) - c->set_point_in(idx, PathEditorPlugin::singleton->mirror_length_enabled() ? -local : (-local.normalized() * orig_in_length)); + if (Path3DEditorPlugin::singleton->mirror_angle_enabled()) + c->set_point_in(idx, Path3DEditorPlugin::singleton->mirror_length_enabled() ? -local : (-local.normalized() * orig_in_length)); } } } @@ -192,9 +192,9 @@ void PathNode3DGizmo::commit_handle(int p_idx, const Variant &p_restore, bool p_ ur->add_do_method(c.ptr(), "set_point_in", idx, c->get_point_in(idx)); ur->add_undo_method(c.ptr(), "set_point_in", idx, p_restore); - if (PathEditorPlugin::singleton->mirror_angle_enabled()) { - ur->add_do_method(c.ptr(), "set_point_out", idx, PathEditorPlugin::singleton->mirror_length_enabled() ? -c->get_point_in(idx) : (-c->get_point_in(idx).normalized() * orig_out_length)); - ur->add_undo_method(c.ptr(), "set_point_out", idx, PathEditorPlugin::singleton->mirror_length_enabled() ? -static_cast<Vector3>(p_restore) : (-static_cast<Vector3>(p_restore).normalized() * orig_out_length)); + if (Path3DEditorPlugin::singleton->mirror_angle_enabled()) { + ur->add_do_method(c.ptr(), "set_point_out", idx, Path3DEditorPlugin::singleton->mirror_length_enabled() ? -c->get_point_in(idx) : (-c->get_point_in(idx).normalized() * orig_out_length)); + ur->add_undo_method(c.ptr(), "set_point_out", idx, Path3DEditorPlugin::singleton->mirror_length_enabled() ? -static_cast<Vector3>(p_restore) : (-static_cast<Vector3>(p_restore).normalized() * orig_out_length)); } ur->commit_action(); @@ -209,9 +209,9 @@ void PathNode3DGizmo::commit_handle(int p_idx, const Variant &p_restore, bool p_ ur->add_do_method(c.ptr(), "set_point_out", idx, c->get_point_out(idx)); ur->add_undo_method(c.ptr(), "set_point_out", idx, p_restore); - if (PathEditorPlugin::singleton->mirror_angle_enabled()) { - ur->add_do_method(c.ptr(), "set_point_in", idx, PathEditorPlugin::singleton->mirror_length_enabled() ? -c->get_point_out(idx) : (-c->get_point_out(idx).normalized() * orig_in_length)); - ur->add_undo_method(c.ptr(), "set_point_in", idx, PathEditorPlugin::singleton->mirror_length_enabled() ? -static_cast<Vector3>(p_restore) : (-static_cast<Vector3>(p_restore).normalized() * orig_in_length)); + if (Path3DEditorPlugin::singleton->mirror_angle_enabled()) { + ur->add_do_method(c.ptr(), "set_point_in", idx, Path3DEditorPlugin::singleton->mirror_length_enabled() ? -c->get_point_out(idx) : (-c->get_point_out(idx).normalized() * orig_in_length)); + ur->add_undo_method(c.ptr(), "set_point_in", idx, Path3DEditorPlugin::singleton->mirror_length_enabled() ? -static_cast<Vector3>(p_restore) : (-static_cast<Vector3>(p_restore).normalized() * orig_in_length)); } ur->commit_action(); } @@ -252,7 +252,7 @@ void PathNode3DGizmo::redraw() { add_collision_segments(v3p); } - if (PathEditorPlugin::singleton->get_edited_path() == path) { + if (Path3DEditorPlugin::singleton->get_edited_path() == path) { v3p.clear(); Vector<Vector3> handles; Vector<Vector3> sec_handles; @@ -292,7 +292,7 @@ PathNode3DGizmo::PathNode3DGizmo(Path3D *p_path) { set_spatial_node(p_path); } -bool PathEditorPlugin::forward_spatial_gui_input(Camera3D *p_camera, const Ref<InputEvent> &p_event) { +bool Path3DEditorPlugin::forward_spatial_gui_input(Camera3D *p_camera, const Ref<InputEvent> &p_event) { if (!path) return false; @@ -448,7 +448,7 @@ bool PathEditorPlugin::forward_spatial_gui_input(Camera3D *p_camera, const Ref<I return false; } -void PathEditorPlugin::edit(Object *p_object) { +void Path3DEditorPlugin::edit(Object *p_object) { if (p_object) { path = Object::cast_to<Path3D>(p_object); @@ -468,12 +468,12 @@ void PathEditorPlugin::edit(Object *p_object) { //collision_polygon_editor->edit(Object::cast_to<Node>(p_object)); } -bool PathEditorPlugin::handles(Object *p_object) const { +bool Path3DEditorPlugin::handles(Object *p_object) const { return p_object->is_class("Path3D"); } -void PathEditorPlugin::make_visible(bool p_visible) { +void Path3DEditorPlugin::make_visible(bool p_visible) { if (p_visible) { @@ -502,14 +502,14 @@ void PathEditorPlugin::make_visible(bool p_visible) { } } -void PathEditorPlugin::_mode_changed(int p_idx) { +void Path3DEditorPlugin::_mode_changed(int p_idx) { curve_create->set_pressed(p_idx == 0); curve_edit->set_pressed(p_idx == 1); curve_del->set_pressed(p_idx == 2); } -void PathEditorPlugin::_close_curve() { +void Path3DEditorPlugin::_close_curve() { Ref<Curve3D> c = path->get_curve(); if (c.is_null()) @@ -519,7 +519,7 @@ void PathEditorPlugin::_close_curve() { c->add_point(c->get_point_position(0), c->get_point_in(0), c->get_point_out(0)); } -void PathEditorPlugin::_handle_option_pressed(int p_option) { +void Path3DEditorPlugin::_handle_option_pressed(int p_option) { PopupMenu *pm; pm = handle_menu->get_popup(); @@ -539,23 +539,23 @@ void PathEditorPlugin::_handle_option_pressed(int p_option) { } } -void PathEditorPlugin::_notification(int p_what) { +void Path3DEditorPlugin::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { - curve_create->connect("pressed", callable_mp(this, &PathEditorPlugin::_mode_changed), make_binds(0)); - curve_edit->connect("pressed", callable_mp(this, &PathEditorPlugin::_mode_changed), make_binds(1)); - curve_del->connect("pressed", callable_mp(this, &PathEditorPlugin::_mode_changed), make_binds(2)); - curve_close->connect("pressed", callable_mp(this, &PathEditorPlugin::_close_curve)); + curve_create->connect("pressed", callable_mp(this, &Path3DEditorPlugin::_mode_changed), make_binds(0)); + curve_edit->connect("pressed", callable_mp(this, &Path3DEditorPlugin::_mode_changed), make_binds(1)); + curve_del->connect("pressed", callable_mp(this, &Path3DEditorPlugin::_mode_changed), make_binds(2)); + curve_close->connect("pressed", callable_mp(this, &Path3DEditorPlugin::_close_curve)); } } -void PathEditorPlugin::_bind_methods() { +void Path3DEditorPlugin::_bind_methods() { } -PathEditorPlugin *PathEditorPlugin::singleton = NULL; +Path3DEditorPlugin *Path3DEditorPlugin::singleton = NULL; -PathEditorPlugin::PathEditorPlugin(EditorNode *p_node) { +Path3DEditorPlugin::Path3DEditorPlugin(EditorNode *p_node) { path = NULL; editor = p_node; @@ -610,7 +610,7 @@ PathEditorPlugin::PathEditorPlugin(EditorNode *p_node) { menu->set_item_checked(HANDLE_OPTION_ANGLE, mirror_handle_angle); menu->add_check_item(TTR("Mirror Handle Lengths")); menu->set_item_checked(HANDLE_OPTION_LENGTH, mirror_handle_length); - menu->connect("id_pressed", callable_mp(this, &PathEditorPlugin::_handle_option_pressed)); + menu->connect("id_pressed", callable_mp(this, &Path3DEditorPlugin::_handle_option_pressed)); curve_edit->set_pressed(true); /* @@ -624,7 +624,7 @@ PathEditorPlugin::PathEditorPlugin(EditorNode *p_node) { */ } -PathEditorPlugin::~PathEditorPlugin() { +Path3DEditorPlugin::~Path3DEditorPlugin() { } Ref<EditorNode3DGizmo> PathNode3DGizmoPlugin::create_gizmo(Node3D *p_spatial) { diff --git a/editor/plugins/path_editor_plugin.h b/editor/plugins/path_3d_editor_plugin.h index 0a27e1068e..ca051295f0 100644 --- a/editor/plugins/path_editor_plugin.h +++ b/editor/plugins/path_3d_editor_plugin.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* path_editor_plugin.h */ +/* path_3d_editor_plugin.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -31,7 +31,7 @@ #ifndef PATH_EDITOR_PLUGIN_H #define PATH_EDITOR_PLUGIN_H -#include "editor/spatial_editor_gizmos.h" +#include "editor/node_3d_editor_gizmos.h" #include "scene/3d/path_3d.h" class PathNode3DGizmo : public EditorNode3DGizmo { @@ -66,9 +66,9 @@ public: PathNode3DGizmoPlugin(); }; -class PathEditorPlugin : public EditorPlugin { +class Path3DEditorPlugin : public EditorPlugin { - GDCLASS(PathEditorPlugin, EditorPlugin); + GDCLASS(Path3DEditorPlugin, EditorPlugin); Separator *sep; ToolButton *curve_create; @@ -100,7 +100,7 @@ protected: public: Path3D *get_edited_path() { return path; } - static PathEditorPlugin *singleton; + static Path3DEditorPlugin *singleton; virtual bool forward_spatial_gui_input(Camera3D *p_camera, const Ref<InputEvent> &p_event); //virtual bool forward_gui_input(const InputEvent& p_event) { return collision_polygon_editor->forward_gui_input(p_event); } @@ -116,8 +116,8 @@ public: bool is_handle_clicked() { return handle_clicked; } void set_handle_clicked(bool clicked) { handle_clicked = clicked; } - PathEditorPlugin(EditorNode *p_node); - ~PathEditorPlugin(); + Path3DEditorPlugin(EditorNode *p_node); + ~Path3DEditorPlugin(); }; #endif // PATH_EDITOR_PLUGIN_H diff --git a/editor/plugins/physical_bone_plugin.cpp b/editor/plugins/physical_bone_3d_editor_plugin.cpp index d827472353..dd6d7b109b 100644 --- a/editor/plugins/physical_bone_plugin.cpp +++ b/editor/plugins/physical_bone_3d_editor_plugin.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* physical_bone_plugin.cpp */ +/* physical_bone_3d_editor_plugin.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,25 +28,26 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "physical_bone_plugin.h" -#include "editor/plugins/spatial_editor_plugin.h" +#include "physical_bone_3d_editor_plugin.h" + +#include "editor/plugins/node_3d_editor_plugin.h" #include "scene/3d/physics_body_3d.h" -void PhysicalBoneEditor::_bind_methods() { +void PhysicalBone3DEditor::_bind_methods() { } -void PhysicalBoneEditor::_on_toggle_button_transform_joint(bool p_is_pressed) { +void PhysicalBone3DEditor::_on_toggle_button_transform_joint(bool p_is_pressed) { _set_move_joint(); } -void PhysicalBoneEditor::_set_move_joint() { +void PhysicalBone3DEditor::_set_move_joint() { if (selected) { selected->_set_gizmo_move_joint(button_transform_joint->is_pressed()); } } -PhysicalBoneEditor::PhysicalBoneEditor(EditorNode *p_editor) : +PhysicalBone3DEditor::PhysicalBone3DEditor(EditorNode *p_editor) : editor(p_editor), selected(NULL) { @@ -61,16 +62,16 @@ PhysicalBoneEditor::PhysicalBoneEditor(EditorNode *p_editor) : spatial_editor_hb->add_child(button_transform_joint); button_transform_joint->set_text(TTR("Move Joint")); - button_transform_joint->set_icon(Node3DEditor::get_singleton()->get_theme_icon("PhysicalBone", "EditorIcons")); + button_transform_joint->set_icon(Node3DEditor::get_singleton()->get_theme_icon("PhysicalBone3D", "EditorIcons")); button_transform_joint->set_toggle_mode(true); - button_transform_joint->connect("toggled", callable_mp(this, &PhysicalBoneEditor::_on_toggle_button_transform_joint)); + button_transform_joint->connect("toggled", callable_mp(this, &PhysicalBone3DEditor::_on_toggle_button_transform_joint)); hide(); } -PhysicalBoneEditor::~PhysicalBoneEditor() {} +PhysicalBone3DEditor::~PhysicalBone3DEditor() {} -void PhysicalBoneEditor::set_selected(PhysicalBone3D *p_pb) { +void PhysicalBone3DEditor::set_selected(PhysicalBone3D *p_pb) { button_transform_joint->set_pressed(false); @@ -79,20 +80,20 @@ void PhysicalBoneEditor::set_selected(PhysicalBone3D *p_pb) { _set_move_joint(); } -void PhysicalBoneEditor::hide() { +void PhysicalBone3DEditor::hide() { spatial_editor_hb->hide(); } -void PhysicalBoneEditor::show() { +void PhysicalBone3DEditor::show() { spatial_editor_hb->show(); } -PhysicalBonePlugin::PhysicalBonePlugin(EditorNode *p_editor) : +PhysicalBone3DEditorPlugin::PhysicalBone3DEditorPlugin(EditorNode *p_editor) : editor(p_editor), selected(NULL), physical_bone_editor(editor) {} -void PhysicalBonePlugin::make_visible(bool p_visible) { +void PhysicalBone3DEditorPlugin::make_visible(bool p_visible) { if (p_visible) { physical_bone_editor.show(); @@ -104,7 +105,7 @@ void PhysicalBonePlugin::make_visible(bool p_visible) { } } -void PhysicalBonePlugin::edit(Object *p_node) { +void PhysicalBone3DEditorPlugin::edit(Object *p_node) { selected = static_cast<PhysicalBone3D *>(p_node); // Trust it ERR_FAIL_COND(!selected); diff --git a/editor/plugins/physical_bone_plugin.h b/editor/plugins/physical_bone_3d_editor_plugin.h index 0d4aa7138d..74932710d6 100644 --- a/editor/plugins/physical_bone_plugin.h +++ b/editor/plugins/physical_bone_3d_editor_plugin.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* physical_bone_plugin.h */ +/* physical_bone_3d_editor_plugin.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -33,8 +33,8 @@ #include "editor/editor_node.h" -class PhysicalBoneEditor : public Object { - GDCLASS(PhysicalBoneEditor, Object); +class PhysicalBone3DEditor : public Object { + GDCLASS(PhysicalBone3DEditor, Object); EditorNode *editor; HBoxContainer *spatial_editor_hb; @@ -50,8 +50,8 @@ private: void _set_move_joint(); public: - PhysicalBoneEditor(EditorNode *p_editor); - ~PhysicalBoneEditor(); + PhysicalBone3DEditor(EditorNode *p_editor); + ~PhysicalBone3DEditor(); void set_selected(PhysicalBone3D *p_pb); @@ -59,12 +59,12 @@ public: void show(); }; -class PhysicalBonePlugin : public EditorPlugin { - GDCLASS(PhysicalBonePlugin, EditorPlugin); +class PhysicalBone3DEditorPlugin : public EditorPlugin { + GDCLASS(PhysicalBone3DEditorPlugin, EditorPlugin); EditorNode *editor; PhysicalBone3D *selected; - PhysicalBoneEditor physical_bone_editor; + PhysicalBone3DEditor physical_bone_editor; public: virtual String get_name() const { return "PhysicalBone3D"; } @@ -72,7 +72,7 @@ public: virtual void make_visible(bool p_visible); virtual void edit(Object *p_node); - PhysicalBonePlugin(EditorNode *p_editor); + PhysicalBone3DEditorPlugin(EditorNode *p_editor); }; #endif diff --git a/editor/plugins/skeleton_editor_plugin.cpp b/editor/plugins/skeleton_3d_editor_plugin.cpp index 941461bb64..ae289dae4b 100644 --- a/editor/plugins/skeleton_editor_plugin.cpp +++ b/editor/plugins/skeleton_3d_editor_plugin.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* skeleton_editor_plugin.cpp */ +/* skeleton_3d_editor_plugin.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,16 +28,16 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "skeleton_editor_plugin.h" +#include "skeleton_3d_editor_plugin.h" +#include "node_3d_editor_plugin.h" #include "scene/3d/collision_shape_3d.h" #include "scene/3d/physics_body_3d.h" #include "scene/3d/physics_joint_3d.h" #include "scene/resources/capsule_shape_3d.h" #include "scene/resources/sphere_shape_3d.h" -#include "spatial_editor_plugin.h" -void SkeletonEditor::_on_click_option(int p_option) { +void Skeleton3DEditor::_on_click_option(int p_option) { if (!skeleton) { return; } @@ -49,7 +49,7 @@ void SkeletonEditor::_on_click_option(int p_option) { } } -void SkeletonEditor::create_physical_skeleton() { +void Skeleton3DEditor::create_physical_skeleton() { UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); Node *owner = skeleton == get_tree()->get_edited_scene_root() ? skeleton : skeleton->get_owner(); @@ -101,7 +101,7 @@ void SkeletonEditor::create_physical_skeleton() { } } -PhysicalBone3D *SkeletonEditor::create_physical_bone(int bone_id, int bone_child_id, const Vector<BoneInfo> &bones_infos) { +PhysicalBone3D *Skeleton3DEditor::create_physical_bone(int bone_id, int bone_child_id, const Vector<BoneInfo> &bones_infos) { const Transform child_rest = skeleton->get_bone_rest(bone_child_id); @@ -130,18 +130,18 @@ PhysicalBone3D *SkeletonEditor::create_physical_bone(int bone_id, int bone_child return physical_bone; } -void SkeletonEditor::edit(Skeleton3D *p_node) { +void Skeleton3DEditor::edit(Skeleton3D *p_node) { skeleton = p_node; } -void SkeletonEditor::_notification(int p_what) { +void Skeleton3DEditor::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { - get_tree()->connect("node_removed", callable_mp(this, &SkeletonEditor::_node_removed)); + get_tree()->connect("node_removed", callable_mp(this, &Skeleton3DEditor::_node_removed)); } } -void SkeletonEditor::_node_removed(Node *p_node) { +void Skeleton3DEditor::_node_removed(Node *p_node) { if (p_node == skeleton) { skeleton = NULL; @@ -149,34 +149,34 @@ void SkeletonEditor::_node_removed(Node *p_node) { } } -void SkeletonEditor::_bind_methods() { +void Skeleton3DEditor::_bind_methods() { } -SkeletonEditor::SkeletonEditor() { +Skeleton3DEditor::Skeleton3DEditor() { skeleton = NULL; options = memnew(MenuButton); Node3DEditor::get_singleton()->add_control_to_menu_panel(options); - options->set_text(TTR("Skeleton")); + options->set_text(TTR("Skeleton3D")); options->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("Skeleton3D", "EditorIcons")); options->get_popup()->add_item(TTR("Create physical skeleton"), MENU_OPTION_CREATE_PHYSICAL_SKELETON); - options->get_popup()->connect("id_pressed", callable_mp(this, &SkeletonEditor::_on_click_option)); + options->get_popup()->connect("id_pressed", callable_mp(this, &Skeleton3DEditor::_on_click_option)); options->hide(); } -SkeletonEditor::~SkeletonEditor() {} +Skeleton3DEditor::~Skeleton3DEditor() {} -void SkeletonEditorPlugin::edit(Object *p_object) { +void Skeleton3DEditorPlugin::edit(Object *p_object) { skeleton_editor->edit(Object::cast_to<Skeleton3D>(p_object)); } -bool SkeletonEditorPlugin::handles(Object *p_object) const { +bool Skeleton3DEditorPlugin::handles(Object *p_object) const { return p_object->is_class("Skeleton3D"); } -void SkeletonEditorPlugin::make_visible(bool p_visible) { +void Skeleton3DEditorPlugin::make_visible(bool p_visible) { if (p_visible) { skeleton_editor->options->show(); } else { @@ -186,10 +186,10 @@ void SkeletonEditorPlugin::make_visible(bool p_visible) { } } -SkeletonEditorPlugin::SkeletonEditorPlugin(EditorNode *p_node) { +Skeleton3DEditorPlugin::Skeleton3DEditorPlugin(EditorNode *p_node) { editor = p_node; - skeleton_editor = memnew(SkeletonEditor); + skeleton_editor = memnew(Skeleton3DEditor); editor->get_viewport()->add_child(skeleton_editor); } -SkeletonEditorPlugin::~SkeletonEditorPlugin() {} +Skeleton3DEditorPlugin::~Skeleton3DEditorPlugin() {} diff --git a/editor/plugins/skeleton_editor_plugin.h b/editor/plugins/skeleton_3d_editor_plugin.h index 91e244285d..606e04bb79 100644 --- a/editor/plugins/skeleton_editor_plugin.h +++ b/editor/plugins/skeleton_3d_editor_plugin.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* skeleton_editor_plugin.h */ +/* skeleton_3d_editor_plugin.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,8 +28,8 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#ifndef SKELETON_EDITOR_PLUGIN_H -#define SKELETON_EDITOR_PLUGIN_H +#ifndef SKELETON_3D_EDITOR_PLUGIN_H +#define SKELETON_3D_EDITOR_PLUGIN_H #include "editor/editor_node.h" #include "editor/editor_plugin.h" @@ -38,8 +38,8 @@ class PhysicalBone3D; class Joint3D; -class SkeletonEditor : public Node { - GDCLASS(SkeletonEditor, Node); +class Skeleton3DEditor : public Node { + GDCLASS(Skeleton3DEditor, Node); enum Menu { MENU_OPTION_CREATE_PHYSICAL_SKELETON @@ -58,7 +58,7 @@ class SkeletonEditor : public Node { void _on_click_option(int p_option); - friend class SkeletonEditorPlugin; + friend class Skeleton3DEditorPlugin; protected: void _notification(int p_what); @@ -71,26 +71,26 @@ protected: public: void edit(Skeleton3D *p_node); - SkeletonEditor(); - ~SkeletonEditor(); + Skeleton3DEditor(); + ~Skeleton3DEditor(); }; -class SkeletonEditorPlugin : public EditorPlugin { +class Skeleton3DEditorPlugin : public EditorPlugin { - GDCLASS(SkeletonEditorPlugin, EditorPlugin); + GDCLASS(Skeleton3DEditorPlugin, EditorPlugin); EditorNode *editor; - SkeletonEditor *skeleton_editor; + Skeleton3DEditor *skeleton_editor; public: - virtual String get_name() const { return "Skeleton"; } + virtual String get_name() const { return "Skeleton3D"; } virtual bool has_main_screen() const { return false; } virtual void edit(Object *p_object); virtual bool handles(Object *p_object) const; virtual void make_visible(bool p_visible); - SkeletonEditorPlugin(EditorNode *p_node); - ~SkeletonEditorPlugin(); + Skeleton3DEditorPlugin(EditorNode *p_node); + ~Skeleton3DEditorPlugin(); }; -#endif // SKELETON_EDITOR_PLUGIN_H +#endif // SKELETON_3D_EDITOR_PLUGIN_H diff --git a/editor/plugins/skeleton_ik_editor_plugin.cpp b/editor/plugins/skeleton_ik_3d_editor_plugin.cpp index 548cbe9470..4b6a86bb5a 100644 --- a/editor/plugins/skeleton_ik_editor_plugin.cpp +++ b/editor/plugins/skeleton_ik_3d_editor_plugin.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* skeleton_ik_editor_plugin.cpp */ +/* skeleton_ik_3d_editor_plugin.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,11 +28,11 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "skeleton_ik_editor_plugin.h" +#include "skeleton_ik_3d_editor_plugin.h" -#include "scene/animation/skeleton_ik.h" +#include "scene/3d/skeleton_ik_3d.h" -void SkeletonIKEditorPlugin::_play() { +void SkeletonIK3DEditorPlugin::_play() { if (!skeleton_ik) return; @@ -48,7 +48,7 @@ void SkeletonIKEditorPlugin::_play() { } } -void SkeletonIKEditorPlugin::edit(Object *p_object) { +void SkeletonIK3DEditorPlugin::edit(Object *p_object) { if (p_object != skeleton_ik) { if (skeleton_ik) { @@ -64,12 +64,12 @@ void SkeletonIKEditorPlugin::edit(Object *p_object) { skeleton_ik = s; } -bool SkeletonIKEditorPlugin::handles(Object *p_object) const { +bool SkeletonIK3DEditorPlugin::handles(Object *p_object) const { return p_object->is_class("SkeletonIK3D"); } -void SkeletonIKEditorPlugin::make_visible(bool p_visible) { +void SkeletonIK3DEditorPlugin::make_visible(bool p_visible) { if (p_visible) play_btn->show(); @@ -77,10 +77,10 @@ void SkeletonIKEditorPlugin::make_visible(bool p_visible) { play_btn->hide(); } -void SkeletonIKEditorPlugin::_bind_methods() { +void SkeletonIK3DEditorPlugin::_bind_methods() { } -SkeletonIKEditorPlugin::SkeletonIKEditorPlugin(EditorNode *p_node) { +SkeletonIK3DEditorPlugin::SkeletonIK3DEditorPlugin(EditorNode *p_node) { editor = p_node; play_btn = memnew(Button); @@ -88,9 +88,9 @@ SkeletonIKEditorPlugin::SkeletonIKEditorPlugin(EditorNode *p_node) { play_btn->set_text(TTR("Play IK")); play_btn->set_toggle_mode(true); play_btn->hide(); - play_btn->connect("pressed", callable_mp(this, &SkeletonIKEditorPlugin::_play)); + play_btn->connect("pressed", callable_mp(this, &SkeletonIK3DEditorPlugin::_play)); add_control_to_container(CONTAINER_SPATIAL_EDITOR_MENU, play_btn); skeleton_ik = NULL; } -SkeletonIKEditorPlugin::~SkeletonIKEditorPlugin() {} +SkeletonIK3DEditorPlugin::~SkeletonIK3DEditorPlugin() {} diff --git a/editor/plugins/skeleton_ik_editor_plugin.h b/editor/plugins/skeleton_ik_3d_editor_plugin.h index 8895a548fe..1466d670ba 100644 --- a/editor/plugins/skeleton_ik_editor_plugin.h +++ b/editor/plugins/skeleton_ik_3d_editor_plugin.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* skeleton_ik_editor_plugin.h */ +/* skeleton_ik_3d_editor_plugin.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,17 +28,17 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#ifndef SKELETON_IK_EDITOR_PLUGIN_H -#define SKELETON_IK_EDITOR_PLUGIN_H +#ifndef SKELETON_IK_3D_EDITOR_PLUGIN_H +#define SKELETON_IK_3D_EDITOR_PLUGIN_H #include "editor/editor_node.h" #include "editor/editor_plugin.h" class SkeletonIK3D; -class SkeletonIKEditorPlugin : public EditorPlugin { +class SkeletonIK3DEditorPlugin : public EditorPlugin { - GDCLASS(SkeletonIKEditorPlugin, EditorPlugin); + GDCLASS(SkeletonIK3DEditorPlugin, EditorPlugin); SkeletonIK3D *skeleton_ik; @@ -57,8 +57,8 @@ public: virtual bool handles(Object *p_object) const; virtual void make_visible(bool p_visible); - SkeletonIKEditorPlugin(EditorNode *p_node); - ~SkeletonIKEditorPlugin(); + SkeletonIK3DEditorPlugin(EditorNode *p_node); + ~SkeletonIK3DEditorPlugin(); }; -#endif // SKELETON_IK_EDITOR_PLUGIN_H +#endif // SKELETON_IK_3D_EDITOR_PLUGIN_H diff --git a/editor/plugins/sprite_editor_plugin.cpp b/editor/plugins/sprite_2d_editor_plugin.cpp index 3eb76946a6..ce994ee6c7 100644 --- a/editor/plugins/sprite_editor_plugin.cpp +++ b/editor/plugins/sprite_2d_editor_plugin.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* sprite_editor_plugin.cpp */ +/* sprite_2d_editor_plugin.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "sprite_editor_plugin.h" +#include "sprite_2d_editor_plugin.h" #include "canvas_item_editor_plugin.h" #include "editor/editor_scale.h" @@ -39,7 +39,7 @@ #include "scene/gui/box_container.h" #include "thirdparty/misc/clipper.hpp" -void SpriteEditor::_node_removed(Node *p_node) { +void Sprite2DEditor::_node_removed(Node *p_node) { if (p_node == node) { node = NULL; @@ -47,7 +47,7 @@ void SpriteEditor::_node_removed(Node *p_node) { } } -void SpriteEditor::edit(Sprite2D *p_sprite) { +void Sprite2DEditor::edit(Sprite2D *p_sprite) { node = p_sprite; } @@ -114,7 +114,7 @@ Vector<Vector2> expand(const Vector<Vector2> &points, const Rect2i &rect, float return outPoints; } -void SpriteEditor::_menu_option(int p_option) { +void Sprite2DEditor::_menu_option(int p_option) { if (!node) { return; @@ -165,11 +165,11 @@ void SpriteEditor::_menu_option(int p_option) { } } -void SpriteEditor::_update_mesh_data() { +void Sprite2DEditor::_update_mesh_data() { Ref<Texture2D> texture = node->get_texture(); if (texture.is_null()) { - err_dialog->set_text(TTR("Sprite is empty!")); + err_dialog->set_text(TTR("Sprite2D is empty!")); err_dialog->popup_centered(); return; } @@ -296,7 +296,7 @@ void SpriteEditor::_update_mesh_data() { debug_uv->update(); } -void SpriteEditor::_create_node() { +void Sprite2DEditor::_create_node() { switch (selected_menu_item) { case MENU_OPTION_CONVERT_TO_MESH_2D: { _convert_to_mesh_2d_node(); @@ -313,7 +313,7 @@ void SpriteEditor::_create_node() { } } -void SpriteEditor::_convert_to_mesh_2d_node() { +void Sprite2DEditor::_convert_to_mesh_2d_node() { if (computed_vertices.size() < 3) { err_dialog->set_text(TTR("Invalid geometry, can't replace by mesh.")); @@ -344,7 +344,7 @@ void SpriteEditor::_convert_to_mesh_2d_node() { ur->commit_action(); } -void SpriteEditor::_convert_to_polygon_2d_node() { +void Sprite2DEditor::_convert_to_polygon_2d_node() { if (computed_outline_lines.empty()) { err_dialog->set_text(TTR("Invalid geometry, can't create polygon.")); @@ -403,7 +403,7 @@ void SpriteEditor::_convert_to_polygon_2d_node() { ur->commit_action(); } -void SpriteEditor::_create_collision_polygon_2d_node() { +void Sprite2DEditor::_create_collision_polygon_2d_node() { if (computed_outline_lines.empty()) { err_dialog->set_text(TTR("Invalid geometry, can't create collision polygon.")); @@ -427,7 +427,7 @@ void SpriteEditor::_create_collision_polygon_2d_node() { } } -void SpriteEditor::_create_light_occluder_2d_node() { +void Sprite2DEditor::_create_light_occluder_2d_node() { if (computed_outline_lines.empty()) { err_dialog->set_text(TTR("Invalid geometry, can't create light occluder.")); @@ -462,7 +462,7 @@ void SpriteEditor::_create_light_occluder_2d_node() { } } -void SpriteEditor::_add_as_sibling_or_child(Node *p_own_node, Node *p_new_node) { +void Sprite2DEditor::_add_as_sibling_or_child(Node *p_own_node, Node *p_new_node) { // Can't make sibling if own node is scene root if (p_own_node != this->get_tree()->get_edited_scene_root()) { p_own_node->get_parent()->add_child(p_new_node, true); @@ -474,7 +474,7 @@ void SpriteEditor::_add_as_sibling_or_child(Node *p_own_node, Node *p_new_node) p_new_node->set_owner(this->get_tree()->get_edited_scene_root()); } -void SpriteEditor::_debug_uv_draw() { +void Sprite2DEditor::_debug_uv_draw() { Ref<Texture2D> tex = node->get_texture(); ERR_FAIL_COND(!tex.is_valid()); @@ -502,19 +502,19 @@ void SpriteEditor::_debug_uv_draw() { } } -void SpriteEditor::_bind_methods() { +void Sprite2DEditor::_bind_methods() { - ClassDB::bind_method("_add_as_sibling_or_child", &SpriteEditor::_add_as_sibling_or_child); + ClassDB::bind_method("_add_as_sibling_or_child", &Sprite2DEditor::_add_as_sibling_or_child); } -SpriteEditor::SpriteEditor() { +Sprite2DEditor::Sprite2DEditor() { options = memnew(MenuButton); CanvasItemEditor::get_singleton()->add_control_to_menu_panel(options); - options->set_text(TTR("Sprite")); - options->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("Sprite", "EditorIcons")); + options->set_text(TTR("Sprite2D")); + options->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("Sprite2D", "EditorIcons")); options->get_popup()->add_item(TTR("Convert to Mesh2D"), MENU_OPTION_CONVERT_TO_MESH_2D); options->get_popup()->add_item(TTR("Convert to Polygon2D"), MENU_OPTION_CONVERT_TO_POLYGON_2D); @@ -522,7 +522,7 @@ SpriteEditor::SpriteEditor() { options->get_popup()->add_item(TTR("Create LightOccluder2D Sibling"), MENU_OPTION_CREATE_LIGHT_OCCLUDER_2D); options->set_switch_on_hover(true); - options->get_popup()->connect("id_pressed", callable_mp(this, &SpriteEditor::_menu_option)); + options->get_popup()->connect("id_pressed", callable_mp(this, &Sprite2DEditor::_menu_option)); err_dialog = memnew(AcceptDialog); add_child(err_dialog); @@ -538,9 +538,9 @@ SpriteEditor::SpriteEditor() { scroll->set_enable_v_scroll(true); vb->add_margin_child(TTR("Preview:"), scroll, true); debug_uv = memnew(Control); - debug_uv->connect("draw", callable_mp(this, &SpriteEditor::_debug_uv_draw)); + debug_uv->connect("draw", callable_mp(this, &Sprite2DEditor::_debug_uv_draw)); scroll->add_child(debug_uv); - debug_uv_dialog->connect("confirmed", callable_mp(this, &SpriteEditor::_create_node)); + debug_uv_dialog->connect("confirmed", callable_mp(this, &Sprite2DEditor::_create_node)); HBoxContainer *hb = memnew(HBoxContainer); hb->add_child(memnew(Label(TTR("Simplification: ")))); @@ -569,24 +569,24 @@ SpriteEditor::SpriteEditor() { hb->add_spacer(); update_preview = memnew(Button); update_preview->set_text(TTR("Update Preview")); - update_preview->connect("pressed", callable_mp(this, &SpriteEditor::_update_mesh_data)); + update_preview->connect("pressed", callable_mp(this, &Sprite2DEditor::_update_mesh_data)); hb->add_child(update_preview); vb->add_margin_child(TTR("Settings:"), hb); add_child(debug_uv_dialog); } -void SpriteEditorPlugin::edit(Object *p_object) { +void Sprite2DEditorPlugin::edit(Object *p_object) { sprite_editor->edit(Object::cast_to<Sprite2D>(p_object)); } -bool SpriteEditorPlugin::handles(Object *p_object) const { +bool Sprite2DEditorPlugin::handles(Object *p_object) const { return p_object->is_class("Sprite2D"); } -void SpriteEditorPlugin::make_visible(bool p_visible) { +void Sprite2DEditorPlugin::make_visible(bool p_visible) { if (p_visible) { sprite_editor->options->show(); @@ -597,15 +597,15 @@ void SpriteEditorPlugin::make_visible(bool p_visible) { } } -SpriteEditorPlugin::SpriteEditorPlugin(EditorNode *p_node) { +Sprite2DEditorPlugin::Sprite2DEditorPlugin(EditorNode *p_node) { editor = p_node; - sprite_editor = memnew(SpriteEditor); + sprite_editor = memnew(Sprite2DEditor); editor->get_viewport()->add_child(sprite_editor); make_visible(false); //sprite_editor->options->hide(); } -SpriteEditorPlugin::~SpriteEditorPlugin() { +Sprite2DEditorPlugin::~Sprite2DEditorPlugin() { } diff --git a/editor/plugins/sprite_editor_plugin.h b/editor/plugins/sprite_2d_editor_plugin.h index b55446469c..d0ebf9c84e 100644 --- a/editor/plugins/sprite_editor_plugin.h +++ b/editor/plugins/sprite_2d_editor_plugin.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* sprite_editor_plugin.h */ +/* sprite_2d_editor_plugin.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -36,9 +36,9 @@ #include "scene/2d/sprite_2d.h" #include "scene/gui/spin_box.h" -class SpriteEditor : public Control { +class Sprite2DEditor : public Control { - GDCLASS(SpriteEditor, Control); + GDCLASS(Sprite2DEditor, Control); enum Menu { MENU_OPTION_CONVERT_TO_MESH_2D, @@ -74,7 +74,7 @@ class SpriteEditor : public Control { void _menu_option(int p_option); //void _create_uv_lines(); - friend class SpriteEditorPlugin; + friend class Sprite2DEditorPlugin; void _debug_uv_draw(); void _update_mesh_data(); @@ -93,14 +93,14 @@ protected: public: void edit(Sprite2D *p_sprite); - SpriteEditor(); + Sprite2DEditor(); }; -class SpriteEditorPlugin : public EditorPlugin { +class Sprite2DEditorPlugin : public EditorPlugin { - GDCLASS(SpriteEditorPlugin, EditorPlugin); + GDCLASS(Sprite2DEditorPlugin, EditorPlugin); - SpriteEditor *sprite_editor; + Sprite2DEditor *sprite_editor; EditorNode *editor; public: @@ -110,8 +110,8 @@ public: virtual bool handles(Object *p_object) const; virtual void make_visible(bool p_visible); - SpriteEditorPlugin(EditorNode *p_node); - ~SpriteEditorPlugin(); + Sprite2DEditorPlugin(EditorNode *p_node); + ~Sprite2DEditorPlugin(); }; #endif // SPRITE_EDITOR_PLUGIN_H |