zdimaria
Aug. 31, 2015 12:47:38
I can't seem to figure out how to take a hou.GeometrySelection, and set it as selected in a SceneViewer.
I was expecting something along the lines of sceneViewer.setSelectedGeometry(hou.GeometrySelection) but can't find anything to that end in the docs.
What is the correct way to do this?
zdimaria
Aug. 31, 2015 13:25:54
In addition to this, what type is the argument initial_selection of hou.SceneViewer.selectGeometry() looking for?
I have tried both GeometrySelection and but it returns a TypeError.
mtucker
Aug. 31, 2015 14:03:13
There is no function to set the selection in a SceneViewer because it is only when in a select state that setting a selection makes any sense. So the closest you can come is to use the initial_selection argument when you call selectGeometry (which puts the viewer in a select state, and sets the selection within that select state). The initial_selection argument is a string which can be anything supported by a SOP Group parameter. Or equivalently, any string returned from GeometrySelection.selectionStrings (but only one string - passing an array of initial selection strings is not supported).
Also keep your eyes open for changes and improvements coming in this area in the upcoming release.
Hope that helps,
Mark
zdimaria
Aug. 31, 2015 14:51:01
Thanks Mark, this helps a lot.