浏览代码

JSM: Added ColladaExporter to modularize.js

Mugen87 6 年之前
父节点
当前提交
c79185be19
共有 3 个文件被更改,包括 12 次插入6 次删除
  1. 5 3
      examples/js/exporters/ColladaExporter.js
  2. 6 3
      examples/jsm/exporters/ColladaExporter.js
  3. 1 0
      utils/modularize.js

+ 5 - 3
examples/js/exporters/ColladaExporter.js

@@ -17,7 +17,9 @@ THREE.ColladaExporter.prototype = {
 
 
 	constructor: THREE.ColladaExporter,
 	constructor: THREE.ColladaExporter,
 
 
-	parse: function ( object, onDone, options = {} ) {
+	parse: function ( object, onDone, options ) {
+
+		options = options || {};
 
 
 		options = Object.assign( {
 		options = Object.assign( {
 			version: '1.4.1',
 			version: '1.4.1',
@@ -377,7 +379,7 @@ THREE.ColladaExporter.prototype = {
 				var reflectivity = m.reflectivity || 0;
 				var reflectivity = m.reflectivity || 0;
 
 
 				// Do not export and alpha map for the reasons mentioned in issue (#13792)
 				// Do not export and alpha map for the reasons mentioned in issue (#13792)
-				// in THREE.js alpha maps are black and white, but collada expects the alpha
+				// in three.js alpha maps are black and white, but collada expects the alpha
 				// channel to specify the transparency
 				// channel to specify the transparency
 				var transparencyNode = '';
 				var transparencyNode = '';
 				if ( m.transparent === true ) {
 				if ( m.transparent === true ) {
@@ -586,7 +588,7 @@ THREE.ColladaExporter.prototype = {
 			'<asset>' +
 			'<asset>' +
 			(
 			(
 				'<contributor>' +
 				'<contributor>' +
-				'<authoring_tool>THREE.js Collada Exporter</authoring_tool>' +
+				'<authoring_tool>three.js Collada Exporter</authoring_tool>' +
 				( options.author !== null ? `<author>${ options.author }</author>` : '' ) +
 				( options.author !== null ? `<author>${ options.author }</author>` : '' ) +
 				'</contributor>' +
 				'</contributor>' +
 				`<created>${ ( new Date() ).toISOString() }</created>` +
 				`<created>${ ( new Date() ).toISOString() }</created>` +

+ 6 - 3
examples/jsm/exporters/ColladaExporter.js

@@ -28,7 +28,9 @@ ColladaExporter.prototype = {
 
 
 	constructor: ColladaExporter,
 	constructor: ColladaExporter,
 
 
-	parse: function ( object, onDone, options = {} ) {
+	parse: function ( object, onDone, options ) {
+
+		options = options || {};
 
 
 		options = Object.assign( {
 		options = Object.assign( {
 			version: '1.4.1',
 			version: '1.4.1',
@@ -388,7 +390,7 @@ ColladaExporter.prototype = {
 				var reflectivity = m.reflectivity || 0;
 				var reflectivity = m.reflectivity || 0;
 
 
 				// Do not export and alpha map for the reasons mentioned in issue (#13792)
 				// Do not export and alpha map for the reasons mentioned in issue (#13792)
-				// in THREE.js alpha maps are black and white, but collada expects the alpha
+				// in three.js alpha maps are black and white, but collada expects the alpha
 				// channel to specify the transparency
 				// channel to specify the transparency
 				var transparencyNode = '';
 				var transparencyNode = '';
 				if ( m.transparent === true ) {
 				if ( m.transparent === true ) {
@@ -536,6 +538,7 @@ ColladaExporter.prototype = {
 				// the materials.
 				// the materials.
 				var mat = o.material || new MeshBasicMaterial();
 				var mat = o.material || new MeshBasicMaterial();
 				var materials = Array.isArray( mat ) ? mat : [ mat ];
 				var materials = Array.isArray( mat ) ? mat : [ mat ];
+
 				if ( geometry.groups.length > materials.length ) {
 				if ( geometry.groups.length > materials.length ) {
 
 
 					matidsArray = new Array( geometry.groups.length );
 					matidsArray = new Array( geometry.groups.length );
@@ -596,7 +599,7 @@ ColladaExporter.prototype = {
 			'<asset>' +
 			'<asset>' +
 			(
 			(
 				'<contributor>' +
 				'<contributor>' +
-				'<authoring_tool>THREE.js Collada Exporter</authoring_tool>' +
+				'<authoring_tool>three.js Collada Exporter</authoring_tool>' +
 				( options.author !== null ? `<author>${ options.author }</author>` : '' ) +
 				( options.author !== null ? `<author>${ options.author }</author>` : '' ) +
 				'</contributor>' +
 				'</contributor>' +
 				`<created>${ ( new Date() ).toISOString() }</created>` +
 				`<created>${ ( new Date() ).toISOString() }</created>` +

+ 1 - 0
utils/modularize.js

@@ -40,6 +40,7 @@ var files = [
 	{ path: 'effects/PeppersGhostEffect.js', dependencies: [], ignoreList: [] },
 	{ path: 'effects/PeppersGhostEffect.js', dependencies: [], ignoreList: [] },
 	{ path: 'effects/StereoEffect.js', dependencies: [], ignoreList: [] },
 	{ path: 'effects/StereoEffect.js', dependencies: [], ignoreList: [] },
 
 
+	{ path: 'exporters/ColladaExporter.js', dependencies: [], ignoreList: [] },
 	{ path: 'exporters/GLTFExporter.js', dependencies: [], ignoreList: [ 'AnimationClip', 'Camera', 'Geometry', 'Material', 'Mesh', 'Object3D', 'RGBFormat', 'Scenes', 'ShaderMaterial', 'VertexColors' ] },
 	{ path: 'exporters/GLTFExporter.js', dependencies: [], ignoreList: [ 'AnimationClip', 'Camera', 'Geometry', 'Material', 'Mesh', 'Object3D', 'RGBFormat', 'Scenes', 'ShaderMaterial', 'VertexColors' ] },
 	{ path: 'exporters/MMDExporter.js', dependencies: [], ignoreList: [] },
 	{ path: 'exporters/MMDExporter.js', dependencies: [], ignoreList: [] },
 	{ path: 'exporters/OBJExporter.js', dependencies: [], ignoreList: [] },
 	{ path: 'exporters/OBJExporter.js', dependencies: [], ignoreList: [] },