python api 2.0 buggy?

95 views
Skip to first unread message

Rudi Hammad

unread,
Jun 17, 2016, 4:30:00 PM6/17/16
to Python Programming for Autodesk Maya
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

cheers

Justin Israel

unread,
Jun 17, 2016, 5:54:18 PM6/17/16
to python_in...@googlegroups.com
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/527d359f-ebd0-4fa1-a1f7-e05749842787%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rudi Hammad

unread,
Jun 17, 2016, 6:40:28 PM6/17/16
to Python Programming for Autodesk Maya
He didn´t go into specifics, bug he insisted that it is buggy( in maya 2015 al least). He didn´t know if it is any better in maya 2016. He has built the entire pipeline and rig builder of the studio in 3 or 4 yeras, so I guess he encounter a lot of bugs during this time
Maybe other people have another experience with it.

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?


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 <rudih...@gmail.com> 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 python_inside_maya+unsub...@googlegroups.com.

Justin Israel

unread,
Jun 17, 2016, 6:49:58 PM6/17/16
to python_in...@googlegroups.com
On Sat, Jun 18, 2016 at 10:40 AM Rudi Hammad <rudih...@gmail.com> 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 <rudih...@gmail.com> 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 python_inside_m...@googlegroups.com.

--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/c5ae20a1-bb3e-40f5-9a12-cb1133e22b35%40googlegroups.com.

Rudi Hammad

unread,
Jun 17, 2016, 7:58:45 PM6/17/16
to Python Programming for Autodesk Maya
oh, ok. Thanks for the tip.

if the api 2.0 is more pythonic, wouldn´t be better to stay with the old api if you are planning on transforming you code to c++?
Some people do the test with python because you don´t have to compile, and when the code works, they do it in c++.
With this workflow, does it make more sense using the old api or it al the same?


Justin Israel

unread,
Jun 17, 2016, 8:13:06 PM6/17/16
to Python Programming for Autodesk Maya
I can only speak for myself on this, but I feel it would be the the same either way. You either know the C++ api or you don't, and one should be able to port the intent from python to c++ regardless of whether the python code was in the new or old api. Really it is just loops, arguments and error handling that are different. Logic should be exactly the same. 
My 2cents. 



--
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 python_inside_m...@googlegroups.com.

Rudi Hammad

unread,
Jun 17, 2016, 9:13:12 PM6/17/16
to Python Programming for Autodesk Maya
cool. I don´t know c++ yet,but I´ll keep that in mind when I learn it. If you end up converting python code to c++, it seems more reasonable to chose the old api if it is more complete and less buggy.

cheers


El sábado, 18 de junio de 2016, 2:13:06 (UTC+2), Justin Israel escribió:


On Sat, 18 Jun 2016 11:58 AM Rudi Hammad <rudih...@gmail.com> wrote:
oh, ok. Thanks for the tip.

if the api 2.0 is more pythonic, wouldn´t be better to stay with the old api if you are planning on transforming you code to c++?
Some people do the test with python because you don´t have to compile, and when the code works, they do it in c++.
With this workflow, does it make more sense using the old api or it al the same?

I can only speak for myself on this, but I feel it would be the the same either way. You either know the C++ api or you don't, and one should be able to port the intent from python to c++ regardless of whether the python code was in the new or old api. Really it is just loops, arguments and error handling that are different. Logic should be exactly the same. 
My 2cents. 



--
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 python_inside_maya+unsub...@googlegroups.com.

Cesar Saez

unread,
Jun 18, 2016, 2:36:09 AM6/18/16
to python_in...@googlegroups.com
We use api2 extensively at work and it's ok-ish (we have found and report many maya bugs, but not necessarily api 2.0 related), it's way friendlier than the old api, allowing you to focus on implementing whatever you are working on instead of dealing with the lack of pointers in python and the provided workaround (mscriptutils all over the place).

If anything it is incomplete and sometimes you will need to deal with both (as Justin said), but for the supported features I totally recommend it over the old api.


Cheers!

Rudi Hammad

unread,
Jun 18, 2016, 4:37:09 AM6/18/16
to Python Programming for Autodesk Maya


If anything it is incomplete and sometimes you will need to deal with both (as Justin said), but for the supported features I totally recommend it over the old api.


Cheers!

good to know. Thx Cesar
Reply all
Reply to author
Forward
0 new messages