Search - User list
Full Version: Attribute to different iterations of a for-each loop
Root » Houdini Indie and Apprentice » Attribute to different iterations of a for-each loop
bikonistudio
Hello,

I have a problem that I'm trying to solve in Houdini :

Initially I have a simple plain grid on the ground. Then I have a for each loop primitive on fetch feedback with an extrusion (using polyextrude) inside it and also have side group activated. Now my main goal is to have a different id or different group on each iteration of these new sides faces. I've tried to put below an primitive wrangle using the metadata but it doesn't seem to work and I'm stuck. My geometry spradsheet also says that all my new side faces are still on id=0

Can someone tell me where I might have made a mistake ?

Thanks.

All example below:
animatrix_
Hi,

You have a few issues:

1. The node name you are passing to the detail function is not correct.

2. It's iteration, not numiteration (correct one is numiterations)

3. You don't need the 3rd argument for the detail VEX function unlike Hscript.

4. It's better to use a spare parm.

5. It's better to use the Group field rather than check the group inside the code for this kind of attribute assignment.

Gaalvk
"numitertion" is the total number of iterations; it's the same for all iterations, obviously.
You probably need the "iteration" attribute (from 0 to numertion-1).
I haven't delved into your process, but I'll just remind you of a common beginner mistake: if you divide an int by an int, you get a rounded int, not a float. So, 5/10 = 0, not 0.5 as you might expect. Don't forget to change the type.
bikonistudio
Alright,

Thank you very much for your responses, I thought I could store the iteration number from the metadata in some way to tag faces created through the corresponding iteration. But I will find another way, probably using groups instead.

Thank you very much and have a nice day.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB