소스 검색

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 년 전
부모
커밋
5fe17b49dd
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 ) {
+		
+		if(object === transformControls.object){
+			transformControls.detach();
+		}
 
 		object.traverse( function ( child ) {