I thought by moving the box in this file with $ZMAX every loop it would end up beside each other but it becomes accumulative..not sure why.. in the end I was planing to switch between boxes with different sizes making them stack nicley no matter the size because the $ZMAX would always move the the correct distance.
My guess is that ZMAX gets extended each time the loop iterates. So create an external variable, outside the loop, that you can use as a constant inside the loop.
Well I want the current $ZMAX of the current itteration and transform the box with that value, so I could have differently sized boxes and yet stack them up neatly. I am not sure this solution would solve that ?
It's happening because each iteration you offset an already offset box. If you chain multiple transform nodes with $ZMAX you get the same effect without the merging. One way would be to fetch the geometry from the outside each time ( which you did in your second file ) or simply use $ZMAX - $ZMIN inside the loop instead.
Thanks Blackpixel, yeah I figured it was doing something like that. Thats why I came up with my 2nd solution. And I tried yours out aswell, got it working but just one a single input mesh. Can't get it to work with different meshes for some reason.
Yep, you are correct. Your second setup is the right way to go then You can simplify it a bit though. Get rid of that attrib create and get the ZMAX from the bbox() expression directly in the transform : bbox( “../foreach_begin1”, D_ZMAX) + $ZMAX