1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-24 04:12:02 +08:00

gltf no animations

This commit is contained in:
RoYan 2021-12-24 14:05:53 +08:00
parent aee1719ed1
commit 447e4d9735
3 changed files with 3 additions and 2 deletions

View File

@ -9,6 +9,7 @@ export default defineComponent({
this.$emit('before-load', loader) this.$emit('before-load', loader)
loader.load(this.src, (fbx) => { loader.load(this.src, (fbx) => {
this.onLoad(fbx) this.onLoad(fbx)
this.initObject3D(fbx)
}, this.onProgress, this.onError) }, this.onProgress, this.onError)
}, },
}) })

View File

@ -8,7 +8,8 @@ export default defineComponent({
const loader = new GLTFLoader() const loader = new GLTFLoader()
this.$emit('before-load', loader) this.$emit('before-load', loader)
loader.load(this.src, (gltf) => { loader.load(this.src, (gltf) => {
this.onLoad(gltf.scene) this.onLoad(gltf)
this.initObject3D(gltf.scene)
}, this.onProgress, this.onError) }, this.onProgress, this.onError)
}, },
}) })

View File

@ -16,7 +16,6 @@ export default defineComponent({
methods: { methods: {
onLoad(model: TObject3D) { onLoad(model: TObject3D) {
this.$emit('load', model) this.$emit('load', model)
this.initObject3D(model)
}, },
onProgress(progress: ProgressEvent) { onProgress(progress: ProgressEvent) {
this.progress = progress.loaded / progress.total this.progress = progress.loaded / progress.total