Select by @id in SOP group param

   485   3   0
User Avatar
Member
33 posts
Joined: July 2013
Offline
hi,
When you select a Group using a Transform (SOP) with the mouse, the group selection is based on @ptnum.
However, when you have a large number of particles in a particle simulation, you often want to reduce them to 70% using delete (SOP), and sometimes you want to reduce it to 65%.
And if you don't approve the position of some of the points, you might shift them slightly using a Transform (SOP).
In that case, you'll regret reducing the group with delete (SOP) earlier. This is because when the percentage of increase or decrease changes, the points selected by the Transform (SOP) shift to other points.
Therefore, I think it would be better if this were selected based on @id. This isn't limited to particles; it applies everywhere.
For example, you can create a Python tool like this. It's easy.

/A script tool to convert the @ptnum group of an SOP to selection by @id
//group:24,33 -> group :@id=34 @id=22
node = hou.selectedNodes()[0]
geo = node.geometry()
id_list = [f"@id={p.attribValue('id')}" for p in geo.globPoints(node.parm('group').eval())]
node.parm('group').set(" ".join(id_list))

But it's a lot of trouble, and I wonder if there's a better way.

thanks
Edited by Noboru Saka - July 29, 2026 02:15:27
User Avatar
Member
9721 posts
Joined: July 2007
Offline
in Viewport Select state, press 9 to turn on Select Group mode, then Gear menu and pick Attributes/Id
then select some points in the viewport, press Enter and it will fill your Group parm with @id=1,22,33 etc..
same for any int or string attribute like @name, @path, ...

Attachments:
Screenshot 2026-07-29 094809.png (161.0 KB)

Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
35 posts
Joined: Jan. 2016
Offline
The selection is not based on ids by default because id is not an intrinsic or required attribute, you won't always have it. The cleanest way I'd say is to create a point group with a Group SOP using "Keep by Random Chance" parameters that does accept seed attributes like id. Then you delete the group with a Blast SOP.
User Avatar
Member
33 posts
Joined: July 2013
Offline
using Select Group mode, i have got a group expressed by @id. great tips.
thanks
  • Quick Links