|
@@ -122,6 +122,8 @@ class ThreeMFLoader extends Loader {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ let rootModelFile = null;
|
|
|
|
|
+
|
|
|
for ( file in zip ) {
|
|
for ( file in zip ) {
|
|
|
|
|
|
|
|
if ( file.match( /\_rels\/.rels$/ ) ) {
|
|
if ( file.match( /\_rels\/.rels$/ ) ) {
|
|
@@ -132,9 +134,13 @@ class ThreeMFLoader extends Loader {
|
|
|
|
|
|
|
|
modelRelsName = file;
|
|
modelRelsName = file;
|
|
|
|
|
|
|
|
- } else if ( file.match( /^3D\/.*\.model$/ ) ) {
|
|
|
|
|
|
|
+ } else if ( file.match( /^3D\/[^\/]*\.model$/ ) ) {
|
|
|
|
|
+
|
|
|
|
|
+ rootModelFile = file ;
|
|
|
|
|
|
|
|
- modelPartNames.push( file );
|
|
|
|
|
|
|
+ } else if ( file.match( /^3D\/.*\/.*\.model$/ ) ) {
|
|
|
|
|
+
|
|
|
|
|
+ modelPartNames.push( file ); // sub models
|
|
|
|
|
|
|
|
} else if ( file.match( /^3D\/Textures?\/.*/ ) ) {
|
|
} else if ( file.match( /^3D\/Textures?\/.*/ ) ) {
|
|
|
|
|
|
|
@@ -144,6 +150,8 @@ class ThreeMFLoader extends Loader {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ modelPartNames.push( rootModelFile ); // push root model at the end so it is processed after the sub models
|
|
|
|
|
+
|
|
|
if ( relsName === undefined ) throw new Error( 'THREE.ThreeMFLoader: Cannot find relationship file `rels` in 3MF archive.' );
|
|
if ( relsName === undefined ) throw new Error( 'THREE.ThreeMFLoader: Cannot find relationship file `rels` in 3MF archive.' );
|
|
|
|
|
|
|
|
//
|
|
//
|