diff --git a/examples/jsm/loaders/GLTFLoader.js b/examples/jsm/loaders/GLTFLoader.js index 8994da563eec28..916046a92927a1 100644 --- a/examples/jsm/loaders/GLTFLoader.js +++ b/examples/jsm/loaders/GLTFLoader.js @@ -578,6 +578,14 @@ class GLTFLightsExtension { } + getDependency( type, index ) { + + if ( type !== 'light' ) return; + + return this._loadLight( index ); + + } + createNodeAttachment( nodeIndex ) { const self = this; @@ -2751,7 +2759,19 @@ class GLTFParser { break; default: - throw new Error( 'Unknown type: ' + type ); + dependency = this._invokeOne( function ( ext ) { + + return ext != this && ext.getDependency && ext.getDependency( type, index ); + + } ); + + if ( ! dependency ) { + + throw new Error( 'Unknown type: ' + type ); + + } + + break; }