On Thu, Mar 29, 2018, 6:33 AM john patterson <[email protected]> wrote:

> Thanks for the reply.  Yes, I read the documentation.  It was not
> helpful.  I read the specs for the time flag, (quoted below), which are
> wrong.  It says that single values are valid, but it doesn't say that even
> a single value has to be in a tuple, and shows a misleading example that
> looks like MEL....
>
> """
>
> time(t) timerange createmultiuse
> time uniquely representing a key (or key range) on a time-based animCurve.
> Valid timeRanges include single values (-t 10) or a string with a lower and
> upper bound, separated by a colon (-t "10:20")
> In query mode, this flag needs a value.
>
> """
>
>
> http://help.autodesk.com/cloudhelp/2017/ENU/Maya-Tech-Docs/CommandsPython/selectKey.html
>
> Your examples would be a great addition to the doc page.
>

Yea like I said their docs are incomplete and wrong. But they do have
examples of multiple time values at the bottom. What they are missing is
the example of the single value still being passed in a tuple.


>
>
> On Sunday, March 25, 2018 at 5:08:46 PM UTC-4, Justin Israel wrote:
>
>>
>>
>> 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/a178fbb5-0353-4a4e-ae6f-631b874f8217%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/a178fbb5-0353-4a4e-ae6f-631b874f8217%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/CAPGFgA2bYE70jz3do%3DpY_vkdGQihdhULRB0-N2f86icPws5y%2BA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to