File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -2408,6 +2408,9 @@ class GLTFWriter {
2408
2408
2409
2409
if ( object . isSkinnedMesh ) this . skins . push ( object ) ;
2410
2410
2411
+ const nodeIndex = json . nodes . push ( nodeDef ) - 1 ;
2412
+ nodeMap . set ( object , nodeIndex ) ;
2413
+
2411
2414
if ( object . children . length > 0 ) {
2412
2415
2413
2416
const children = [ ] ;
@@ -2418,9 +2421,9 @@ class GLTFWriter {
2418
2421
2419
2422
if ( child . visible || options . onlyVisible === false ) {
2420
2423
2421
- const nodeIndex = await this . processNodeAsync ( child ) ;
2424
+ const childNodeIndex = await this . processNodeAsync ( child ) ;
2422
2425
2423
- if ( nodeIndex !== null ) children . push ( nodeIndex ) ;
2426
+ if ( childNodeIndex !== null ) children . push ( childNodeIndex ) ;
2424
2427
2425
2428
}
2426
2429
@@ -2436,8 +2439,6 @@ class GLTFWriter {
2436
2439
2437
2440
} ) ;
2438
2441
2439
- const nodeIndex = json . nodes . push ( nodeDef ) - 1 ;
2440
- nodeMap . set ( object , nodeIndex ) ;
2441
2442
return nodeIndex ;
2442
2443
2443
2444
}
You can’t perform that action at this time.
0 commit comments