vpenades / SharpGLTF

glTF reader and writer for .NET Standard
MIT License
476 stars 75 forks source link

[BUG]ValidationMode.Skip not working? #149

Closed hjlld closed 2 years ago

hjlld commented 2 years ago

I have a gltf & bin with draco compression, which is passed the validation from https://github.khronos.org/glTF-Validator.

I know that SharpGLTF doesn't support draco compression right now, but I don't need to manipulate geometry but only the material part inside the gltf text file. So I try to use ValidationMode.Skip like:

            var setting = new SharpGLTF.Schema2.ReadSettings
            {
                Validation = SharpGLTF.Validation.ValidationMode.Skip,
            };
            var scene = SharpGLTF.Schema2.ModelRoot.Load(@"E:\out\0721\gltf\\fullScene.gltf", setting );

But the Load() function still throw SharpGLTF.Validation.LinkException.

I think all gltf with draco compression shares this problem.

vpenades commented 2 years ago

See #44

ValidationMode.Skip is intended to bypass minor errors that can be commonly found in malformed glTFs.

But Draco is not a "minor error", it's an extension that completely reshapes glTF's internal architecture.

I'm afraid the only chance you have to load glTF models with draco compression is to use some external library that transforms the model into a non draco model, and then load the non draco model.

hjlld commented 2 years ago

Great library, and thank you for the very quick reply!