meshcat-dev / meshcat

Remotely-controllable 3D viewer, built on top of three.js
MIT License
250 stars 44 forks source link

Set properties recursively #137

Closed petrikvladimir closed 5 months ago

petrikvladimir commented 1 year ago

This PR allows modifying member variables of the object, examples:

obj._set_property('material.color.b', 1)  # change only the blue channel of the color
obj1._set_property('material.color', [0, 1, 0]) # change the color of the material
obj1._set_property('material.opacity', 0.5) # change the opacity of the material

How it works:

jwnimmer-tri commented 6 months ago

Thanks for your interest!

We recently did something similar in https://github.com/meshcat-dev/meshcat/pull/177. Please take a look and see if it helps you out.

If there's still more to be done, please rebase this onto the latest master (or open a new pull request).

If not, please let us know and we can close this PR. Thanks!

jwnimmer-tri commented 5 months ago

Closing hoping that #177 was enough. If not, feel free to re-open / open a new PR with a new take.