View Full Version : How to rotate object's pivot without affecting children objects?
johnchuang 07-14-2011, 05:35 AM Hi,I try to rotate one object's pivot using the "RotatePivotOnly" function given by the help files.But when running this script ,the children objects also rotate . Then how can I rotate the parent object affecting pivot only with the children maintain their own positions?
The function in help:
fn RotatePivotOnly obj rotation= ( local rotValInv=inverse (rotation as quat)
animate off in coordsys local obj.rotation*=RotValInv
obj.objectoffsetrot*=RotValInv
obj.objectoffsetpos*=RotValInv
)
Thanks a ton!
|
|
denisT
07-14-2011, 05:47 AM
Hi,I try to rotate one object's pivot using the "RotatePivotOnly" function given by the help files.But when running this script ,the children objects also rotate . Then how can I rotate the parent object affecting pivot only with the children maintain their own positions?
The function in help:
fn RotatePivotOnly obj rotation= ( local rotValInv=inverse (rotation as quat)
animate off in coordsys local obj.rotation*=RotValInv
obj.objectoffsetrot*=RotValInv
obj.objectoffsetpos*=RotValInv
)
Thanks a ton!
the trivial solution is:
unlink -> rotate ex-parent's pivot -> link ex-children back
but... if you have any kind of link/position/orientation constraint the task becomes not trivial at all.
johnchuang
07-14-2011, 06:27 AM
Thank you Denis! Reparenting children would be a solution.But is there some other solutions for this? I mean just like the manual way that u turn on "Affect pivot only" button in command panel and just rotate the parent's pivot and the children do not rotate . Why can't I use scripts to do that? Of course ,if it's impossible I'll use the reparenting method.....
Again thank u DenisT !
CGTalk Moderation
07-14-2011, 06:27 AM
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.
vBulletin v3.0.5, Copyright ©2000-2013, Jelsoft Enterprises Ltd.