Stacked group of objects stacking problem.

   2426   4   1
User Avatar
Member
13 posts
Joined:
Offline
Hi all.
I am currently trying to create a stacked group of boxes. I have the heights of the boxes imported through a CSV file fine.

I thought that maybe using a for loop in an attribute vop to add the values together over each iteration could be a way to go, however, I can’t seem to make the values progressively accumulate over each iteration.
I have attached a file on where I am at.
Any help on this would be greatly appreciated.
Thanks

Paul.

Image Not Found
Image Not Found
Edited by hitch - Sept. 12, 2018 19:11:24

Attachments:
tempData.csv (51 bytes)
stacking.hiplc (100.4 KB)

User Avatar
Member
2561 posts
Joined: June 2008
Offline
Here is the basic code setup for adjusting the Y location. But you may need to adjust the height of the boxes as well.

Attachments:
ap_stacking.hiplc (110.1 KB)
Untitled-1.jpg (217.5 KB)

Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
13 posts
Joined:
Offline
@Enivob. Thank you so much. All I had to do was adjust the pivots for the boxes this worked perfectly.
I am clearly going to have to get over my code phobia and learn some vex.

Cheers,

Hitch.
User Avatar
Member
1746 posts
Joined: May 2006
Offline
Funny, was thinking about this problem a few days ago, came up with a more general solution that might be useful:

http://www.tokeru.com/cgwiki/index.php?title=ForLoops#Stacking_boxes [www.tokeru.com]
http://www.tokeru.com/cgwiki [www.tokeru.com]
https://www.patreon.com/mattestela [www.patreon.com]
User Avatar
Member
13 posts
Joined:
Offline
@mestela. That is awesome. I am going through digesting that now, thank you very much.
  • Quick Links