On Mon, Mar 26, 2018, 8:40 AM john patterson <[email protected]> wrote:

> Can someone please translate this MEL to Python?  I am not using pyMEL.
>
> selectKey -add -k -t 1 -t 9 -t 17 -t 25 -t 33 -t 41 pSphere1_translateY ;
>
> The docs say that a single time is acceptable, or a range.  I can't even
> get this to work...
>
> cmds.selectKey("pSphere1.translateY", add=1, k=1,t=1)
>
> I don't mind writing 6 lines of Python for those 6 different times.
> Anyone?
>


Did you check the docs? There are examples at the bottom. The time
parameter expects a python tuple, since python functions cant accept
multiple uses of the same parameter name, like in Mel

http://help.autodesk.com/cloudhelp/2017/ENU/Maya-Tech-Docs/CommandsPython/selectKey.html

Try
cmds.selectKey("pSphere1.translateY", add=True, k=True, t=(1,)
cmds.selectKey("pSphere1.translateY", add=True, k=True, t=(1, 9, 17, 25,
33, 41)

The part of that doc that isn't very clear is that it pretends to support
more variations of that time value than it actually does. Sometimes the
python docs were copied from Mel without fully updating.


> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/ac118da8-9795-4095-bae0-aaab344edac5%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/ac118da8-9795-4095-bae0-aaab344edac5%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2A38WQM%2BV88OhLC-KiLkNkgdrecBh24xkPzvzBjWks8w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to