diff --git a/src/models/FBX.ts b/src/models/FBX.ts index 80f2f0f..2886940 100644 --- a/src/models/FBX.ts +++ b/src/models/FBX.ts @@ -6,6 +6,7 @@ export default defineComponent({ extends: Model, created() { const loader = new FBXLoader() + this.$emit('before-load', loader) loader.load(this.src, (fbx) => { this.onLoad(fbx) }, this.onProgress, this.onError) diff --git a/src/models/GLTF.ts b/src/models/GLTF.ts index 915f160..dde37cc 100644 --- a/src/models/GLTF.ts +++ b/src/models/GLTF.ts @@ -6,6 +6,7 @@ export default defineComponent({ extends: Model, created() { const loader = new GLTFLoader() + this.$emit('before-load', loader) loader.load(this.src, (gltf) => { this.onLoad(gltf.scene) }, this.onProgress, this.onError) diff --git a/src/models/Model.ts b/src/models/Model.ts index d3af39d..a37dfa3 100644 --- a/src/models/Model.ts +++ b/src/models/Model.ts @@ -4,7 +4,7 @@ import Object3D from '../core/Object3D' export default defineComponent({ extends: Object3D, - emits: ['load', 'progress', 'error'], + emits: ['load', 'progress', 'error', 'before-load'], props: { src: { type: String, required: true }, },