Switch button with python in Scene Graph Tree in Solaris
497
3
1
shamanek
Member
3 posts
Joined: March 2019
Offline
Oct. 18, 2024 9:04 a.m.
Hi guys,
In Solaris viewport I am using payloads masks a lot and there is not possible to bind that to a shortcut so I was wondering that maybe, I could write a simple script that does that.
I am talking about this toggle:
However, I am struggling a lot to make it work. It's not documented much but I believe it is this class that should do it. But how to use that? Does anyone know, please?
https://www.sidefx.com/docs/houdini/hom/hou/LopViewportLoadMasks.html [
www.sidefx.com ]
I've tried to do this but it gives me nothing. Not even an error.
hou . LopViewportLoadMasks () . setPopulateAll ()
Attachments:
populatePrimitives.png (44.7 KB)
shamanek
Member
3 posts
Joined: March 2019
Offline
Oct. 18, 2024 9:56 p.m.
Also, I’ve tried to do this
hou . LopViewportLoadMasks () . dumps ()
which gives me information about the scene but it’s not true. It stays the same no matter what I change in the scene graph tree (primitives visibility).
Am I missing something here? Maybe a connection to the lop stage? Looks like the script returns just some default values.
alexwheezy
Member
318 posts
Joined: Jan. 2013
Offline
Oct. 19, 2024 3:49 a.m.
You also need to apply the changes to the current viewport.
network = hou . ui . paneTabOfType ( hou . paneTabType . NetworkEditor ) . pwd ()
load_masks = network . viewportLoadMasks ()
load_masks . setPopulateAll ( False )
network . setViewportLoadMasks ( load_masks )
shamanek
Member
3 posts
Joined: March 2019
Offline
Oct. 19, 2024 9 a.m.
alexwheezy You also need to apply the changes to the current viewport.network = hou . ui . paneTabOfType ( hou . paneTabType . NetworkEditor ) . pwd ()
load_masks = network . viewportLoadMasks ()
load_masks . setPopulateAll ( False )
network . setViewportLoadMasks ( load_masks )
Interesting, awesome! That works great. Thanks a lot, alexwheezy, for your help!
Edited by shamanek - Oct. 19, 2024 09:09:22