Switch button with python in Scene Graph Tree in Solaris

   496   3   1
User Avatar
Member
3 posts
Joined: March 2019
Offline
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)

User Avatar
Member
3 posts
Joined: March 2019
Offline
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.
User Avatar
Member
318 posts
Joined: Jan. 2013
Offline
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)
User Avatar
Member
3 posts
Joined: March 2019
Offline
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
  • Quick Links