Skip to content

Commit

Permalink
fix gltf animations lose
Browse files Browse the repository at this point in the history
  • Loading branch information
king2088 committed Sep 12, 2023
1 parent 1bb60c5 commit a9564d8
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/vue-3d-loader.cjs.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions dist/vue-3d-loader.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -40688,6 +40688,9 @@ function getLoader(filePath, fileType, isDraco, dracoDir) {
loader: new GLTFLoader(manager),
getObject: (gltf) => {
const object = gltf.scene;
if (gltf.animations) {
object.animations = gltf.animations;
}
return object;
}
};
Expand Down
2 changes: 1 addition & 1 deletion dist/vue-3d-loader.global.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vue-3d-loader",
"private": false,
"version": "2.1.1",
"version": "2.1.2",
"main": "dist/vue-3d-loader.cjs.js",
"module": "dist/vue-3d-loader.esm.js",
"types": "dist/types/index.d.ts",
Expand Down
4 changes: 4 additions & 0 deletions src/3dLoader/loadModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ function getLoader(filePath: string, fileType: string, isDraco: boolean, dracoDi
loader: new GLTFLoader(manager),
getObject: (gltf: any) => {
const object = gltf.scene
// resolve gltf animations lose
if (gltf.animations) {
object.animations = gltf.animations;
}
return object;
},
};
Expand Down

0 comments on commit a9564d8

Please sign in to comment.