File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -975,6 +975,13 @@ THREE.GLTFExporter.prototype = {
975975
976976 }
977977
978+ // Skip if no exportable attributes found
979+ if ( Object . keys ( attributes ) . length === 0 ) {
980+
981+ return null ;
982+
983+ }
984+
978985 // Morph targets
979986 if ( mesh . morphTargetInfluences !== undefined && mesh . morphTargetInfluences . length > 0 ) {
980987
@@ -1107,21 +1114,16 @@ THREE.GLTFExporter.prototype = {
11071114
11081115 }
11091116
1110- // Skip meshes without exportable attributes
1111- if ( Object . keys ( primitive . attributes ) . length > 0 ) {
1117+ var material = processMaterial ( materials [ groups [ i ] . materialIndex ] ) ;
11121118
1113- var material = processMaterial ( materials [ groups [ i ] . materialIndex ] ) ;
1119+ if ( material !== null ) {
11141120
1115- if ( material !== null ) {
1116-
1117- primitive . material = material ;
1118-
1119- }
1120-
1121- primitives . push ( primitive ) ;
1121+ primitive . material = material ;
11221122
11231123 }
11241124
1125+ primitives . push ( primitive ) ;
1126+
11251127 }
11261128
11271129 if ( didForceIndices ) {
You can’t perform that action at this time.
0 commit comments