It is currently 20 Jun 2013, 13:52

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Key Pivot Tool
PostPosted: 09 Mar 2012, 00:22 
Offline

Joined: 24 Sep 2010, 18:28
Posts: 595
SI has a pivot transformations that can be keyed without using a Center operator. The awkward thing for me is that this is done by changing the parameters values from the ppg window and translation of the pivot happens relatively to local transformation matrix of the object. So I wrote this handy little script that allow you to just pick a position in space that would be a new pivot center of the current frame

Code:
xsi = Application

frame = xsi.GetValue("PlayControl.Current")

pivot = xsi.PickPosition("Set new pivot position and key it", "Remove key on the current frame")

if pivot[0] == 1:

   v3 = XSIMath.CreateVector3(pivot[1],pivot[2],pivot[3])
   m4x4 = XSIMath.CreateMatrix4()
   obj = xsi.Selection[0]
   obj.Kinematics.Global.Transform.GetMatrix4(m4x4)

   m4x4.Invert(m4x4)

   v3.MulByMatrix4InPlace(m4x4)

   x, y, z = 0, 0, 0
   x, y, z = v3.Get(x, y, z)

   xsi.SetValue("*.kine.local.pposx", x)
   xsi.SetValue("*.kine.local.pposy", y)
   xsi.SetValue("*.kine.local.pposz", z)
   xsi.SavePivotKey(["*"], "siTrn", frame)
   xsi.RotationTool()

elif pivot[0] == 2:
   try:
      xsi.RemoveKey("*.kine.local.pposx,*.kine.local.pposy,*.kine.local.pposz,*.kine.local.pcposx,*.kine.local.pcposy,*.kine.local.pcposz", frame)
   except:
      pass

_________________
Constantine
Learnable Programming


Top
 Profile  
 
 Post subject: Re: Key Pivot Tool
PostPosted: 23 Mar 2012, 08:48 
Offline

Joined: 28 Sep 2011, 10:33
Posts: 82
Softimage has an unbinded command in the Keyboard Mapping that let's you move the pivot.

It's called Edit Transform Tool Pivot in the Transform Tool group.

There is also a Transform Tool Pivot(alternate), but It seems to do the same.

_________________
M.Yara
Character Modeler | Softimage Generalist (sort of)


Top
 Profile  
 
 Post subject: Re: Key Pivot Tool
PostPosted: 23 Mar 2012, 18:13 
Offline

Joined: 24 Sep 2010, 18:28
Posts: 595
Edit Transform Tool Pivot is a temporary way to move pivot position (same as holding ALT button). My script works directly with pivot kinematic values under local transforms of the object and key them for animation purposes (imagine a rolling cube, for example, which changes its point of rotation with time)

_________________
Constantine
Learnable Programming


Top
 Profile  
 
 Post subject: Re: Key Pivot Tool
PostPosted: 24 Mar 2012, 10:01 
Offline

Joined: 28 Sep 2011, 10:33
Posts: 82
Oh , now I get it!!
Nice tool !

_________________
M.Yara
Character Modeler | Softimage Generalist (sort of)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group