Takes obj1's rotation and puts it on obj2's while keeping it's position:

# Python
xsi = Application
collSel = xsi.Selection

obj1 = collSel(0)
obj2 = collSel(1)

xformTemp = XSIMath.CreateTransform()
xform1 = obj1.Kinematics.Local.GetTransform2(None)
xform2 = obj2.Kinematics.Local.GetTransform2(None)

xformTemp.SetTranslation(xform2.Translation)
xformTemp.SetRotation(xform1.Rotation)

obj2.Kinematics.Local.PutTransform2(None, xformTemp)

--------------------------------------------
Eric Thivierge
http://www.ethivierge.com


On Thu, Mar 7, 2013 at 8:37 PM, Raffaele Fragapane <
raffsxsil...@googlemail.com> wrote:

> Application.Selection(0).Kinematics.Global.Transform =
> Application.Selection(1).Kinematics.Global.Transform
>
> Will match one object in the selection to the other.
>

Reply via email to