-
Notifications
You must be signed in to change notification settings - Fork 79
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
BIN and JSON cached files #115
Comments
It does already load from cached files if they exist and the |
@einarf that's totally correct, but I would like to use those streams in my application (stream of bytes and not as a file); in fact, I would like to store them in a single file with some other data; then when I read the file I would like to construct the OBJ from those streams. One way to do this is to load those |
I don't think you can fully reconstruct the obj from the bin/json file. They are mainly made so users can easily dump them into graphics memory. I do have a library overriding the cache loader that just uploads the byte streams directly to the gpu instead of reconstructing the obj itself (much faster) Cache loading triggers from this : PyWavefront/pywavefront/obj.py Lines 86 to 90 in caa2013
Loader and saver is here : https://github.com/pywavefront/PyWavefront/blob/master/pywavefront/cache.py |
What I wanted is to pass Hence, the best way to do this by allowing my application to save the cached files (BIN and JSON), same for the |
Yup. that seems reasonable. You can even replace the cache loader / saver classes here if you need more flexibility : PyWavefront/pywavefront/obj.py Lines 50 to 51 in caa2013
To make things future proof I would check the version in the json file. I had plans to extend this feature by adding pre-computed bounding boxes for example, but that might not break compatibility. |
Thanks you for the heads up! I don't think I need to do this now, but maybe later. to construct the object. |
I would like to read the generated
BIN
andJSON
(when cache=True) directly via simple function into a Wavefront object. That is, I would like to read these two files myself and feed them to Wavefront constructor. I wonder if this can be done via some auxiliary function?The text was updated successfully, but these errors were encountered: