Bladeren bron

Rename Position* nodes to Marker*

- Position2D -> Marker2D
- Position3D -> Marker3D

Also changes their respective file names.
Micky 3 jaren geleden
bovenliggende
commit
8bb305356e

+ 1 - 1
doc/classes/Position2D.xml → doc/classes/Marker2D.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" ?>
-<class name="Position2D" inherits="Node2D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+<class name="Marker2D" inherits="Node2D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
 	<brief_description>
 		Generic 2D position hint for editing.
 	</brief_description>

+ 1 - 1
doc/classes/Position3D.xml → doc/classes/Marker3D.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" ?>
-<class name="Position3D" inherits="Node3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+<class name="Marker3D" inherits="Node3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
 	<brief_description>
 		Generic 3D position hint for editing.
 	</brief_description>

+ 0 - 0
editor/icons/Position2D.svg → editor/icons/Marker2D.svg


+ 0 - 0
editor/icons/Position3D.svg → editor/icons/Marker3D.svg


+ 9 - 9
editor/plugins/node_3d_editor_gizmos.cpp

@@ -51,10 +51,10 @@
 #include "scene/3d/light_3d.h"
 #include "scene/3d/lightmap_gi.h"
 #include "scene/3d/lightmap_probe.h"
+#include "scene/3d/marker_3d.h"
 #include "scene/3d/mesh_instance_3d.h"
 #include "scene/3d/navigation_region_3d.h"
 #include "scene/3d/occluder_instance_3d.h"
-#include "scene/3d/position_3d.h"
 #include "scene/3d/ray_cast_3d.h"
 #include "scene/3d/reflection_probe.h"
 #include "scene/3d/shape_cast_3d.h"
@@ -2291,7 +2291,7 @@ void Label3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
 
 ///
 
-Position3DGizmoPlugin::Position3DGizmoPlugin() {
+Marker3DGizmoPlugin::Marker3DGizmoPlugin() {
 	pos3d_mesh = Ref<ArrayMesh>(memnew(ArrayMesh));
 	cursor_points = Vector<Vector3>();
 
@@ -2315,7 +2315,7 @@ Position3DGizmoPlugin::Position3DGizmoPlugin() {
 
 	// Use the axis color which is brighter for the positive axis.
 	// Use a darkened axis color for the negative axis.
-	// This makes it possible to see in which direction the Position3D node is rotated
+	// This makes it possible to see in which direction the Marker3D node is rotated
 	// (which can be important depending on how it's used).
 	const Color color_x = EditorNode::get_singleton()->get_gui_base()->get_theme_color(SNAME("axis_x_color"), SNAME("Editor"));
 	cursor_colors.push_back(color_x);
@@ -2351,19 +2351,19 @@ Position3DGizmoPlugin::Position3DGizmoPlugin() {
 	pos3d_mesh->surface_set_material(0, mat);
 }
 
-bool Position3DGizmoPlugin::has_gizmo(Node3D *p_spatial) {
-	return Object::cast_to<Position3D>(p_spatial) != nullptr;
+bool Marker3DGizmoPlugin::has_gizmo(Node3D *p_spatial) {
+	return Object::cast_to<Marker3D>(p_spatial) != nullptr;
 }
 
-String Position3DGizmoPlugin::get_gizmo_name() const {
-	return "Position3D";
+String Marker3DGizmoPlugin::get_gizmo_name() const {
+	return "Marker3D";
 }
 
-int Position3DGizmoPlugin::get_priority() const {
+int Marker3DGizmoPlugin::get_priority() const {
 	return -1;
 }
 
-void Position3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
+void Marker3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
 	p_gizmo->clear();
 	p_gizmo->add_mesh(pos3d_mesh);
 	p_gizmo->add_collision_segments(cursor_points);

+ 3 - 3
editor/plugins/node_3d_editor_gizmos.h

@@ -334,8 +334,8 @@ public:
 	Label3DGizmoPlugin();
 };
 
-class Position3DGizmoPlugin : public EditorNode3DGizmoPlugin {
-	GDCLASS(Position3DGizmoPlugin, EditorNode3DGizmoPlugin);
+class Marker3DGizmoPlugin : public EditorNode3DGizmoPlugin {
+	GDCLASS(Marker3DGizmoPlugin, EditorNode3DGizmoPlugin);
 
 	Ref<ArrayMesh> pos3d_mesh;
 	Vector<Vector3> cursor_points;
@@ -346,7 +346,7 @@ public:
 	int get_priority() const override;
 	void redraw(EditorNode3DGizmo *p_gizmo) override;
 
-	Position3DGizmoPlugin();
+	Marker3DGizmoPlugin();
 };
 
 class PhysicalBone3DGizmoPlugin : public EditorNode3DGizmoPlugin {

+ 1 - 1
editor/plugins/node_3d_editor_plugin.cpp

@@ -7487,7 +7487,7 @@ void Node3DEditor::_register_all_gizmos() {
 	add_gizmo_plugin(Ref<SoftDynamicBody3DGizmoPlugin>(memnew(SoftDynamicBody3DGizmoPlugin)));
 	add_gizmo_plugin(Ref<Sprite3DGizmoPlugin>(memnew(Sprite3DGizmoPlugin)));
 	add_gizmo_plugin(Ref<Label3DGizmoPlugin>(memnew(Label3DGizmoPlugin)));
-	add_gizmo_plugin(Ref<Position3DGizmoPlugin>(memnew(Position3DGizmoPlugin)));
+	add_gizmo_plugin(Ref<Marker3DGizmoPlugin>(memnew(Marker3DGizmoPlugin)));
 	add_gizmo_plugin(Ref<RayCast3DGizmoPlugin>(memnew(RayCast3DGizmoPlugin)));
 	add_gizmo_plugin(Ref<ShapeCast3DGizmoPlugin>(memnew(ShapeCast3DGizmoPlugin)));
 	add_gizmo_plugin(Ref<SpringArm3DGizmoPlugin>(memnew(SpringArm3DGizmoPlugin)));

+ 2 - 0
editor/project_converter_3_to_4.cpp

@@ -1361,6 +1361,8 @@ static const char *class_renames[][2] = {
 	{ "PinJoint", "PinJoint3D" },
 	{ "PlaneShape", "WorldBoundaryShape3D" },
 	{ "PopupDialog", "Popup" },
+	{ "Position2D", "Marker2D" },
+	{ "Position3D", "Marker3D" },
 	{ "ProceduralSky", "Sky" },
 	{ "RayCast", "RayCast3D" },
 	{ "RayShape", "SeparationRayShape3D" },

+ 13 - 13
scene/2d/position_2d.cpp → scene/2d/marker_2d.cpp

@@ -1,5 +1,5 @@
 /*************************************************************************/
-/*  position_2d.cpp                                                      */
+/*  marker_2d.cpp                                                        */
 /*************************************************************************/
 /*                       This file is part of:                           */
 /*                           GODOT ENGINE                                */
@@ -28,9 +28,9 @@
 /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */
 /*************************************************************************/
 
-#include "position_2d.h"
+#include "marker_2d.h"
 
-void Position2D::_draw_cross() {
+void Marker2D::_draw_cross() {
 	const real_t extents = get_gizmo_extents();
 
 	// Add more points to create a "hard stop" in the color gradient.
@@ -50,7 +50,7 @@ void Position2D::_draw_cross() {
 
 	// Use the axis color which is brighter for the positive axis.
 	// Use a darkened axis color for the negative axis.
-	// This makes it possible to see in which direction the Position3D node is rotated
+	// This makes it possible to see in which direction the Marker3D node is rotated
 	// (which can be important depending on how it's used).
 	// Axis colors are taken from `axis_x_color` and `axis_y_color` (defined in `editor/editor_themes.cpp`).
 	const Color color_x = Color(0.96, 0.20, 0.32);
@@ -73,17 +73,17 @@ void Position2D::_draw_cross() {
 }
 
 #ifdef TOOLS_ENABLED
-Rect2 Position2D::_edit_get_rect() const {
+Rect2 Marker2D::_edit_get_rect() const {
 	real_t extents = get_gizmo_extents();
 	return Rect2(Point2(-extents, -extents), Size2(extents * 2, extents * 2));
 }
 
-bool Position2D::_edit_use_rect() const {
+bool Marker2D::_edit_use_rect() const {
 	return false;
 }
 #endif
 
-void Position2D::_notification(int p_what) {
+void Marker2D::_notification(int p_what) {
 	switch (p_what) {
 		case NOTIFICATION_ENTER_TREE: {
 			update();
@@ -100,21 +100,21 @@ void Position2D::_notification(int p_what) {
 	}
 }
 
-void Position2D::set_gizmo_extents(real_t p_extents) {
+void Marker2D::set_gizmo_extents(real_t p_extents) {
 	gizmo_extents = p_extents;
 	update();
 }
 
-real_t Position2D::get_gizmo_extents() const {
+real_t Marker2D::get_gizmo_extents() const {
 	return gizmo_extents;
 }
 
-void Position2D::_bind_methods() {
-	ClassDB::bind_method(D_METHOD("set_gizmo_extents", "extents"), &Position2D::set_gizmo_extents);
-	ClassDB::bind_method(D_METHOD("get_gizmo_extents"), &Position2D::get_gizmo_extents);
+void Marker2D::_bind_methods() {
+	ClassDB::bind_method(D_METHOD("set_gizmo_extents", "extents"), &Marker2D::set_gizmo_extents);
+	ClassDB::bind_method(D_METHOD("get_gizmo_extents"), &Marker2D::get_gizmo_extents);
 
 	ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "gizmo_extents", PROPERTY_HINT_RANGE, "0,1000,0.1,or_greater,suffix:px"), "set_gizmo_extents", "get_gizmo_extents");
 }
 
-Position2D::Position2D() {
+Marker2D::Marker2D() {
 }

+ 7 - 7
scene/2d/position_2d.h → scene/2d/marker_2d.h

@@ -1,5 +1,5 @@
 /*************************************************************************/
-/*  position_2d.h                                                        */
+/*  marker_2d.h                                                          */
 /*************************************************************************/
 /*                       This file is part of:                           */
 /*                           GODOT ENGINE                                */
@@ -28,13 +28,13 @@
 /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */
 /*************************************************************************/
 
-#ifndef POSITION_2D_H
-#define POSITION_2D_H
+#ifndef MARKER_2D_H
+#define MARKER_2D_H
 
 #include "scene/2d/node_2d.h"
 
-class Position2D : public Node2D {
-	GDCLASS(Position2D, Node2D);
+class Marker2D : public Node2D {
+	GDCLASS(Marker2D, Node2D);
 
 	real_t gizmo_extents = 10.0;
 
@@ -53,7 +53,7 @@ public:
 	void set_gizmo_extents(real_t p_extents);
 	real_t get_gizmo_extents() const;
 
-	Position2D();
+	Marker2D();
 };
 
-#endif // POSITION_2D_H
+#endif // MARKER_2D_H

+ 3 - 3
scene/3d/position_3d.cpp → scene/3d/marker_3d.cpp

@@ -1,5 +1,5 @@
 /*************************************************************************/
-/*  position_3d.cpp                                                      */
+/*  marker_3d.cpp                                                        */
 /*************************************************************************/
 /*                       This file is part of:                           */
 /*                           GODOT ENGINE                                */
@@ -28,7 +28,7 @@
 /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */
 /*************************************************************************/
 
-#include "position_3d.h"
+#include "marker_3d.h"
 
-Position3D::Position3D() {
+Marker3D::Marker3D() {
 }

+ 7 - 7
scene/3d/position_3d.h → scene/3d/marker_3d.h

@@ -1,5 +1,5 @@
 /*************************************************************************/
-/*  position_3d.h                                                        */
+/*  marker_3d.h                                                          */
 /*************************************************************************/
 /*                       This file is part of:                           */
 /*                           GODOT ENGINE                                */
@@ -28,16 +28,16 @@
 /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */
 /*************************************************************************/
 
-#ifndef POSITION_3D_H
-#define POSITION_3D_H
+#ifndef MARKER_3D_H
+#define MARKER_3D_H
 
 #include "scene/3d/node_3d.h"
 
-class Position3D : public Node3D {
-	GDCLASS(Position3D, Node3D);
+class Marker3D : public Node3D {
+	GDCLASS(Marker3D, Node3D);
 
 public:
-	Position3D();
+	Marker3D();
 };
 
-#endif // POSITION_3D_H
+#endif // MARKER_3D_H

+ 6 - 4
scene/register_scene_types.cpp

@@ -50,6 +50,7 @@
 #include "scene/2d/light_2d.h"
 #include "scene/2d/light_occluder_2d.h"
 #include "scene/2d/line_2d.h"
+#include "scene/2d/marker_2d.h"
 #include "scene/2d/mesh_instance_2d.h"
 #include "scene/2d/multimesh_instance_2d.h"
 #include "scene/2d/navigation_agent_2d.h"
@@ -60,7 +61,6 @@
 #include "scene/2d/physical_bone_2d.h"
 #include "scene/2d/physics_body_2d.h"
 #include "scene/2d/polygon_2d.h"
-#include "scene/2d/position_2d.h"
 #include "scene/2d/ray_cast_2d.h"
 #include "scene/2d/remote_transform_2d.h"
 #include "scene/2d/shape_cast_2d.h"
@@ -231,6 +231,7 @@
 #include "scene/3d/light_3d.h"
 #include "scene/3d/lightmap_gi.h"
 #include "scene/3d/lightmap_probe.h"
+#include "scene/3d/marker_3d.h"
 #include "scene/3d/mesh_instance_3d.h"
 #include "scene/3d/multimesh_instance_3d.h"
 #include "scene/3d/navigation_agent_3d.h"
@@ -240,7 +241,6 @@
 #include "scene/3d/occluder_instance_3d.h"
 #include "scene/3d/path_3d.h"
 #include "scene/3d/physics_body_3d.h"
-#include "scene/3d/position_3d.h"
 #include "scene/3d/ray_cast_3d.h"
 #include "scene/3d/reflection_probe.h"
 #include "scene/3d/remote_transform_3d.h"
@@ -522,7 +522,7 @@ void register_scene_types() {
 	GDREGISTER_CLASS(GPUParticlesAttractorSphere3D);
 	GDREGISTER_CLASS(GPUParticlesAttractorVectorField3D);
 	GDREGISTER_CLASS(CPUParticles3D);
-	GDREGISTER_CLASS(Position3D);
+	GDREGISTER_CLASS(Marker3D);
 	GDREGISTER_CLASS(RootMotionView);
 
 	OS::get_singleton()->yield(); // may take time to init
@@ -694,7 +694,7 @@ void register_scene_types() {
 	GDREGISTER_CLASS(Sprite2D);
 	GDREGISTER_CLASS(SpriteFrames);
 	GDREGISTER_CLASS(AnimatedSprite2D);
-	GDREGISTER_CLASS(Position2D);
+	GDREGISTER_CLASS(Marker2D);
 	GDREGISTER_CLASS(Line2D);
 	GDREGISTER_CLASS(MeshInstance2D);
 	GDREGISTER_CLASS(MultiMeshInstance2D);
@@ -1036,6 +1036,8 @@ void register_scene_types() {
 	ClassDB::add_compatibility_class("PhysicsShapeQueryParameters", "PhysicsShapeQueryParameters3D");
 	ClassDB::add_compatibility_class("PinJoint", "PinJoint3D");
 	ClassDB::add_compatibility_class("PlaneShape", "WorldBoundaryShape3D");
+	ClassDB::add_compatibility_class("Position2D", "Marker2D");
+	ClassDB::add_compatibility_class("Position3D", "Marker3D");
 	ClassDB::add_compatibility_class("ProceduralSky", "Sky");
 	ClassDB::add_compatibility_class("RayCast", "RayCast3D");
 	ClassDB::add_compatibility_class("RayShape", "SeparationRayShape3D");