Browse Source

ColladaExporter: Clean up.

Mr.doob 5 năm trước cách đây
mục cha
commit
30f511b6ff

+ 9 - 0
examples/js/exporters/ColladaExporter.js

@@ -254,6 +254,15 @@ THREE.ColladaExporter.prototype = {
 
 				}
 
+				// serialize lightmap uvs
+				if ( 'uv2' in bufferGeometry.attributes ) {
+
+					var uvName = `${ meshid }-texcoord2`;
+					gnode += getAttribute( bufferGeometry.attributes.uv2, uvName, [ 'S', 'T' ], 'float' );
+					triangleInputs += `<input semantic="TEXCOORD" source="#${ uvName }" offset="0" set="1" />`;
+
+				}
+
 				// serialize colors
 				if ( 'color' in bufferGeometry.attributes ) {
 

+ 4 - 2
examples/jsm/exporters/ColladaExporter.js

@@ -264,12 +264,14 @@ ColladaExporter.prototype = {
 					triangleInputs += `<input semantic="TEXCOORD" source="#${ uvName }" offset="0" set="0" />`;
 
 				}
-				
+
 				// serialize lightmap uvs
 				if ( 'uv2' in bufferGeometry.attributes ) {
+
 					var uvName = `${ meshid }-texcoord2`;
 					gnode += getAttribute( bufferGeometry.attributes.uv2, uvName, [ 'S', 'T' ], 'float' );
 					triangleInputs += `<input semantic="TEXCOORD" source="#${ uvName }" offset="0" set="1" />`;
+
 				}
 
 				// serialize colors
@@ -280,7 +282,7 @@ ColladaExporter.prototype = {
 					triangleInputs += `<input semantic="COLOR" source="#${ colName }" offset="0" />`;
 
 				}
-				
+
 				var indexArray = null;
 				if ( bufferGeometry.index ) {