Skip to content

Commit

Permalink
chore: cherry pick #1647
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuxudong committed Jul 24, 2023
1 parent 1dd7b1b commit 8896225
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/loader/src/GLTFLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class GLTFLoader extends Loader<GLTFResource> {
masterPromiseInfo.resolve(glTFResource);
})
.catch((e) => {
const msg = `Error loading glTF model from ${url} .`;
const msg = `Error loading glTF model from ${url} : ${e}`;
Logger.error(msg);
masterPromiseInfo.reject(msg);
context.defaultSceneRootPromiseInfo.reject(e);
Expand Down
2 changes: 1 addition & 1 deletion packages/loader/src/gltf/parser/GLTFAnimationParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export class GLTFAnimationParser extends GLTFParser {
}
}

parse(context: GLTFParserContext): AssetPromise<AnimationClip[]> {
parse(context: GLTFParserContext): AssetPromise<AnimationClip[]> | void {
const { glTF, glTFResource } = context;
const { entities } = glTFResource;
const { animations, accessors, bufferViews } = glTF;
Expand Down
2 changes: 1 addition & 1 deletion packages/loader/src/gltf/parser/GLTFMeshParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export class GLTFMeshParser extends GLTFParser {
return Promise.all(promises);
}

parse(context: GLTFParserContext) {
parse(context: GLTFParserContext): AssetPromise<ModelMesh[][]> | void {
const { glTF, glTFResource } = context;
const { engine } = glTFResource;
if (!glTF.meshes) return;
Expand Down
3 changes: 2 additions & 1 deletion packages/loader/src/gltf/parser/GLTFSceneParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
AnimatorController,
AnimatorControllerLayer,
AnimatorStateMachine,
AssetPromise,
BlinnPhongMaterial,
Camera,
Engine,
Expand All @@ -26,7 +27,7 @@ export class GLTFSceneParser extends GLTFParser {
return GLTFSceneParser._defaultMaterial;
}

parse(context: GLTFParserContext) {
parse(context: GLTFParserContext): AssetPromise<Entity> | void {
const { glTFResource, glTF } = context;
const { entities } = glTFResource;
const { nodes, cameras } = glTF;
Expand Down
2 changes: 1 addition & 1 deletion packages/loader/src/gltf/parser/GLTFTextureParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class GLTFTextureParser extends GLTFParser {
[GLTFTextureWrapMode.REPEAT]: TextureWrapMode.Repeat
};

parse(context: GLTFParserContext): AssetPromise<Texture2D[]> {
parse(context: GLTFParserContext): AssetPromise<Texture2D[]> | void {
const { glTFResource, glTF } = context;
const { engine, url } = glTFResource;

Expand Down

0 comments on commit 8896225

Please sign in to comment.