summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-06-14 18:32:33 +0200
committerGitHub <noreply@github.com>2021-06-14 18:32:33 +0200
commit07b8fffa7c8e065014e55087a3a8273e66fa124d (patch)
tree3d6dd07582c71f85754cbb46655694734eb4787c /scene
parent6c1445bfea9a32a0b08dff5acae722cc91239346 (diff)
parentee702334a1c7bd19dd8fd7fd57009e393939bab7 (diff)
Merge pull request #49458 from JFonS/fix_unwrap_xform
Rename get_parent_spatial() to get_parent_node_3d()
Diffstat (limited to 'scene')
-rw-r--r--scene/3d/node_3d.cpp10
-rw-r--r--scene/3d/node_3d.h2
2 files changed, 8 insertions, 4 deletions
diff --git a/scene/3d/node_3d.cpp b/scene/3d/node_3d.cpp
index 1c0ffa5126..e96b8ee1f9 100644
--- a/scene/3d/node_3d.cpp
+++ b/scene/3d/node_3d.cpp
@@ -285,8 +285,12 @@ Transform3D Node3D::get_local_gizmo_transform() const {
}
#endif
-Node3D *Node3D::get_parent_spatial() const {
- return data.parent;
+Node3D *Node3D::get_parent_node_3d() const {
+ if (data.top_level) {
+ return nullptr;
+ }
+
+ return Object::cast_to<Node3D>(get_parent());
}
Transform3D Node3D::get_relative_transform(const Node *p_parent) const {
@@ -751,7 +755,7 @@ void Node3D::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_scale"), &Node3D::get_scale);
ClassDB::bind_method(D_METHOD("set_global_transform", "global"), &Node3D::set_global_transform);
ClassDB::bind_method(D_METHOD("get_global_transform"), &Node3D::get_global_transform);
- ClassDB::bind_method(D_METHOD("get_parent_spatial"), &Node3D::get_parent_spatial);
+ ClassDB::bind_method(D_METHOD("get_parent_node_3d"), &Node3D::get_parent_node_3d);
ClassDB::bind_method(D_METHOD("set_ignore_transform_notification", "enabled"), &Node3D::set_ignore_transform_notification);
ClassDB::bind_method(D_METHOD("set_as_top_level", "enable"), &Node3D::set_as_top_level);
ClassDB::bind_method(D_METHOD("is_set_as_top_level"), &Node3D::is_set_as_top_level);
diff --git a/scene/3d/node_3d.h b/scene/3d/node_3d.h
index 423ee59c7a..c7e36cf2ec 100644
--- a/scene/3d/node_3d.h
+++ b/scene/3d/node_3d.h
@@ -125,7 +125,7 @@ public:
NOTIFICATION_LOCAL_TRANSFORM_CHANGED = 44,
};
- Node3D *get_parent_spatial() const;
+ Node3D *get_parent_node_3d() const;
Ref<World3D> get_world_3d() const;