If script is way to go, probably it's worth to take a look into pymel. Pymel warps a lot of Maya Python API into it. Or go directly to Maya Python API, use openMaya to talk directly to Maya.
pymel.core.datatypes module contain a bunch of useful stuff, including TransformationMatrix, Vector, and Point which could be easily use to build transformation matrix and others. Cheers, On Tue, Dec 2, 2014 at 10:10 PM, Mirko Jankovic <[email protected]> wrote: > always nice to read about maya like this... it reminds me why I started to > hate it in first place and why it will NEVER replace as SI as main > workhorse... > > script it... ;) > > On Tue, Dec 2, 2014 at 3:55 PM, Emilio Hernandez <[email protected]> > wrote: > >> It should... >> >> I use this script for rigging, matching the center's T and R to match a >> locator to a group. >> >> It is querying the world position and rotation of the second object and >> applying those values to the first selected object. >> >> But to be honest, I have not tried it modifying the object's pivot. >> >> >> >> >> >> >> >> ------------------------------------------------------- >> Emilio Hernández VFX & 3D animation. >> >> On Tue, Dec 2, 2014 at 8:24 AM, Cristobal Infante <[email protected]> >> wrote: >> >>> Thanks Emilio, but that doesn't match the objects by their centers right? >>> >>> If you offset the center and then try to match? >>> >>> On 2 December 2014 at 14:15, Emilio Hernandez <[email protected]> wrote: >>> >>>> Or... Write a script. >>>> >>>> Python Tab >>>> ----------------------------------------------------- >>>> import maya.cmds as cmds >>>> >>>> selected = cmds.ls (selection=True) >>>> >>>> objTrans =selected[0] >>>> objTarget = selected[1] >>>> >>>> trans = cmds.xform (objTarget, q=True, t=True, ws=True) >>>> rotation = cmds.xform (objTarget, q=True, ro=True, ws=True) >>>> cmds.xform (objTrans, t=trans, ro=rotation) >>>> ----------------------------------------------------------- >>>> >>>> Select first the object to transform. >>>> Select second the target object. >>>> >>>> run the script or add it as a button. >>>> >>>> >>>> >>>> ------------------------------------------------------- >>>> Emilio Hernández VFX & 3D animation. >>>> >>>> On Tue, Dec 2, 2014 at 5:15 AM, <[email protected]> wrote: >>>> >>>>> You can select two objects and then tab through the values in the >>>>> channel box and they will match up >>>>> >>>>> /Mikael >>>>> >>>>> *Från:* Cristobal Infante <[email protected]> >>>>> *Skickat:* tisdag den 2 december 2014 10:30 >>>>> *Till:* [email protected] >>>>> >>>>> Can somebody please tell what is the best way of matching transforms >>>>> in Maya? >>>>> >>>>> I've been using Align Objects, but it doesn't match two objects based >>>>> on their pivot like in xsi. >>>>> >>>>> Any ideas? >>>>> >>>>> C >>>>> >>>> >>>> >>> >> > -- Daniel Harjanto Infinite Frameworks Studios TD http://misterdi.cgpot.com

