nested foreach problem

   2973   2   1
User Avatar
Member
479 posts
Joined: Dec. 2009
Offline
I'm trying to model the geometry as shown in the image below: each cell is composed of a cross-shape tower and 4 L-shape perimeter buildings.

It works for just one foreach node with a uniform height (the 1st hip file).

I want to have height variation across different cells by using nested foreach loop. i.e. each polygon within a grid (2x2 or higher) will be subdivided into four polygons, each will be used to construct one quarter of the cross-shape tower and one of the 4 L-shape building over the diagonal corner.

However, the geometry in one cell is completely missing in the final results, and there is strange result within the top level foreach node sometimes. see image below.

May I ask why the the nested foreach nodes don't work?

Thanks

Attachments:
reference image.jpeg (80.2 KB)
results one foreach node.png (161.3 KB)
results of nested foreach node.png (210.6 KB)
within the top level of the nested foreach node.png (314.4 KB)
within the bottom level of the nested foreach node.png (432.4 KB)
strange results within the top level foreach node.png (334.1 KB)
cross_typology_v005_nested_foreaach.hipnc (92.0 KB)
cross_typology_v001.hipnc (155.2 KB)

User Avatar
Member
4512 posts
Joined: Feb. 2012
Online
You have to make sure the names of Stamp Name and Index Stamp Name are different between each nested ForEach nodes.

This problem comes up a lot and is very hard to spot if you haven't experienced it before.
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | animatrix2k7.gumroad.com
User Avatar
Member
479 posts
Joined: Dec. 2009
Offline
thank you very much, pusat! It works!
  • Quick Links