> def tmirror():
>
>   b1 = controler
>   b2 = obj
>
>   cmds.setDrivenKeyframe( 'b2.tx', cd='b1.tx', dv=0,v=0 )
>   cmds.setDrivenKeyframe( 'b2.tx', cd='b1.tx', dv=20,v=-20 )
>   cmds.setDrivenKeyframe( 'b2.tx', cd='b1.tx', dv=-20,v=20 )
>
>
Using the commands as you've given them, maya is looking for objects whose
NAMES are 'b1' and 'b2'.  Your variables b1 and b2 are never even used.

You'd need to do something like this:

cmds.setDrivenKeyframe( b2 + '.tx', cd=b1+'.tx', dv=0,v=0 )

or, equivalently:

cmds.setDrivenKeyframe( '%s.tx' % b2, cd=('%s.tx' % b1), dv=0,v=0 )

(I'm assuming that the rest of your syntax here is correct... I haven't
bothered to check it.)

- Paul


> What am I doing wrong?
>
> I want to create a simple setdrivenkey where the motion controls in
> positions x, y, z, and this monitor.
>
> --
> http://groups.google.com/group/python_inside_maya
>

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

Reply via email to