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

Use glTFLib as a backend #26

Merged
merged 13 commits into from
Feb 14, 2021
Merged

Use glTFLib as a backend #26

merged 13 commits into from
Feb 14, 2021

Conversation

jrz371
Copy link
Collaborator

@jrz371 jrz371 commented Jan 27, 2021

Resolves #24
Resolves #18

This is a larger PR but most was copied/modified from the old RootModel/Buffer classes. glTFLib does a good job fixing validator errors and makes the saving easier. On the other hand writing out the data isn't as clean. The code path for the binary mode vs text is a bit messier. I tried not to break any of the old features with these changes. I made two helper classes to do the conversion for objects and materials. This should make maintaining those a bit easier.

I also did some changes for #22. You can have multiple binary chunks talked about here in the spec but it doesn't fix the alignment issue. I got around those errors by just using zero padding. This keeps everything 4 byte aligned and the validator from complaining. That same section in the spec says to do this.

Copy link
Collaborator

@Doerge Doerge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice PR!
I still need to test it, but here are some comments on the code to start with. Let me know what you think.

glTF-BinExporter/RhinoDocGltfConverter.cs Show resolved Hide resolved
glTF-BinExporter/RhinoDocGltfConverter.cs Show resolved Hide resolved
glTF-BinExporter/RhinoDocGltfConverter.cs Outdated Show resolved Hide resolved
glTF-BinExporter/RhinoDocGltfConverter.cs Show resolved Hide resolved
glTF-BinExporter/RhinoDocGltfConverter.cs Show resolved Hide resolved
glTF-BinExporter/RhinoDocGltfConverter.cs Show resolved Hide resolved
glTF-BinExporter/RhinoDocGltfConverter.cs Show resolved Hide resolved
glTF-BinExporter/RhinoDocGltfConverter.cs Outdated Show resolved Hide resolved
@Doerge Doerge merged commit add08ca into Stykka:master Feb 14, 2021
@Doerge
Copy link
Collaborator

Doerge commented Feb 14, 2021

I opened a small PR against the Khronos repo to get it to work on OS X, but then I also got it working here.
Very nice job with this PR, this is amazing! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use glTFLib as a backend Save object and material names
2 participants