Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions examples/jsm/loaders/3MFLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ class ThreeMFLoader extends Loader {

}

let rootModelFile = null;

for ( file in zip ) {

if ( file.match( /\_rels\/.rels$/ ) ) {
Expand All @@ -132,9 +134,13 @@ class ThreeMFLoader extends Loader {

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?\/.*/ ) ) {

Expand All @@ -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.' );

//
Expand Down