ghang Posted May 2, 2009 Share Posted May 2, 2009 Hi everyone , I have 2 model need to be combine together , well , actually is not only 2 , is plenty, so I cannot use "edit" or "transform" node to manual edit them 1 by 1. I need some help , please kindly let me know as much tips as I can. (except with manual edit like "transform" or "edit" node , well , if there is expression can do the samething , please also tell me !! Thanks please!!! Quote Link to comment Share on other sites More sharing options...
Guest Swann Posted May 3, 2009 Share Posted May 3, 2009 (edited) What you mean by combine ? merge them ? or just move them as close to eachother as it only possible ? EDIT: Nevermind, below oldschool writed almost a book full of tips for your question. Edited May 3, 2009 by SWANN Quote Link to comment Share on other sites More sharing options...
old school Posted May 3, 2009 Share Posted May 3, 2009 Append a transform SOP to the geometry you want to align with the first object. First move the objects you want to transform to the object's origin. In the Transform SOP added above you would use in the tx, ty and tz parms respectively: $CEX*-1 $CEY*-1 $CEZ*-1 where $CEX, $CEY and $CEZ are local variables to the Transform SOP that return the centroid position of this node. By negating them, you are putting the geometry at the origin of this object. (see the operator help for the Transform SOP and scroll down to see the list of all local variables available) Next expand the parameter expressions to move the object to the centroid of the geometry in a SOP you want to align to again in the tx, ty and tz parms: Quote Link to comment Share on other sites More sharing options...
old school Posted May 3, 2009 Share Posted May 3, 2009 $CEX*-1 + centroid("../tube1", D_X) $CEY*-1 + centroid("../tube1", D_Y) Quote Link to comment Share on other sites More sharing options...
old school Posted May 3, 2009 Share Posted May 3, 2009 $CEZ*-1 + centroid("../tube1", D_Z) Quote Link to comment Share on other sites More sharing options...
old school Posted May 3, 2009 Share Posted May 3, 2009 where the centroid() expression does the same as the $CE? local variables above but for any other SOP in the network and "../tube1" is the local path to the node that you want to eventually snap the geometry to. Finally move the geometry to any of the six boundaries of the target object by picking on either the tx, ty or tz parms. For example if you wanted to align your geometry to the +X boundary of your geometry, in the tx parm you would expand the expression to read: $CEX*-1 + centroid("../tube1", D_X) + bbox("../tube1", D_XSIZE)/2 + bbox("../tube_object2_xform1", D_XSIZE)/2 Quote Link to comment Share on other sites More sharing options...
old school Posted May 3, 2009 Share Posted May 3, 2009 where bbox() returns the bounding box of the geometry cached by a particular SOP. Dividing the bbox() expressions for both sets of geometry by 2 gives us half the size. The result is to first move the center of our geometry to the edge of the primitive then move this geometry out by half it's size resulting in the two objects just touching each other. Quote Link to comment Share on other sites More sharing options...
old school Posted May 3, 2009 Share Posted May 3, 2009 and sorry for the mangled reply. For some reason the full answer would not go as one post... Quote Link to comment Share on other sites More sharing options...
ghang Posted May 3, 2009 Author Share Posted May 3, 2009 and sorry for the mangled reply.For some reason the full answer would not go as one post... Ohhhhh!!! thanks very much , i will try it out and see how , then will post here to let you know is it what i need , thanks again to everyone kindness Quote Link to comment Share on other sites More sharing options...
ghang Posted May 4, 2009 Author Share Posted May 4, 2009 Oh ya , thanks , this is exactly what i want!!!! thank you very very very much! 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.