検索 - User list
Full Version: Viewer State: Set Solaris viewport selection via Python
Root » Solaris and Karma » Viewer State: Set Solaris viewport selection via Python
blented
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
malexander
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.
blented
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
blented
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.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB