summaryrefslogtreecommitdiff
path: root/scene/3d/spatial.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2018-09-06 20:38:16 -0300
committerJuan Linietsky <reduzio@gmail.com>2018-09-06 20:38:16 -0300
commit74359a1d1e288a156d89e052d6b4ae6e8c187c6b (patch)
tree595419274d3a4040e60b4fba62a70c0afc2a7cb8 /scene/3d/spatial.cpp
parent072bf41c037ef4c7aab23f1afa769c65c9dfdf73 (diff)
Add a function to force transform update, fixes #17628
Diffstat (limited to 'scene/3d/spatial.cpp')
-rw-r--r--scene/3d/spatial.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/scene/3d/spatial.cpp b/scene/3d/spatial.cpp
index d52f634639..d6141c12a8 100644
--- a/scene/3d/spatial.cpp
+++ b/scene/3d/spatial.cpp
@@ -721,6 +721,16 @@ bool Spatial::is_local_transform_notification_enabled() const {
return data.notify_local_transform;
}
+void Spatial::force_update_transform() {
+ ERR_FAIL_COND(!is_inside_tree());
+ if (!xform_change.in_list()) {
+ return; //nothing to update
+ }
+ get_tree()->xform_change_list.remove(&xform_change);
+
+ notification(NOTIFICATION_TRANSFORM_CHANGED);
+}
+
void Spatial::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_transform", "local"), &Spatial::set_transform);
@@ -743,6 +753,8 @@ void Spatial::_bind_methods() {
ClassDB::bind_method(D_METHOD("is_scale_disabled"), &Spatial::is_scale_disabled);
ClassDB::bind_method(D_METHOD("get_world"), &Spatial::get_world);
+ ClassDB::bind_method(D_METHOD("force_update_transform"), &Spatial::force_update_transform);
+
ClassDB::bind_method(D_METHOD("_update_gizmo"), &Spatial::_update_gizmo);
ClassDB::bind_method(D_METHOD("update_gizmo"), &Spatial::update_gizmo);