Hello all.
Im redoing my group/shading tool from SOPs to LOPs and i would like to know, if there is a way how to toggle Active, Visible, Solo icons inside the Scene Graph Tree with python?
How to set Active, Visible, Solo in SceneGraph with python
2682 5 4-
- martinkindl83
- Member
- 287 posts
- Joined: Nov. 2014
- Offline
-
- mtucker
- Staff
- 4565 posts
- Joined: July 2005
- Offline
Yes. Have a look at this help page: https://www.sidefx.com/docs/houdini/hom/hou/LopViewportOverrides.html [www.sidefx.com]
-
- martinkindl83
- Member
- 287 posts
- Joined: Nov. 2014
- Offline
-
- mtucker
- Staff
- 4565 posts
- Joined: July 2005
- Offline
Yu have to create and use a LopViewportOverrides object in a python `with` block, like this (assuuming you first drop a Torus node in /stage):
lopnet = hou.node("/stage") with lopnet.viewportOverrides(lopnet.node("torus1")) as overrides: selrule = hou.LopSelectionRule() selrule.setPathPattern("/torus1") overrides.setVisible(selrule, False)
-
- martinkindl83
- Member
- 287 posts
- Joined: Nov. 2014
- Offline
-
- eikonoklastes
- Member
- 447 posts
- Joined: April 2018
- Offline
mtuckerHi,
Yu have to create and use a LopViewportOverrides object in a python `with` block, like this (assuuming you first drop a Torus node in /stage):lopnet = hou.node("/stage") with lopnet.viewportOverrides(lopnet.node("torus1")) as overrides: selrule = hou.LopSelectionRule() selrule.setPathPattern("/torus1") overrides.setVisible(selrule, False)
I have a few questions about this:
- Why does the viewportOverrides function take a LOP node as an argument instead of a stage object or a prim? Viewport Overrides apply to prims, not LOP nodes. If the purpose is to get the stage of the current node, I'm thoroughly confused as to why you cannot just supply the stage.
- Why do we need to use a with statement along with a selection rule? Why can't we directly set the override on a prim?
- How do we get/query the state of an override? For the life of me, I cannot find any documentation on how to get the visibility override (for example) of a prim, and this is literally the only example I have found on how to set it.
Please and thank you.
Edited by eikonoklastes - May 3, 2025 07:27:16
-
- Quick Links


