jupyter-widgets / pythreejs

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

Not all threejs properties get synced to backend #173

Closed maartenbreddels closed 6 years ago

maartenbreddels commented 6 years ago

From the js console i do:

camera.position.x = 2
camera.ipymodel.syncToModel()

But only the properties listed in propsDefinedByThree get synced to the backend:

screen shot 2018-03-29 at 14 44 38

The other way around it works without issues, I can set camera.position from the Python side, and it gets synced back.

maartenbreddels commented 6 years ago

camera.ipymodel.syncToModel(true) seems to do it, is that proper usage? Can you explain the idea behind this?

vidartf commented 6 years ago

There are some properties that are marked as set_by_three. These are the ones that get synced without the argument. This is basically an optimization to reduce the numbers of compares on changes.

vidartf commented 6 years ago

Closing as answered, feel free to comment if you disagree :)