On Sat, Jun 18, 2016 at 10:40 AM Rudi Hammad <[email protected]> wrote:

> I just use the api to access stuff like MVector, MPoints, etc... I like
> that with the new api lists are arguments, for example:
> import maya.api.OpenMaya as OpenMaya
> pointA = OpenMaya.MPoint(cmds.xform('joint1', q=True, t=True, ws=True))
> <== works
>
> but
>
> import maya.OpenMaya as oldOm
> pointA = oldOm.MPoint(cmds.xform('joint1', q=True, t=True, ws=True)) <==
> doesn´t work because it doesn´t accept lists
>
> isn´t api 2.0 easier to work with?
>

The point of the 2.0 api was to be more pythonic and make it more natural
to work with.

This actually works in the old api:
pointA = oldOm.MPoint(*cmds.xform('joint1', q=True, t=True, ws=True))

Notice the * in front of the results of the call to xform, which expands
the list into arguments.


> El viernes, 17 de junio de 2016, 23:54:18 (UTC+2), Justin Israel escribió:
>
>>
>>
>> On Sat, Jun 18, 2016 at 8:30 AM Rudi Hammad <[email protected]> wrote:
>>
>>> Hello,
>>>
>>> I was talking with a colleague from the studio, and he told me that they
>>> don use the api.2.0 in maya 2015 because it is very buggy.
>>> Do you recommend not using the api 2.0? In the documentation it is
>>> recomended to use 2.0, but in practice it doesn´t look a good idea
>>> I am using maya 2016.5, so I don´t know if it is any better
>>>
>>
>> Did your colleague give any example of where it is buggy? I am actually
>> interested to know, since I am not up on the state of it. I've not heard
>> others talk about it being buggy... just incomplete.
>>
>>
>>>
>>> cheers
>>>
>>> --
>>> 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/527d359f-ebd0-4fa1-a1f7-e05749842787%40googlegroups.com
>>> <https://groups.google.com/d/msgid/python_inside_maya/527d359f-ebd0-4fa1-a1f7-e05749842787%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/c5ae20a1-bb3e-40f5-9a12-cb1133e22b35%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/c5ae20a1-bb3e-40f5-9a12-cb1133e22b35%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/CAPGFgA3sxyEEOiDdoeYhUBzb95B1qxn7-aQT5mj-DNetjjjemA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to