Przeglądaj źródła

USDZLoader: Handle mesh names.

Mr.doob 2 lat temu
rodzic
commit
8938d338bc
1 zmienionych plików z 7 dodań i 0 usunięć
  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' ) ) {
 
 				const mesh = buildMesh( root[ name ] );
+
+				if ( /def Xform "(\w+)"/.test( name ) ) {
+
+					mesh.name = /def Xform "(\w+)"/.exec( name )[ 1 ];
+
+				}
+
 				group.add( mesh );
 
 			}