Explorar el Código

USDZLoader: Handle mesh names.

Mr.doob hace 2 años
padre
commit
8938d338bc
Se han modificado 1 ficheros con 7 adiciones y 0 borrados
  1. 7 0
      examples/jsm/loaders/USDZLoader.js

+ 7 - 0
examples/jsm/loaders/USDZLoader.js

@@ -500,6 +500,13 @@ class USDZLoader extends Loader {
 			if ( name.startsWith( 'def Xform' ) ) {
 			if ( name.startsWith( 'def Xform' ) ) {
 
 
 				const mesh = buildMesh( root[ name ] );
 				const mesh = buildMesh( root[ name ] );
+
+				if ( /def Xform "(\w+)"/.test( name ) ) {
+
+					mesh.name = /def Xform "(\w+)"/.exec( name )[ 1 ];
+
+				}
+
 				group.add( mesh );
 				group.add( mesh );
 
 
 			}
 			}