jupyter-widgets / pythreejs

A Jupyter - Three.js bridge
https://pythreejs.readthedocs.io
Other
936 stars 187 forks source link

verticesNeedUpdate #234

Closed jacksonloper closed 5 years ago

jacksonloper commented 5 years ago

I think Geometry objects should have a boolean trait

verticesNeedUpdate

so that if we update a geometry we can tell threejs to update everything's placement. As is I don't see a way to update the vertices of a Geometry object. Thanks!

vidartf commented 5 years ago

I think this line should handle that. It is something that we should get for free since Widgets are event based. However, note that python containers are not eventful, so to update the vertices you cannot modify the vertices in-place! You need to create a copy, modify that copy, and then assign the copy back to the widget. It is a common issue across widgets unfortunately.

vidartf commented 5 years ago

Closing due to lack of feedback. I will reopen if there is some additional points here, though!