Преглед на файлове

Viewport.js: fix orphaned object

Make sure that any objects being removed from the scene are also detached from the transformControls before the next render pass.
Yugloocamai преди 7 години
родител
ревизия
6399885292
променени са 1 файла, в които са добавени 4 реда и са изтрити 0 реда
  1. 4 0
      editor/js/Viewport.js

+ 4 - 0
editor/js/Viewport.js

@@ -410,6 +410,10 @@ var Viewport = function ( editor ) {
 	} );
 	} );
 
 
 	signals.objectRemoved.add( function ( object ) {
 	signals.objectRemoved.add( function ( object ) {
+		
+		if(object === transformControls.object){
+			transformControls.detach();
+		}
 
 
 		object.traverse( function ( child ) {
 		object.traverse( function ( child ) {