[Sidefx-houdini-list] Delete by id Python SOP

Olex P hoknamahn at gmail.com
Tue Mar 1 16:24:44 EST 2011

Probably because a proper HDK SOP will require just 5 minutes more than
inline cpp one but will give a rock solid tool instead :)
On Mar 1, 2011 7:32 PM, "Georg Duemlein" <rdg at preset.de> wrote:
> I wonder why nobody proposed an inline cpp approach yet?
> We placed an RFE while ago to get support for arbitrary attributes in a
> groupSOPs pattern field.
> On 11-02-28 9:13 PM, sgustafso at gmail.com wrote:
>> The way I like to do id kills is to develop a solid copy attribute SOP
(via hdk) that chooses source/target points by matching attributes. Then to
delete by ID, you group the points, add a marker point attribute (say,
dodelete) set to 1 for the points you want to delete, use the custom sop to
copy the marker attribute to the animated points, and then delete all points
for which the marker evals to 1. Then time shift to freeze the selection and
wrap it in an otl.
>> When you break it up like this, it becomes really easy to do arbitrary
procedural kills. Eg, select a set of points within a bounding object, and
kill them over the full range of a sim according to id.
>> The point sop can match by id when given two inputs. It kept failing to
match correctly in H10, so I had to do an hdk equivalent. But I think it
might have (hopefully) been improved for h11. So it might be worth seeing if
that's a workable solution for transferring a delete marker by ID matching.
If so, that makes this pretty easy to setup as an otl, and should scale well
to large particle sims and kill counts.
>> Sure, you /can/ do the matching in Python, but imo Python scales far too
poorly for this kind of task, especially if you're hoping to use this with
large particle sims. Throw a million particles and a kill list with 10,000
ids at it and see how well it performs. (Same goes for hscript $ID
expressions: fine for 10 or 20 kills, but try and eval the expression for
1000 unique ids!)
>>> Peter Bowmar<pbowmar at gmail.com> wrote:
>>> This is how I've done it at a few places. However, at least 5 years
>>> ago, I found it only worked up to a certain point then Houdini would
>>> crash. I was just using $ID == 5 || $ID == 123 etc populated by a
> --
> Georg Duemlein
> +1 604 726 4230
> _______________________________________________
> Sidefx-houdini-list mailing list
> Sidefx-houdini-list at sidefx.com
> https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list

More information about the Sidefx-houdini-list mailing list