SharpGLTF icon indicating copy to clipboard operation
SharpGLTF copied to clipboard

Throws exception if BIN file is not present

Open gotoarchi opened this issue 2 years ago • 1 comments

Hi! This line will throw an exception if the bin file is not present.

https://github.com/vpenades/SharpGLTF/blob/66a90e9b56a5e0a05f474f5de13465819ca6679d/src/SharpGLTF.Core/Schema2/Serialization.ReadContext.cs#L63

Is there a method to check if the dependent files are present before we load the gltf file so that we can handle it?

gotoarchi avatar Nov 04 '22 08:11 gotoarchi

You have this method:

ModelRoot.GetSatellitePaths(string modelPath);

Which returns the paths to all the resource files used by the model. That includes .Bin files and texture files.

You can call this method to gather the paths and check whether the files exist or not before proceeding to load the model

vpenades avatar Nov 04 '22 21:11 vpenades