Răsfoiți Sursa

ColladaLoader2: Added warnings for moprh target animation

Mugen87 8 ani în urmă
părinte
comite
291ab8808a

+ 18 - 7
examples/js/loaders/ColladaLoader2.js

@@ -726,6 +726,11 @@ THREE.ColladaLoader.prototype = {
 						data.skin = parseSkin( child );
 						break;
 
+					case 'morph':
+						data.id = parseId( child.getAttribute( 'source' ) );
+						console.warn( 'THREE.ColladaLoader: Morph target animation not supported yet.' );
+						break;
+
 				}
 
 			}
@@ -840,16 +845,22 @@ THREE.ColladaLoader.prototype = {
 
 		function buildController( data ) {
 
-			var build = {};
+			var build = {
+				id: data.id
+			};
 
-			build.id = data.id;
-			build.skin = buildSkin( data.skin );
+			var geometry = library.geometries[ build.id ];
 
-			// we enhance the 'sources' property of the corresponding geometry with our skin data
+			if ( data.skin !== undefined ) {
 
-			var geometry = library.geometries[ build.id ];
-			geometry.sources.skinIndices = build.skin.indices;
-			geometry.sources.skinWeights = build.skin.weights;
+				build.skin = buildSkin( data.skin );
+
+				// we enhance the 'sources' property of the corresponding geometry with our skin data
+
+				geometry.sources.skinIndices = build.skin.indices;
+				geometry.sources.skinWeights = build.skin.weights;
+
+			}
 
 			return build;
 

+ 0 - 0
examples/models/skin_and_morph.dae → examples/models/collada/skin_and_morph.dae