Explorar el Código

Merge pull request #15846 from mrdoob/editor

Editor: Added animation support for dae files.
Mr.doob hace 6 años
padre
commit
f3c609f8bf
Se han modificado 3 ficheros con 8 adiciones y 3 borrados
  1. 5 1
      editor/js/Editor.js
  2. 1 0
      editor/js/Loader.js
  3. 2 2
      examples/js/loaders/ColladaLoader.js

+ 5 - 1
editor/js/Editor.js

@@ -244,7 +244,11 @@ Editor.prototype = {
 
 	addAnimation: function ( object, animations ) {
 
-		this.animations[ object.uuid ] = animations;
+		if ( animations.length > 0 ) {
+
+			this.animations[ object.uuid ] = animations;
+
+		}
 
 	},
 

+ 1 - 0
editor/js/Loader.js

@@ -180,6 +180,7 @@ var Loader = function ( editor ) {
 
 					collada.scene.name = filename;
 
+					editor.addAnimation( collada.scene, collada.animations );
 					editor.execute( new AddObjectCommand( collada.scene ) );
 
 				}, false );

+ 2 - 2
examples/js/loaders/ColladaLoader.js

@@ -1506,7 +1506,7 @@ THREE.ColladaLoader.prototype = {
 
 			}
 
-			material.name = data.name;
+			material.name = data.name || '';
 
 			function getTexture( textureObject ) {
 
@@ -1834,7 +1834,7 @@ THREE.ColladaLoader.prototype = {
 
 			}
 
-			camera.name = data.name;
+			camera.name = data.name || '';
 
 			return camera;