Browse Source

Editor: Fix selection box update when reparenting objects in hierarchy (#30904)

* Editor: Dispatch objectChanged signal on object movement

* Update screenshot for WebGL buffer geometry attributes

* Revert "Update screenshot for WebGL buffer geometry attributes"

This reverts commit cbb40c495407c86b157bd015985ca28ed410f033.

* rerun CI

* Editor: Dispatch objectChanged signal for new and old parents during object movement

---------

Co-authored-by: xinde.li <xinde.li@bambulab.com>
xinde 10 months ago
parent
commit
3152a8b95d
1 changed files with 6 additions and 0 deletions
  1. 6 0
      editor/js/commands/MoveObjectCommand.js

+ 6 - 0
editor/js/commands/MoveObjectCommand.js

@@ -50,6 +50,9 @@ class MoveObjectCommand extends Command {
 		this.object.parent = this.newParent;
 		this.object.parent = this.newParent;
 
 
 		this.object.dispatchEvent( { type: 'added' } );
 		this.object.dispatchEvent( { type: 'added' } );
+		this.editor.signals.objectChanged.dispatch( this.object );
+		this.editor.signals.objectChanged.dispatch( this.newParent );
+		this.editor.signals.objectChanged.dispatch( this.oldParent );
 		this.editor.signals.sceneGraphChanged.dispatch();
 		this.editor.signals.sceneGraphChanged.dispatch();
 
 
 	}
 	}
@@ -63,6 +66,9 @@ class MoveObjectCommand extends Command {
 		this.object.parent = this.oldParent;
 		this.object.parent = this.oldParent;
 
 
 		this.object.dispatchEvent( { type: 'added' } );
 		this.object.dispatchEvent( { type: 'added' } );
+		this.editor.signals.objectChanged.dispatch( this.object );
+		this.editor.signals.objectChanged.dispatch( this.newParent );
+		this.editor.signals.objectChanged.dispatch( this.oldParent );
 		this.editor.signals.sceneGraphChanged.dispatch();
 		this.editor.signals.sceneGraphChanged.dispatch();
 
 
 	}
 	}

粤ICP备19079148号