rohandalvi Posted May 7, 2012 Share Posted May 7, 2012 hi, I have a small problem. I am copying some objects using the COPY SOP. I am trying to move the object based on the bounding box of the source object. Now it works for one object. but i cant get it to work for multiple objects of different sizes. Exmaple - Take a box. Scale it in Z axis using Transform SOP and copy it using COPY SOP. In the z translate in COPY is use "bbox("../xform1",D_ZMAX)*2" now when i increase the no. of copies all the boxes stick together. But , if i take different sized boxes coming through a SWITCH SOP which has a stamp function, so every copy will have a different sized object, but then the copy node picks up the bounding box of only the first copy and not of the rest. What i essentially want is for the boxes to stick to each other edge to edge regardless of the size. So effectively each Copy should move based on its Bounding box. Atleast thats what i am thinking. If there is any other way, kindly let me know. Any help would be most appreciated. with regards Rohan Dalvi Quote Link to comment Share on other sites More sharing options...
sadhu Posted May 7, 2012 Share Posted May 7, 2012 Hi Rohan. Is this is what you are looking for? foreach_z_transform.hipnc Quote Link to comment Share on other sites More sharing options...
rohandalvi Posted May 7, 2012 Author Share Posted May 7, 2012 (edited) thats exactly what i was looking for. Never thought of going into foreach. thanks a lot if possible could you explain it a little bit. Why are we using a merge inside FOREACH, why not put transform on the each node ? Edited May 7, 2012 by rohandalvi Quote Link to comment Share on other sites More sharing options...
sadhu Posted May 8, 2012 Share Posted May 8, 2012 For each iteration we are adding a box of different size and placing it at a distance which is nothing but ZMAX or ZSIZE of the output of previous iteration , so I applied transformation only to new box which we are going to add at current iteration at distance equal to the ZMAX of output of previous iteration. By merging new box with each sop, this will be input through the each sop for next iteration. This is possible because on each sop feedback is turned on. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.