Closed morgankdavis closed 9 months ago
A SEGV in getAccessorElement leads me to believe the buffers aren't loaded and the code then tries to dereference a nullptr. Are you positive you either load buffers yourself or specify Options::LoadGLBBuffers and/or Options::LoadExternalBuffers?
Otherwise, do you have any more specific information when the exception occurs?
Failing to specify any options was the issue; that also explains problems I was having loading texture data. Thank you.
I thought about this a bit over night. Would it perhaps make sense to add some sort of assert in debug mode that would have a message such as "Buffers are not loaded but required for the accessor tools" so that newer users who missed that part of the documentation that buffers and images aren't loaded by default would understand what the issue is much quicker? Or do you have any suggestions how to make this a bit more user friendly?
I think an assert would be appropriate.
See the attached test scene. pineapple_only.zip
Load and parse the scene and try to iterate over the first primitive's indicesAccessor using iterateAccessor() or iterateAccessorWithIndex(). For example:
` fastgltf::Asset& asset // exists fastgltf::Primitive& primitive // exists
`
Observe SEGV at getAccessorElementAt(), case ComponentType::UnsignedShort.
Thanks! Awesome library!