Browse Source

Fix bug with loading skeleton in glTF loader

Gary Hsu 7 years ago
parent
commit
263520c6e8
1 changed files with 3 additions and 2 deletions
  1. 3 2
      loaders/src/glTF/2.0/babylon.glTFLoader.ts

+ 3 - 2
loaders/src/glTF/2.0/babylon.glTFLoader.ts

@@ -706,8 +706,9 @@ module BABYLON.GLTF2 {
             };
 
             if (skin._loaded) {
-                assignSkeleton();
-                return skin._loaded;
+                return skin._loaded.then(() => {
+                    assignSkeleton();
+                });
             }
 
             // TODO: split into two parts so that bones are created before inverseBindMatricesData is loaded (for compiling materials).