vpenades / SharpGLTF

glTF reader and writer for .NET Standard
MIT License
458 stars 72 forks source link

An unexpected exception was thrown while loading the model #121

Closed CeSun closed 2 years ago

CeSun commented 2 years ago

My code snippet:

using SharpGLTF.Schema2;

var model = ModelRoot.Load(@"C:\Users\xxx\Desktop\CSO2\LEET\leet_out\leet.gltf");

The model is converted from FBX format through "fbx2gltf" tool. model

This code throws an "SharpGLTF.Validation.ModelException" exception. The exception message is: "ModelRoot Must be a valid image: Png, Jpg, etc... (Parameter 'filePath') ", I load the model. Why is the exception message about the image(picture)?


I am a non-native English speaker. The above paragraphs are machine translated, and the following is the original text

以下是我的代码:

using SharpGLTF.Schema2;

var model = ModelRoot.Load(@"C:\Users\xxx\Desktop\CSO2\LEET\leet_out\leet.gltf");

我的模型是通过"fbx2gltf"工具从fbx格式转换来的,模型如图: model

代码抛出了个 "SharpGLTF.Validation.ModelException" 异常. 异常信息是 "ModelRoot Must be a valid image: Png, Jpg, etc... (Parameter 'filePath') ", 明明我加载的是模型,为什么抛出的异常信息跟图片有关?

vpenades commented 2 years ago

TGA image format is not supported by the glTF standard.

glTF supports: PNG, JPEG, DDS, WEBP and KTX2.... all other texture formats are unsupported by the standard and will produce an error.

CeSun commented 2 years ago

Oh, I see. Thank you.