Browse Source

Editor: Trigger rendering when animation is stopped.

Mugen87 4 years ago
parent
commit
25f683e724
3 changed files with 11 additions and 1 deletions
  1. 3 1
      editor/js/Editor.js
  2. 2 0
      editor/js/Sidebar.Animation.js
  3. 6 0
      editor/js/Viewport.js

+ 3 - 1
editor/js/Editor.js

@@ -79,7 +79,9 @@ function Editor() {
 		refreshSidebarObject3D: new Signal(),
 		historyChanged: new Signal(),
 
-		viewportCameraChanged: new Signal()
+		viewportCameraChanged: new Signal(),
+
+		animationStopped: new Signal()
 
 	};
 

+ 2 - 0
editor/js/Sidebar.Animation.js

@@ -60,6 +60,8 @@ function SidebarAnimation( editor ) {
 
 		actions[ animationsSelect.getValue() ].stop();
 
+		signals.animationStopped.dispatch();
+
 	}
 
 	function changeTimeScale() {

+ 6 - 0
editor/js/Viewport.js

@@ -511,6 +511,12 @@ function Viewport( editor ) {
 
 	} );
 
+	signals.animationStopped.add( function () {
+
+		render();
+
+	} );
+
 	// background
 
 	signals.sceneBackgroundChanged.add( function ( backgroundType, backgroundColor, backgroundTexture, backgroundEquirectangularTexture, environmentType ) {