Browse Source

USDZExporter: Fixed exporting Xforms with duplicated names.

Mr.doob 4 years ago
parent
commit
ac377cf530
1 changed files with 2 additions and 2 deletions
  1. 2 2
      examples/jsm/exporters/USDZExporter.js

+ 2 - 2
examples/jsm/exporters/USDZExporter.js

@@ -46,7 +46,7 @@ function buildHeader() {
 
 
 function buildXform( object, define ) {
 function buildXform( object, define ) {
 
 
-	const name = object.name || 'Xform1';
+	const name = 'Object' + object.id;
 	const transform = buildMatrix( object.matrixWorld );
 	const transform = buildMatrix( object.matrixWorld );
 
 
 	return `def Xform "${ name }"
 	return `def Xform "${ name }"
@@ -79,7 +79,7 @@ function buildMatrixRow( array, offset ) {
 
 
 function buildMesh( geometry, material ) {
 function buildMesh( geometry, material ) {
 
 
-	const name = geometry.name || 'Mesh1';
+	const name = 'Geometry' + geometry.id;
 	const attributes = geometry.attributes;
 	const attributes = geometry.attributes;
 	const count = attributes.position.count;
 	const count = attributes.position.count;