Răsfoiți Sursa

Merge pull request #107043 from lawnjelly/fti_scene_tree_fix_forced3

[3.x] `SceneTreeFTI` - fix identity_xform flag getting out of sync
lawnjelly 3 luni în urmă
părinte
comite
caf918f44f
1 a modificat fișierele cu 4 adăugiri și 4 ștergeri
  1. 4 4
      scene/3d/spatial.cpp

+ 4 - 4
scene/3d/spatial.cpp

@@ -335,7 +335,6 @@ void Spatial::fti_notify_node_changed(bool p_transform_changed) {
 }
 
 void Spatial::set_transform(const Transform &p_transform) {
-	fti_notify_node_changed();
 	data.local_transform = p_transform;
 	data.dirty |= DIRTY_VECTORS;
 	data.dirty &= ~DIRTY_LOCAL;
@@ -347,6 +346,7 @@ void Spatial::set_transform(const Transform &p_transform) {
 	if (data.notify_local_transform) {
 		notification(NOTIFICATION_LOCAL_TRANSFORM_CHANGED);
 	}
+	fti_notify_node_changed();
 }
 
 void Spatial::set_global_transform(const Transform &p_transform) {
@@ -544,17 +544,16 @@ Transform Spatial::get_relative_transform(const Node *p_parent) const {
 }
 
 void Spatial::set_translation(const Vector3 &p_translation) {
-	fti_notify_node_changed();
 	data.local_transform.origin = p_translation;
 	_change_notify("transform");
 	_propagate_transform_changed(this);
 	if (data.notify_local_transform) {
 		notification(NOTIFICATION_LOCAL_TRANSFORM_CHANGED);
 	}
+	fti_notify_node_changed();
 }
 
 void Spatial::set_rotation(const Vector3 &p_euler_rad) {
-	fti_notify_node_changed();
 	if (data.dirty & DIRTY_VECTORS) {
 		data.scale = data.local_transform.basis.get_scale();
 		data.dirty &= ~DIRTY_VECTORS;
@@ -567,6 +566,7 @@ void Spatial::set_rotation(const Vector3 &p_euler_rad) {
 	if (data.notify_local_transform) {
 		notification(NOTIFICATION_LOCAL_TRANSFORM_CHANGED);
 	}
+	fti_notify_node_changed();
 }
 
 void Spatial::set_rotation_degrees(const Vector3 &p_euler_deg) {
@@ -574,7 +574,6 @@ void Spatial::set_rotation_degrees(const Vector3 &p_euler_deg) {
 }
 
 void Spatial::set_scale(const Vector3 &p_scale) {
-	fti_notify_node_changed();
 	if (data.dirty & DIRTY_VECTORS) {
 		data.rotation = data.local_transform.basis.get_rotation();
 		data.dirty &= ~DIRTY_VECTORS;
@@ -587,6 +586,7 @@ void Spatial::set_scale(const Vector3 &p_scale) {
 	if (data.notify_local_transform) {
 		notification(NOTIFICATION_LOCAL_TRANSFORM_CHANGED);
 	}
+	fti_notify_node_changed();
 }
 
 Vector3 Spatial::get_translation() const {