For Each Loop And Primitive Groups

   9982   2   0
User Avatar
Member
13 posts
Joined: March 2015
Offline
Hi Guys

Just picked up Houdini and love it so far! Working through some tutorials to get the hang of it.

I try to create a scatter tool. After scattering my objects, I use a dopnet to separate intersecting objects.
While it works quite nice, this can lead to objects being moved above or below the ground plane.
I would like to delete objects that get displaced in height.

I thought I could use a for each loop now, iterate through all the distributed objects, use a ray sop to create a point on the ground plane and then measure the distance to the object. If above or below X units from the ground pane, delete it.

My problem is, that the for each loop only takes primitives or points, but I got primitive groups, created from the copy sop (Which I fed with polygonal objects).
So if I have just a random transform (based on iteration) in the loop, it transforms every primitive (face), instead of the group (whole object).
Is there any way to iterate just over any group, instead of primitive? In the rbd fractured object node, there was a group mask field.. Something similar in for each?

Any help appreciated.

Cheers
Marc
User Avatar
Member
8538 posts
Joined: July 2007
Online
you can use primitive atribute
to create it from named groups use Name SOP
here is related example:
http://forums.odforce.net/topic/24437-new-for-each-system/?p=143201 [forums.odforce.net]
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
13 posts
Joined: March 2015
Offline
Awesome! Great example file. Thanks a lot tamte.
  • Quick Links