Recursive split ... using foreach inside foreach ?

   6522   1   0
User Avatar
Member
25 posts
Joined: Feb. 2010
Offline
Hi,

I'm trying to learn Houdini
and before today I found it amazing…

Today, I'm not sure…

I'm trying to create a kind of recursive splitting to scatter objects but I cannot get it to work.

My first idea was to use two foreach nodes, on inside the other but I never understand what was happening.

I create a grid and I want to operate n times the same random splitting on each primitives. I use a foreach node to iterate n times and inside it I use a second foreach to iterate over all my primitives. I can split one time all my primitives without any troubles (with only one foreach node) but if I try to get this new set of primitives, and split them again, nothing good happend

In fact I'm not sure what happend because some times it seems to work but after that Houdini start to become crazy…
(it put some objects in templates when I try to create a link between nodes, it reset all the time the attributs why an old value I don't want to use anymore, my tree node become completely red when I re-open the scene, it change the primitive numbers from one node to the other, I need to delete then re-create a node to get it to work corretly, it crash, it freeze, it make me crazy)

I'm sure it's about the double foreach, and maybe it's not the way to do it
but I don't see what's going on and I cannot think of a better way to do it.

Thank you for your advices
I don't want to use 100 foreach node on after the other

Attachments:
foreach_nr.hipnc (54.5 KB)

User Avatar
Member
25 posts
Joined: Feb. 2010
Offline
I got it,

I think the merge results option from the foreach node was what I missed.

recursive splitting is working now but the randomisation process could be improve
I post my scene if your are interest but be awar that I'm still learning and maybe I do some stuff the bad way.

For the moment I'm more concerned about the result than the performance. Sometimes I try differents ways to do the same thing and maybe I don't keep the good one…

leave comments if you have some

and have a good day

Attachments:
N_Rous_recusiveSplitting.hipnc (63.4 KB)

  • Quick Links