-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[Fix] GltfExporter correctly exports buffer views for non-interleaved vertex data #4699
Conversation
I am running into validation errors for a scene like this: Errors: I figured that instead of pushing a new accessor all the time, you can first check if a similiar one already exists - and use that id: The code under const compareAccessor = (a, b) => {
return a.bufferView == b.bufferView &&
a.byteOffset == b.byteOffset &&
a.componentType == b.componentType &&
a.type == b.type &&
a.count == b.count;
}
let idx = json.accessors.findIndex(_ => compareAccessor(_, accessor))
if (idx === -1) {
idx = json.accessors.push(accessor) - 1;
} That gets rid of the accessor errors, but I have no time to test more right more... accessor min/max should probably also be compared. |
@kungfooman - thanks for the feedback, I fixed both issues. |
Great work as always, I tested as far as I could and it works. Only problem I have is the texture exporting code fails in SeeMore, because of a type issue. Instead of I wanted to fix it myself, but the size of the UInt8Array just doesn't make sense to me: Apparently the texture size of that DDS is 1024x1024, but the length of the |
Thanks! Much appreciate your testing and feedback!
I added code to ignore those for now, just to avoid the crash. Can be properly handled in a separate PR there is more work on textures / materials to be done. |
Additionally, handling of unsupported textures is now handled without crashing (by ignoring them), for both gltf and usdz exporters.