Viewer State: Set Solaris viewport selection via Python

   187   3   2
User Avatar
Member
41 posts
Joined: Oct. 2013
Offline
I'm not sure if this is the right section to post this in, but I'm looking to set ‘selection highlight’ or ‘selected objects’ via Python for a viewer state.

First question, is this possible? Most of the selection methods I found in the docs took Geometry as an argument, I didn't come across anything that dealt with LOPs / stages.

If it's not possible, is there another viewer state method for ‘coloring’ or ‘overlaying’ geometry that I could use instead?

Thanks for any direction you can provide, even if it's vague
User Avatar
Staff
4741 posts
Joined: July 2005
Offline
The viewport selection functions specific to Solaris have “SceneGraph” in them. So you'll want setCurrentSceneGraphSelection(), which takes a list of USD paths. There is currently no way to specify an additional highlight though.
User Avatar
Member
41 posts
Joined: Oct. 2013
Offline
Awesome, thanks for the quick reply.

Here's a link to the docs page:
https://www.sidefx.com/docs/houdini/hom/hou/SceneViewer.html [www.sidefx.com]

Inside a viewer state it's as easy as:
self.sceneViewer.setCurrentSceneGraphSelection(['/scene/toy_001'])


The selection highlight updates and also doesn't trigger an undo which is great for my use case
User Avatar
Member
41 posts
Joined: Oct. 2013
Offline
One minor issue, when I set the viewport selection via python, if I press Alt to tumble the selection highlighting disappears. If I mouse out of the viewport then back over the selection will come back. Bug? Seems to work w/ the default selection tools just not pythonically.
  • Quick Links