Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation Method only available for loading from file #154

Open
famda opened this issue Oct 16, 2022 · 6 comments
Open

Validation Method only available for loading from file #154

famda opened this issue Oct 16, 2022 · 6 comments
Labels
enhancement New feature or request

Comments

@famda
Copy link

famda commented Oct 16, 2022

Hey,

The Validate method from ModelRoot available for models from a filePath.
Is it possible to add the same method for Stream or byte array (ParseGLB and ReadGLB)?

Thanks in advance.

@vpenades
Copy link
Owner

these methods already have a ReadSettings argument, you can call:

ParseGLB( bytes, ValidationMode.Strict);
ReadGLB( stream, ValidationMode.Strict);

@famda
Copy link
Author

famda commented Oct 17, 2022

That's true but you can't validate before you read it.
When you read it from file you can check before and select the option (strick, tryfix, skip) based on the validation errors.

On those methods it's a try catch experience and I can't know what is happening with the GLB (there's no way to see why it's failing).

I have a bunch of glb's that have assessors out of bounds. To fix it, I just need to update bounds of the arrays.
This is something that I can't solve without knowing the reason.

@vpenades
Copy link
Owner

vpenades commented Oct 17, 2022

you can create an instance of ReadContext.CreateFromFile and then call Validate(fileName)

@famda
Copy link
Author

famda commented Oct 17, 2022

I actually tried but that method accepts a string.
If you have a stream or a byte array, what would you pass to it? There's no filename in that case.

@vpenades
Copy link
Owner

I'll review the code to see if there's a path through... it'll take some time

@famda
Copy link
Author

famda commented Oct 17, 2022

Thanks. 😉

@vpenades vpenades added the enhancement New feature or request label Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants