-
Notifications
You must be signed in to change notification settings - Fork 190
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
WIP: GLTF loading support #321
base: master
Are you sure you want to change the base?
Conversation
js/scripts/three-class-config.js
Outdated
GLTFAsset: { | ||
relativePath: './textures/GLTFAsset', | ||
properties: { | ||
scene: new Types.ThreeType('Scene', {use_instancedict: true}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this always produce a scene? If so, maybe this should inherit Scene
instead. It will simplify the logic a lot,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my use case it will, same with many others use cases I suspect, so could simplify it to inherit from that, and just name it GLTFScene which would simplify it to just support that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that would be my recommendation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unfortunately this also has some issues as children and other properties do not exist within python so do not have the required model id's or ipymodel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you need to interact/modify the loaded model in Python, you would probably need to implement the loader in Python. Otherwise you are likely to end up in an asynchronous mess where the Python code has to wait for the JS to do stuff and sync it back before being able to continue executing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately I need to be able interact with the scene that is loaded, so I'm fine with having python wait for a model loading, after doing some more work I have identified a few more issues
createUninitializedChildren
only works onInitializedThreeType
parameters, for something being created in JS first this should ideally be all propertiescreateUninitializedChildren
does not handle nested properties (and handling this also means handling the allow_single arrays)- (need to also verify impact)
utils.createModel
does not update theinitPromise
to include its additional setup for comms - Not all properties exist to be pushed from JS to python (e.g.
_ref_geometry
), sosyncToModel
fails because it can't useobj[propName]
on these - (need to verify) Some nested traitlets appear to fail because the widget serialization is on the container not the instance
I've managed to use the mesh and parts that get loaded and pushed from this, however I've hit some very unusual issues where the data does not exist in python until I refresh the page.
Unfortunately I need to stop working on this for the time being, so anyone feel free to take over, I may return to it in a few weeks.
Hi there! |
Initial WIP for #246
Remaining work