Or even shorter, select two objects and then:

import maya.cmds as cmds
cmds.delete( cmds.parentConstraint( cmds.ls(sl=1) ) )

I prefer to use 'constraint hacks' as Phil said because sometimes the xform
command doesn't return the values we are looking for, even in world mode.

Richard



On Tue, Dec 15, 2009 at 12:14 AM, Phil Sloggett <[email protected]>wrote:

> I just use constraint hacks most of the time so that it skips any
> requirements of the coordinate spaces, assuming pivots centered:
>
> import maya.cmds as mc
> def align(obj,target):
>   c = mc.parentConstraint(target,obj)
>   mc.delete(c)
>
> voila
>
> 2009/12/15 Vitor Lôbo Ramos <[email protected]>
>
> No. I just quoted the ikHandle as an example. Using the functions
>> (Startjoint and Endefecctor) to align the joints.
>>
>> In fact, I want to connect the locator to the joint. That is,
>> regardless of where you are located in the joint, I hope that the
>> locator is aligned to it.
>>
>> On Dec 14, 7:47 pm, <[email protected]> wrote:
>> > Select target node(ikhandle?) then the locator and run >Constrain>Point
>> > Constraint options box command, with "Maintain offset" checked off.  Is
>> > that what your asking?
>> >
>> > Jason Brummettwww.coloradodigitalarts.com
>> >
>> > > -----Original Message-----
>> > > From: [email protected]
>> > > [mailto:[email protected]] On Behalf Of
>> > > Vitor Lôbo Ramos
>> > > Sent: Monday, December 14, 2009 11:10 AM
>> > > To: python_inside_maya
>> > > Cc: [email protected]
>> > > Subject: [Maya-Python] Shape alignment
>> >
>> > > Good afternoon
>> > > I would like to know how to align an object (let's assume
>> > > that a Locator), to another object through of his name (be it
>> > > a joint as an example).
>> >
>> > > The method in which this object would be aligned to one
>> > > another, Seems to be the method of alignment ikhandles
>> > > (StartJoint or Endeffector). But not necessarily connecting
>> > > two points.
>> >
>> > > To be clear, I would like to place a locator to a joint
>> > > without stipulating coordinates. That is, regardless of where
>> > > is this joint, where the locator will position where he is.
>> >
>> > > How do that?
>> >
>> > > --
>> > >http://groups.google.com/group/python_inside_maya
>>
>> --
>> http://groups.google.com/group/python_inside_maya
>>
>
>  --
> http://groups.google.com/group/python_inside_maya
>

-- 
http://groups.google.com/group/python_inside_maya

Reply via email to