Jump to content


Copy Problem


  • Please log in to reply
3 replies to this topic

#1 rohandalvi

rohandalvi

    Peon

  • Members
  • Pip
  • 86 posts
  • Joined: 28-September 06

Posted 07 May 2012 - 01:16 AM

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

#2 sadhu

sadhu

    Initiate

  • Members
  • PipPip
  • 173 posts
  • Joined: 09-July 09
  • Location:Mumbai, India
  • Name:Sandeep Doshi

Posted 07 May 2012 - 03:55 AM

Hi Rohan.

Is this is what you are looking for?

Attached Files



#3 rohandalvi

rohandalvi

    Peon

  • Members
  • Pip
  • 86 posts
  • Joined: 28-September 06

Posted 07 May 2012 - 06:28 AM

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, 07 May 2012 - 06:35 AM.


#4 sadhu

sadhu

    Initiate

  • Members
  • PipPip
  • 173 posts
  • Joined: 09-July 09
  • Location:Mumbai, India
  • Name:Sandeep Doshi

Posted 07 May 2012 - 09:37 PM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users