Selecting Using Python

   4896   4   2
User Avatar
Member
82 posts
Joined: April 2019
Offline
HI Everybody…

The new Python integration inside H9 is very nice, and I would like to
experiment with it a bit.
Currently I am trying to make a selection script in python that would
select a ring or loop after u select an edge or a face.
After going thru the shelf scripts, I can now get the currently
selected components and container in the viewer using “getGeometrySelections”
command in soptoolutils. But going to the next step, I couldn't figure
out how to select a particular point or face in the viewer or add to
the current selection using python script.

Waiting for ur answers.
iamjaideep80 (Jaideep Khadilkar)
User Avatar
Staff
1449 posts
Joined: July 2005
Offline
I may be wrong, but I am pretty sure you cannot directly manipulate selection in HOM (ie, you cannot add or remove entities such as point, face, edge, primitive to/from the selection set). But, you can select/deselect objects by setSelected() on a node.

The only thing you can manipulate is the selectors much like the soptoolutils module does. The users then use the selectors to perform the actual selection which is used by the SOP nodes (usually in the group parameter).
User Avatar
Member
1631 posts
Joined: July 2005
Offline
iamjaideep80
HI Everybody…

The new Python integration inside H9 is very nice, and I would like to
experiment with it a bit.
Currently I am trying to make a selection script in python that would
select a ring or loop after u select an edge or a face.
After going thru the shelf scripts, I can now get the currently
selected components and container in the viewer using “getGeometrySelections”
command in soptoolutils. But going to the next step, I couldn't figure
out how to select a particular point or face in the viewer or add to
the current selection using python script.

Waiting for ur answers.
I'm not sure if you just want to learn HOM but you can already select a edge or poly loop in the viewport. In the viewport, after selecting a point/edge/poly, you can hit “l” to select a partial loop or “L” to select a full loop. You can also RMB in the viewport for more options.

Cheers!
steven
User Avatar
Member
9 posts
Joined: March 2007
Offline
What about selecting an edge ring and spinning edges/faces - these are two things no modeler worth his salt can do without! Is is possible to write a Python script to add this functionality? It's hard to believe that nobody has done this already since it is so essential to a modeling workflow.
User Avatar
Member
2199 posts
Joined: July 2005
Online
Are you talking about the edgeflip sop?
The trick is finding just the right hammer for every screw
  • Quick Links