|
@@ -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>` +
|