PDA

View Full Version : question about align


f3derico
02-06-2008, 11:50 AM
how to align only obj.pivots?
I need to align a shape to Bone to control bone.rotation, shape is a circle and I want it orizzontal, bone is vertical so get bone.rotation turn my shape.

JHN
02-07-2008, 08:37 PM
Hi, this code will align and move all pivots of the selection to the pivot of the first selected.



objs = selection as array -- get selection
t = objs[1] -- targer object

for o in 2 to objs.count do -- loop over selection except the target
(
in coordsys world
objs[o].dir = t.dir -- rotate first
objs[o].objectOffsetRot = inverse objs[o].transform.rotation -- inverse rotate the objectOffset
objs[o].pivot = t.pivot -- align pivot (pos only)
)


-Johan

CGTalk Moderation
02-07-2008, 08:37 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.