I cant agree more with ya, Judah. I acknowledge its extremely appealing to start in with pymel for all the convenience it offers, and be allowed to bypass the unpythonic nature of the cmds module. But it does come with a price, and I'm sure that when you start using it, you would use it for everything. Its far more beneficial to understand how the native commands and API work, before you start committing yourself to a 3rd party library that has to be maintained separately and kept in sync. When you have a bug in your code, you have the chance of it being one layer higher, in the pymel abstraction.
When I first saw pymel, a while back, I got really excited and started using it in my code. But I quickly found that the performance hit was huge for doing loops on anything. I also address this and show some benchmarks in my Vol 1. cmivfx training video. In a nutshell, its far better to get the fundamentals down cold, and then know what your options are for solving different problems. On Thu, Jan 19, 2012 at 11:16 AM, Judah Baron <[email protected]> wrote: > You ever hear that joke about the guy who goes into a saloon and is dying > of thirst but has no money? He's told that if he takes a gulp from the > spitoon he can get a drink for free. He's thirsty, so he puts the spitoon > to his lips and takes a gulp - then another and another until the whole > thing is gone. The people are horrified and say "You only needed to take > one gulp!" He replies, "I know, but it came all in one piece and I couldn't > stop." > > Now I'm not saying pymel is a spitoon full of mucus, and mean no offense > to its talented developers, but it's a funny joke and illustrates an > important point: once you start using pymel it will be very difficult to > stop due to the nature of its implementation. It's a slippery slope and the > decision warrants some study and consideration. > > I would recommend that a new python user stick with cmds. Once you have > some understanding of python and what Maya offers out of the box you can > make a more informed decision. > > -Judah > > > On Thu, Jan 19, 2012 at 10:56 AM, Kamil Hepner <[email protected]>wrote: > >> Okey I'll be honest... :-) the pymel have disadventages. The biggest >> one is that pymel is slower than cmds. But I love it for his OOP >> structure. So yes, my previous post is misleading, sorry for that :-) >> >> 2012/1/19, Justin Israel <[email protected]>: >> > Kamil, you say that there are "only advantages" to using pymel? Are you >> > implying that pymel has no disadvantages? Wouldn't want to mislead a >> > newcomer to Maya python ;-) >> > >> > >> > On Thu, Jan 19, 2012 at 10:05 AM, stephenkmann >> > <[email protected]>wrote: >> > >> >> I can see what you mean.. I still have tons to learn, thanks for the >> >> update! >> >> >> >> -=s >> >> >> >> >> >> >> >> On Thu, Jan 19, 2012 at 10:46 AM, Kamil Hepner >> >> <[email protected]>wrote: >> >> >> >>> Pymel is more pythonic than cmds. Also pymel is object oriented. There >> >>> are only adventages of using pymel istead of cmds. In this simple >> >>> above example, you doesn't see it, I can write it strice in MEL, or >> >>> maya cmds. >> >>> >> >>> But this example, should work in more OOP way: >> >>> >> >>> import pymel.core as pm >> >>> >> >>> # Get the panel >> >>> pan = pm.getPanel(withFocus=True) >> >>> # Name >> >>> pan.getCamera() >> >>> >> >>> But I have a problem, because the getPanel(), allways return me >> >>> ui.Panel objects, even when I use the "all=True" flag. It's strange >> >>> becasue it should return the ui.ModelEditor object when I have >> >>> viewport actived. I use the last version of pymel from git repo (1.0.4 >> >>> (8cfdc8c) >> >>> >> >>> >> >>> >> >>> 2012/1/19, Stephen <[email protected]>: >> >>> > I'm in the early steps of learning python in maya and was curious >> why >> >>> you >> >>> > are using pymel for this , rather than just maya.cmds. >> >>> > (it's the exact same in maya.cmds) >> >>> > -s >> >>> > >> >>> > Sent from blackberry >> >>> > >> >>> > On Jan 19, 2012, at 7:53 AM, Kamil Hepner <[email protected]> >> wrote: >> >>> > >> >>> >> Try this: >> >>> >> >> >>> >> import pymel.core as pm >> >>> >> >> >>> >> # Get the panel >> >>> >> pan = pm.getPanel(withFocus=True) >> >>> >> >> >>> >> # Name >> >>> >> print pm.windows.modelPanel(pan, query=True, camera=True) >> >>> >> >> >>> >> >> >>> >> Should work. >> >>> >> Cya! >> >>> >> >> >>> >> 2012/1/10, deadparticle <[email protected]>: >> >>> >>> i can hardly find infomation of this >> >>> >>> >> >>> >>> -- >> >>> >>> view archives: http://groups.google.com/group/python_inside_maya >> >>> >>> change your subscription settings: >> >>> >>> http://groups.google.com/group/python_inside_maya/subscribe >> >>> >>> >> >>> >> >> >>> >> -- >> >>> >> view archives: http://groups.google.com/group/python_inside_maya >> >>> >> change your subscription settings: >> >>> >> http://groups.google.com/group/python_inside_maya/subscribe >> >>> > >> >>> > -- >> >>> > view archives: http://groups.google.com/group/python_inside_maya >> >>> > change your subscription settings: >> >>> > http://groups.google.com/group/python_inside_maya/subscribe >> >>> > >> >>> >> >>> -- >> >>> view archives: http://groups.google.com/group/python_inside_maya >> >>> change your subscription settings: >> >>> http://groups.google.com/group/python_inside_maya/subscribe >> >>> >> >> >> >> >> >> >> >> -- >> >> [email protected] >> >> http://smannimation.blogspot.com/ >> >> http://nymayausersgroup.blogspot.com/ >> >> http://smann3d.blogspot.com/ >> >> >> >> >> >> -- >> >> view archives: http://groups.google.com/group/python_inside_maya >> >> change your subscription settings: >> >> http://groups.google.com/group/python_inside_maya/subscribe >> >> >> > >> > -- >> > view archives: http://groups.google.com/group/python_inside_maya >> > change your subscription settings: >> > http://groups.google.com/group/python_inside_maya/subscribe >> > >> >> -- >> view archives: http://groups.google.com/group/python_inside_maya >> change your subscription settings: >> http://groups.google.com/group/python_inside_maya/subscribe >> > > -- > view archives: http://groups.google.com/group/python_inside_maya > change your subscription settings: > http://groups.google.com/group/python_inside_maya/subscribe > -- view archives: http://groups.google.com/group/python_inside_maya change your subscription settings: http://groups.google.com/group/python_inside_maya/subscribe
