Match Center via scripting

31 views
Skip to first unread message

Dwayne Elahie

unread,
May 17, 2012, 12:05:15 PM5/17/12
to soft...@listproc.autodesk.com
Hi,

I was wondering how do you match object centers via scripting. Softimage
script editor does not reveal the code. When I try to repeat what the
script editor gave me, the object itself moves instead of the center.

Thanks,

Dwayne

Martin

unread,
May 17, 2012, 12:13:37 PM5/17/12
to soft...@listproc.autodesk.com
What do you want to do?


You can use Translate and specify siCenterMode to move the Center to wherever you want.

Translate( obj, x,y,z, siAbsolute, siGlobal, siCtr, siXYZ )

Where obj, x, y, and z are variables, obj= object(s) and x y z your target coordinates. siCtr is to move the Center, and siObj (default) is to move the object.

M.Yara

Gareth Bell

unread,
May 17, 2012, 12:36:15 PM5/17/12
to soft...@listproc.autodesk.com
do you mean centre or pivot?

for pivot try this:

import win32com
xsi = Application

oColl = (xsi.Selection)

for oObjs in oColl:
xsi.TranslatePivot(oObjs , x, y, z) #put in your
coordinates at x, y and z

Gareth Bell

unread,
May 17, 2012, 12:46:43 PM5/17/12
to soft...@listproc.autodesk.com
Actually you can cut out most of that gumpf! (I'm still getting to grips
with Python)


xsi = Application
xsi.TranslatePivot(xsi.Selection, x, y, z)
Reply all
Reply to author
Forward
0 new messages