浏览代码

ColladaLoader2: Added warnings for moprh target animation

Mugen87 8 年之前
父节点
当前提交
291ab8808a
共有 2 个文件被更改,包括 18 次插入7 次删除
  1. 18 7
      examples/js/loaders/ColladaLoader2.js
  2. 0 0
      examples/models/collada/skin_and_morph.dae

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

@@ -726,6 +726,11 @@ THREE.ColladaLoader.prototype = {
 						data.skin = parseSkin( child );
 						data.skin = parseSkin( child );
 						break;
 						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 ) {
 		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;
 			return build;
 
 

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