Hi there,
I was trying to write a script to select an object then activate a specific transform handle/mode (Rotation, set to local), but I can't seem to find a way to access the transform handles through scripting.
Can someone point me in the right direction there?
Thanks!
Pete
Can you set Transform handles (and options) through python script
1516 1 2- peteski
- Member
- 517 posts
- Joined: 12月 2013
- Offline
- HongMao
- Member
- 63 posts
- Joined: 8月 2013
- Offline
Hi Pete,
…I just found out a way to do something similar today, and yest still managed to forget how I came across the right python code to use…Sorry for the lack of clarity, therefore, but here it is:
“stateutils.findSceneViewer()” is a SceneViewer object (https://www.sidefx.com/docs/houdini/hom/hou/SceneViewer.html), hopefully (I only tried it in single-view mode; don't know if it fails when multiple viewports are open). From there all the (supported?) tool states can be invoked…For example:
…should activate the move tool…
The code runs in the python console, as works as a callback script in a spare button parameter, too…
…I just found out a way to do something similar today, and yest still managed to forget how I came across the right python code to use…Sorry for the lack of clarity, therefore, but here it is:
import stateutils stateutils.findSceneViewer()
“stateutils.findSceneViewer()” is a SceneViewer object (https://www.sidefx.com/docs/houdini/hom/hou/SceneViewer.html), hopefully (I only tried it in single-view mode; don't know if it fails when multiple viewports are open). From there all the (supported?) tool states can be invoked…For example:
stateutils.findSceneViewer().enterTranslateToolState()
…should activate the move tool…
The code runs in the python console, as works as a callback script in a spare button parameter, too…
-
- Quick Links