-
-
Notifications
You must be signed in to change notification settings - Fork 75
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
Separate JSON and Binary #50
Comments
First of all, keep in mind that glTF files are inherently hard to edit, specially loaded once. Then, the first part, selecting individual mesh instances is also described in issue #49, I'm already writing a unit test as an example. Finally, when you have your mesh instance as a new SceneBuilder, you can save it as glTF (json+bin) or GLB. Now, when saving to glTF (json+bin) , SharpGLTF embeds all the binary blobs into a single .BIN file when you save it to glTF, so for every gltf file, you will get a single bin file. If what you want is to write a .bin file for every vertex attribute of every mesh, right now SharpGLTF can't do that and it would require extensive reworking of the library. |
Thanks for the info. I should have probably said I was looking to create the glTF scene from a CAD application as opposed to editing existing glTF data, so I would be creating the glTF from scratch from MCAD data. I was looking to see if I could keep the Assembly files and Part files as separate glTF files where the Assembly files would contain primarily nodes with transformation information and buffers would point to external url's for the Part files that would contain geometry in a bin file. I am only just starting to learn about glTF so this sort of file separation my not even be possible on glTF as concept. It may be that every Assembly needs to be self contained and standalone with a full definition of every Part and Sub Assembly is contains, either as a single glB or as a json+bin pair. |
Looks like it has come up on the glTF board at the end of this thread |
Yes, glTF is a self contained document and cannot reference other glTFs. Think of it as a "final render" of your scene. glTF is a last mile format and although it can be used as an interchange format, it's not really well suited for it. It's like comparing an Adobe PSD document, that can contain layers, vectors, etc, and a JPG, where you get the final render, but you loose the layer information. I guess it is possible to add the referencing features with glTF extensions, but I don't think the khronos board would like to add such an extension, because it would mean drifting away from the primary purpose of glTF format. I think this answer your question, so I'll close this issue... feel free to open new ones whenever you need it! |
Is it possible to save a scene as separate files where the scene graph that defines each mesh instance is saved in single gltf JSON and each mesh vertices, normals etc. are saved in separate binary files, one for each mesh?
The text was updated successfully, but these errors were encountered: