|
@@ -1898,13 +1898,21 @@ THREE.GLTFLoader = ( function () {
|
|
|
|
|
|
} );
|
|
|
|
|
|
- Promise.all( [
|
|
|
+ Promise.all( this._invokeAll( function ( ext ) {
|
|
|
|
|
|
- this.getDependencies( 'scene' ),
|
|
|
- this.getDependencies( 'animation' ),
|
|
|
- this.getDependencies( 'camera' ),
|
|
|
+ return ext.beforeRoot && ext.beforeRoot();
|
|
|
|
|
|
- ] ).then( function ( dependencies ) {
|
|
|
+ } ) ).then( function () {
|
|
|
+
|
|
|
+ return Promise.all( [
|
|
|
+
|
|
|
+ parser.getDependencies( 'scene' ),
|
|
|
+ parser.getDependencies( 'animation' ),
|
|
|
+ parser.getDependencies( 'camera' ),
|
|
|
+
|
|
|
+ ] );
|
|
|
+
|
|
|
+ } ).then( function ( dependencies ) {
|
|
|
|
|
|
var result = {
|
|
|
scene: dependencies[ 0 ][ json.scene || 0 ],
|
|
@@ -1920,7 +1928,15 @@ THREE.GLTFLoader = ( function () {
|
|
|
|
|
|
assignExtrasToUserData( result, json );
|
|
|
|
|
|
- onLoad( result );
|
|
|
+ Promise.all( parser._invokeAll( function ( ext ) {
|
|
|
+
|
|
|
+ return ext.afterRoot && ext.afterRoot( result );
|
|
|
+
|
|
|
+ } ) ).then( function () {
|
|
|
+
|
|
|
+ onLoad( result );
|
|
|
+
|
|
|
+ } );
|
|
|
|
|
|
} ).catch( onError );
|
|
|
|