grouping based on point's IDs

   12048   11   2
User Avatar
Member
277 posts
Joined: July 2006
Offline
Hi, I am wondering if when I'm creating a group of selected points ths group is “remembering” only the numbers of selected points.
When I've got particle simulation and particles are dying, then particle numbers are changing and the IDs are the same. So when I select group I want to delete it simply doesn't work.

Is there any simple method to group BY IDs NOT BY NUMBERS?

(i found video about hscripts in which lector was selecting points, locking selection, blasting another points and with help of foreach node was making looong expression - which ids should be deleted … then he used this expression to delete by expression points. is it the only method?)

Thank you
User Avatar
Member
648 posts
Joined: July 2005
Offline
clumsy double-handling.
use a point() expression in an attribute_create sop to get at the ID.
Then use an expression in the delete sop that uses the attribute.

sops should use persistent IDs by default, but they don't.
User Avatar
Member
277 posts
Joined: July 2006
Offline
Thank you , but I've got additional question too:

cpb
use a point() expression in an attribute_create sop to get at the ID.
What expression should it be? (best in python)
(I've got LOCKED node with selected particles, I want to delete, -> delete everything appart from points -> attrib_create .. and which expression?)

cpb
sops should use persistent IDs by default, but they don't.
I think so too.
User Avatar
Member
7734 posts
Joined: July 2005
Online
cpb
use a point() expression in an attribute_create sop to get at the ID. Then use an expression in the delete sop that uses the attribute

Or, just use the point() expression in the Delete SOP.
User Avatar
Member
277 posts
Joined: July 2006
Offline
Thank you, but how to use this point expression to convert to ID's only these points, which was SELECTED PREVIOUSLY IN VIEWPORT (in other node)?
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
If all you need to do is select a few points by an attribute, say id, you can do this directly in the Group parameter field using this syntax:

@id=1

To select three:

@id=1 @id=2 @id=3
There's at least one school like the old school!
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
I submitted an RFE to allow ranges like @name=10-100.

Wildcards are supported with strings though:
@name=foo.*
There's at least one school like the old school!
User Avatar
Member
277 posts
Joined: July 2006
Offline
jeff
you can do this directly in the Group parameter field using this syntax:

@id=1

Yes I know it. The problem appears when I want to delete 10 000 000 particles, which id's are not “one after another” - they're misched (f.e. 1,50, 900 , 901, 905, 1140, … etc)
Writing it “by hand” is impossible.
What to do in this situation - I can simply select them in viewport and then … ?
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
I wrote an hscript .cmd script that will replace point numbers with id's if they are present.
Obviously this script has to be run on the same frame you made your point selection or else it won't work as points can come and go while id's are persistent.

You can put this script in your $HOME/houdini10/scripts directory and then in a textport type:

source pointlist_to_id.cmd /obj/my_object/my_blast_sop

which will turn your point list in to a list of @id= string.

You can incorporate this in to a callback button on an HDA, add to the RMB menu for one or more SOPs, put it on the shelf to work on a point selection specifically, etc. The guts are there for you.
I use hscript because it is a bit faster and I know that pointpattern() works to exapnd the string and don't know if there is a HOM equivalent as of yet.


I can see this being useful if you wanted to knock out a few thousand particles but 10 million? I think you should be using a point group for that or try a different approach.

Attachments:
pointlist_to_id.cmd.zip (781 bytes)

There's at least one school like the old school!
User Avatar
Member
277 posts
Joined: July 2006
Offline
Thank you jeff very much!! sorry for that 10 milion particles - I've written this to show that I can't simply write manually all of them ;] Thank you again
This script is really very usefull!
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
Great to see that it works for you.

Btw, it was that 10 000 000 comment that got me motivated.
There's at least one school like the old school!
User Avatar
Member
277 posts
Joined: July 2006
Offline
Thank you Jeff I'm really very grateful for your script
I will not say nothing about 10 000 000 again ;P
  • Quick Links