Jump to content

Copy Problem


Recommended Posts

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

Link to comment
Share on other sites

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 by rohandalvi
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...