Miroslav Šamánek

shamanek

About Me

3D environment generalist - www.shamanek.cz
EXPERTISE
Generalist
INDUSTRY
Film/TV

Connect

LOCATION
Prague, Czechia

Houdini Skills

Availability

I am currently employed at ILM

Recent Forum Posts

Select primitives with python in Scene Graph Tree in Solaris June 6, 2025, 5:56 a.m.

shamanek
Hi guys,

I am trying to use Python to select primitives in the Scene Graph Tree, but I am not successful.

According to the documentation here
https://www.sidefx.com/docs/houdini/hom/hou/LopNetwork.html [www.sidefx.com]
it looks like it should work.


However, for me, it is just selecting the root primitive and not the one specified.

I've tried two different methods, one based on the network and the other based on the viewer, but both work the same.
Can anyone help me with that, please?

import hou

#Get current network
viewer = hou.ui.paneTabOfType(hou.paneTabType.SceneViewer)
network = hou.ui.paneTabOfType(hou.paneTabType.NetworkEditor).pwd()

#OPTION 1
viewer.setCurrentSceneGraphSelection("/pig/geo")

#OPTION 2
network.setSelection("/pig/geo")

Ok, I figured it out. For anyone who will find it useful.

The function expects a list. So it needs to be like this

viewer.setCurrentSceneGraphSelection(["/pig/geo"])

Select primitives with python in Scene Graph Tree in Solaris May 21, 2025, 7:32 a.m.

Hi guys,

I am trying to use Python to select primitives in the Scene Graph Tree, but I am not successful.

According to the documentation here
https://www.sidefx.com/docs/houdini/hom/hou/LopNetwork.html [www.sidefx.com]
it looks like it should work.


However, for me, it is just selecting the root primitive and not the one specified.

I've tried two different methods, one based on the network and the other based on the viewer, but both work the same.
Can anyone help me with that, please?

import hou

#Get current network
viewer = hou.ui.paneTabOfType(hou.paneTabType.SceneViewer)
network = hou.ui.paneTabOfType(hou.paneTabType.NetworkEditor).pwd()

#OPTION 1
viewer.setCurrentSceneGraphSelection("/pig/geo")

#OPTION 2
network.setSelection("/pig/geo")

Switch button with python in Scene Graph Tree in Solaris 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!