PyMEL 1.0.0 Beta

188 views
Skip to first unread message

Chad Dombrova

unread,
Dec 22, 2009, 3:53:32 PM12/22/09
to python_in...@googlegroups.com
hi all,
we've been working hard on the next major release of PyMEL and it's ready to beta test! check out what's new here: http://www.luma-pictures.com/tools/pymel/docs/1.0/whats_new.html

there are some fairly big changes so be sure to read the "what's new" section first and pay close attention to the "install" documentation, as it has changed since verion 0.9.x. keep in mind that some of the docs are still in progress.

there's also a new beta for 0.9.3 which provides pymel 1.0 forward compatibility

downloads:
http://pymel.googlecode.com/files/pymel-1.0.0b1.zip
http://pymel.googlecode.com/files/pymel-0.9.3b1.zip

docs:
ttp://www.luma-pictures.com/tools/pymel/docs/1.0/

let us know if you have any problems so we can fix them for the final release.

-chad


Sylvain Berger

unread,
Dec 22, 2009, 4:43:52 PM12/22/09
to python_in...@googlegroups.com
Superb!  I looked at the what's new and this release looks great.  It's a shame that I have to move away from Maya scripting more and more :(






--
"A pit would not be complete without a Freeman coming out of it."
The Vortigaunt
Message has been deleted

Martin La Land Romero

unread,
Dec 22, 2009, 6:50:11 PM12/22/09
to python_in...@googlegroups.com
I spent like three hours trying to get this to work and nothing. Does anyone has a more clear tuto.
Thanks

On Tue, Dec 22, 2009 at 3:48 PM, Martin La Land Romero <martin...@gmail.com> wrote:
These were the worse 3 hours of my life. This thin won't work. I am using Maya 200964 bit, not sure if the explanations are correct, perhaps a little bit confusion.

Sorry to be so sharp but it was a waste of time.







--
Martin La Land Romero
www.martinromerovfx.com
martin...@gmail.com
(415)261-2172

Chad Dombrova

unread,
Dec 22, 2009, 7:28:13 PM12/22/09
to python_in...@googlegroups.com
did you go through the tutorial in "getting started"?  

what errors are you getting?  you're going to have to be more specific than "These were the worse 3 hours of my life".

-chad


Martin La Land Romero

unread,
Dec 22, 2009, 8:23:55 PM12/22/09
to python_in...@googlegroups.com
Here you go,

Ok, I'll tell you exactly what's going on.

1.I went to this website.
http://www.luma-pictures.com/tools/pymel/docs/1.0/install.html#manual-install

2. Open the shel, I am using Windows xp 64 bit, so I opened up DOS

3. "on Windows, open the Start menu then go to “Run...”, then put in cmd and press “OK”
    cd to the directory where you extracted the pymel zip file. A file called “setup.py” should exist directly below this directory.
In my Case is located here , "C:\Python26\pymel"

On Windows you can copy the path from Explorer and paste into the shell by right clicking. You don’t need to escape spaces.

4. In DOS I typed C:\"Python26\pymel>setup.py

"The step below is already confusing, Now, where is this located ?
5. Now run the installation for each version of Maya that you have installed using Maya’s own python interpreter – aka mayapy. This ensures that PyMEL is installed to the site-packages directory of each, and that it will always be on your PYTHONPATH when using Maya.
Maya’s own python interpreter – aka mayapy.???? WHAT.
RUN THE INSTALLATION, where is the exe file, run what?

6. Using the script editor I typed this out in the Python tab? MEL tab? I pasted it on both "C:\Program Files\Autodesk\Maya2009\bin\mayapy.exe" setup.py install

"C:\Program Files\Autodesk\Maya2009\bin\mayapy.exe" setup.py install;
// Error: "C:\Program Files\Autodesk\Maya2009\bin\mayapy.exe" setup.py install; //
// Error: Syntax error //


"C:\Program Files\Autodesk\Maya2009\bin\mayapy.exe" setup.py install;
// Error: "C:\Program Files\Autodesk\Maya2009\bin\mayapy.exe" setup.py install; //
// Error: Syntax error //
"C:\Program Files\Autodesk\Maya2009\bin\mayapy.exe" setup.py install;
// Error: "C:\Program Files\Autodesk\Maya2009\bin\mayapy.exe" setup.py install; //
// Error: Syntax error //
"C:\Program Files\Autodesk\Maya2009\bin\mayapy.exe" setup.py install;
# Error: ('invalid syntax', ('<maya console>', 2, 57, '"C:\\Program Files\\Autodesk\\Maya2009\\bin\\mayapy.exe" setup.py install;\n'))
#   File "<maya console>", line 1
#      "C:\Program Files\Autodesk\Maya2009\bin\mayapy.exe" setup.py install;
#                                                              ^
#

I couldn't really continue since I got stuck right there.

I have already set up the Environment Using Maya.env as well.

Cheers,

Martin

Matt Estela

unread,
Dec 22, 2009, 10:13:22 PM12/22/09
to python_in...@googlegroups.com
Gee Martin, I guess you should demand a full refund.

On Wed, Dec 23, 2009 at 10:48 AM, Martin La Land Romero

Paul Molodowitch

unread,
Dec 22, 2009, 10:22:33 PM12/22/09
to python_in...@googlegroups.com
You need to run that command from the command-line (DOS)... not from the script editor inside maya.

In your case, once you've opened up the shell, you would type the following three lines:

c:
cd C:\Python26\pymel

"C:\Program Files\Autodesk\Maya2009\bin\mayapy.exe" setup.py install

- Paul


ie, open up a shell


Martin La Land Romero

unread,
Dec 22, 2009, 11:15:31 PM12/22/09
to python_in...@googlegroups.com
Thanks paul however, this is the error message I get

"The system canno find the path specified"

Paul Molodowitch

unread,
Dec 22, 2009, 11:20:31 PM12/22/09
to python_in...@googlegroups.com
When executing which line?

If it happened here:

cd C:\Python26\pymel

.you need to substitute the path to where you unzipped pymel.

If it happened here:


"C:\Program Files\Autodesk\Maya2009\bin\mayapy.exe" setup.py install

...you need to substitute in the path to wherever you installed maya.

- Paul

Martin La Land Romero

unread,
Dec 22, 2009, 11:36:58 PM12/22/09
to python_in...@googlegroups.com
Thanks a lot, it seems to be working now...

Currently downloading a lot of stuff.

Cool, I'll keep you posted

Thanks thanks so much.


On Tue, Dec 22, 2009 at 8:15 PM, Martin La Land Romero <martin...@gmail.com> wrote:
Thanks paul however, this is the error message I get

"The system can find the path specified"

Martin La Land Romero

unread,
Dec 22, 2009, 11:41:42 PM12/22/09
to python_in...@googlegroups.com
Hello Paul,

It just finished installing a lot of stuff.

"Installed c:\program files\autodesk\maya2009\python\lib\site-packages\beautifulsoup-3.10 -py2.5.egg
Finished processing depencies for pymel == 1.0.0

Ok, I will continue now, I think this time is going to work.

Martin

Vitor Lôbo Ramos

unread,
Dec 23, 2009, 12:09:51 AM12/23/09
to python_inside_maya
It would be good use cases difficult to solve or even complicated to
understand, some kind soul made a short video tutorial showing how to
install pymel.

Programs easy to use for this:


http://www.baixaki.com.br/download/camtasia-studio.htm ( very much
used for many )
http://www.baixaki.com.br/download/autoscreenrecorder.htm ( little and
easy )

If I knew, he would do so.


On Dec 23, 1:41 am, Martin La Land Romero <martinmrom...@gmail.com>
wrote:


> Hello Paul,
>
> It just finished installing a lot of stuff.
>
> "Installed c:\program
> files\autodesk\maya2009\python\lib\site-packages\beautifulsoup-3.10
> -py2.5.egg
> Finished processing depencies for pymel == 1.0.0
>
> Ok, I will continue now, I think this time is going to work.
>
> Martin
>
> On Tue, Dec 22, 2009 at 8:36 PM, Martin La Land Romero <
>
>
>
> martinmrom...@gmail.com> wrote:
> > Thanks a lot, it seems to be working now...
>
> > Currently downloading a lot of stuff.
>
> > Cool, I'll keep you posted
>
> > Thanks thanks so much.
>
> > On Tue, Dec 22, 2009 at 8:15 PM, Martin La Land Romero <
> > martinmrom...@gmail.com> wrote:
>
> >> Thanks paul however, this is the error message I get
>
> >> "The system can find the path specified"
>

> >> On Tue, Dec 22, 2009 at 7:22 PM, Paul Molodowitch <elron...@gmail.com>wrote:
>
> >>> You need to run that command from the command-line (DOS)... not from the
> >>> script editor inside maya.
>
> >>> In your case, once you've opened up the shell, you would type the
> >>> following three lines:
>
> >>> c:
> >>> cd C:\Python26\pymel
>
> >>> "C:\Program Files\Autodesk\Maya2009\bin\mayapy.exe" setup.py install
>
> >>> - Paul
>
> >>> ie, open up a shell
>
> >>> On Tue, Dec 22, 2009 at 5:23 PM, Martin La Land Romero <
> >>> martinmrom...@gmail.com> wrote:
>
> >>>> Here you go,
>
> >>>> Ok, I'll tell you exactly what's going on.
>
> >>>> 1.I went to this website.
>

> >>>>http://www.luma-pictures.com/tools/pymel/docs/1.0/install.html#manual...

> >>>> On Tue, Dec 22, 2009 at 4:28 PM, Chad Dombrova <chad...@gmail.com>wrote:
>
> >>>>> did you go through the tutorial in "getting started"?
>
> >>>>> what errors are you getting? you're going to have to be more specific
> >>>>> than "These were the worse 3 hours of my life".
>
> >>>>> -chad
>
> >>>>> On Dec 22, 2009, at 6:50 PM, Martin La Land Romero wrote:
>
> >>>>> I spent like three hours trying to get this to work and nothing. Does
> >>>>> anyone has a more clear tuto.
> >>>>> Thanks
>
> >>>>> On Tue, Dec 22, 2009 at 3:48 PM, Martin La Land Romero <
> >>>>> martinmrom...@gmail.com> wrote:
>
> >>>>>> These were the worse 3 hours of my life. This thin won't work. I am
> >>>>>> using Maya 200964 bit, not sure if the explanations are correct, perhaps a
> >>>>>> little bit confusion.
>
> >>>>>> Sorry to be so sharp but it was a waste of time.
>
> >>>>>> On Tue, Dec 22, 2009 at 1:43 PM, Sylvain Berger <
> >>>>>> sylvain.ber...@gmail.com> wrote:
>
> >>>>>>> Superb! I looked at the what's new and this release looks great.
> >>>>>>> It's a shame that I have to move away from Maya scripting more and more :(
>

> >>>>>> martinmrom...@gmail.com


> >>>>>> (415)261-2172
>
> >>>>> --
> >>>>> Martin La Land Romero
> >>>>>www.martinromerovfx.com

> >>>>> martinmrom...@gmail.com

> >>>> martinmrom...@gmail.com

> >> martinmrom...@gmail.com


> >> (415)261-2172
>
> > --
> > Martin La Land Romero
> >www.martinromerovfx.com

> > martinmrom...@gmail.com

> martinmrom...@gmail.com
> (415)261-2172

Martin La Land Romero

unread,
Dec 23, 2009, 12:17:19 AM12/23/09
to python_in...@googlegroups.com
Hello Paul and everyone,

The installation went pretty well I guess however once in Maya 2009 64bit.
When I typed
from pymel.core import *
It starts importing a lot of stuff and after 20 seconds it crashes.
I have attached an image for you to see it.


2009/12/22 Vitor Lôbo Ramos <vitaumm...@gmail.com>
martin...@gmail.com
(415)261-2172
pymelCrash.jpg

martin...@gmail.com

unread,
Dec 23, 2009, 12:19:54 AM12/23/09
to python_inside_maya
I tried it again and it keeps crashing, not sure what's going on.

Martin

On Dec 22, 9:17 pm, Martin La Land Romero <martinmrom...@gmail.com>
wrote:


> Hello Paul and everyone,
>
> The installation went pretty well I guess however once in Maya 2009 64bit.
> When I typed
>
> from pymel.core import *
>
> It starts importing a lot of stuff and after 20 seconds it crashes.
> I have attached an image for you to see it.
>

> 2009/12/22 Vitor Lôbo Ramos <vitaummprima...@gmail.com>


>
>
>
> > It would be good use cases difficult to solve or even complicated to
> > understand, some kind soul made a short video tutorial showing how to
> > install pymel.
>
> > Programs easy to use for this:
>

> >http://www.baixaki.com.br/download/camtasia-studio.htm( very much
> > used for many )
> >http://www.baixaki.com.br/download/autoscreenrecorder.htm( little and

> martinmrom...@gmail.com
> (415)261-2172
>
>  pymelCrash.jpg
> 1131KViewDownload

Paul Molodowitch

unread,
Dec 23, 2009, 1:02:20 AM12/23/09
to python_in...@googlegroups.com
Hmm... odd. It's trying to regenerate the api cache files, which it shouldn't have to do.

Could you copy and paste this into the python script editor in maya, and let me know what it prints out?

import imp
import os
pymelDir = imp.find_module('pymel')[1]
print "pymelDir:", pymelDir
pymelContents = os.listdir(pymelDir)
print "contents:", pymelContents
cacheDir = os.path.join(pymelDir, 'cache')
foundCache = os.path.isdir(cacheDir)
print "cache dir present:", foundCache
if foundCache:
    cacheContents = os.listdir(cacheDir)
    print "cache contents:", cacheContents

- Paul


Chad Dombrova

unread,
Dec 23, 2009, 3:05:03 AM12/23/09
to python_in...@googlegroups.com

The installation went pretty well I guess however once in Maya 2009 64bit.
When I typed
from pymel.core import *
It starts importing a lot of stuff and after 20 seconds it crashes.
I have attached an image for you to see it.

hi Martin,
thanks for testing this out so early and getting us your feedback. turns out that there was a bug in install script.  my fault, sorry!  i've cleaned up the  installation instructions as well, split them by OS, and made them more explicit and straight-forward.  check them out and let me know what you think.


I also updated the what's new as i left out some nice new features.

-chad


cesar cardenas

unread,
Dec 22, 2009, 9:09:20 PM12/22/09
to python_in...@googlegroups.com
Hi chad, 
I would like to learn pymel but I don´t have a good level in mel and any experience in Python, so my question is, Is possible to learn pymel  If you have a basic level in Mel and Python?

cesar. 

rudi hammad

unread,
Dec 23, 2009, 8:45:51 AM12/23/09
to python_in...@googlegroups.com
Great!!!Thanks.I wish I had it 2 weeks ago,because of the indentation to organize layout for the UI.Really helpfull!

I am still having problem for autocompletition in eclipse,but it is probably my fault.It worked once,in a "magical"
ecplise sesion.I did the test of the docs,and it worked,but only once.
I should delete the maya.bin and the \pymel "whatever".egg right?...I´ll keep trying
R



Date: Tue, 22 Dec 2009 16:43:52 -0500
Subject: Re: [Maya-Python] PyMEL 1.0.0 Beta
From: sylvain...@gmail.com
To: python_in...@googlegroups.com
--
http://groups.google.com/group/python_inside_maya

¡Windows Phone ya está aquí! Mucho más que un teléfono. ¡Hazte con uno!

Martin La Land Romero

unread,
Dec 23, 2009, 3:45:20 PM12/23/09
to python_in...@googlegroups.com
Trying it again, I'll let you know how that goes, ok Chad?

I am really excited about this, I have been learning some python and I know some mel so this will be a good opurtunity to start creating some good stuff with Pymel.

Cheers,

Martin

Martin La Land Romero

unread,
Dec 23, 2009, 4:34:16 PM12/23/09
to python_in...@googlegroups.com
Ok Chad, it seems to be working just fine!

I have the professional version of Maxya Maya Scripter but when I run any pymel I get error messages, I guess it does not work with pymel so do I have to stick with the boring "script editor" I need syntax highlighting and all the good stuff.

Martin

Chad Dombrova

unread,
Dec 23, 2009, 4:57:00 PM12/23/09
to python_in...@googlegroups.com
sounds like you'll have to take that one up with the author of maxya

Martin La Land Romero

unread,
Dec 23, 2009, 5:02:16 PM12/23/09
to python_in...@googlegroups.com
Yeah, I'll email then and see what they say.

Thanks

Martin

Martin La Land Romero

unread,
Dec 23, 2009, 5:07:59 PM12/23/09
to python_in...@googlegroups.com
Do you have any other alternatives if Maxya does not work? what other IDE could I use?

David Shaw

unread,
Dec 24, 2009, 3:57:37 AM12/24/09
to python_in...@googlegroups.com
Exclipse with PyDev for an opensource one, for WingIDE for the other (they have a personal version as well, just without some of the bells and whistles)

Dave


Sylvain Berger

unread,
Dec 24, 2009, 8:25:10 AM12/24/09
to python_in...@googlegroups.com
Eclipse is my editor of choice.  I was on wing before. And some people here use Komodo.

Vitor Lôbo Ramos

unread,
Dec 24, 2009, 1:29:25 PM12/24/09
to python_inside_maya
I use notepad a lot of common windows, the ScriptEditor maya for
python and highlight syntax, use the Crimson editor.

On Dec 24, 10:25 am, Sylvain Berger <sylvain.ber...@gmail.com> wrote:
> Eclipse is my editor of choice. I was on wing before. And some people here
> use Komodo.
>
>
>
> On Thu, Dec 24, 2009 at 3:57 AM, David Shaw <flopp...@gmail.com> wrote:
> > Exclipse with PyDev for an opensource one, for WingIDE for the other (they
> > have a personal version as well, just without some of the bells and
> > whistles)
>
> > Dave
>
> > On Thu, Dec 24, 2009 at 8:07 AM, Martin La Land Romero <
> > martinmrom...@gmail.com> wrote:
>
> >> Do you have any other alternatives if Maxya does not work? what other IDE
> >> could I use?
>
> >> On Wed, Dec 23, 2009 at 2:02 PM, Martin La Land Romero <
> >> martinmrom...@gmail.com> wrote:
>
> >>> Yeah, I'll email then and see what they say.
>
> >>> Thanks
>
> >>> Martin
>

> >>> On Wed, Dec 23, 2009 at 1:57 PM, Chad Dombrova <chad...@gmail.com>wrote:
>
> >>>> sounds like you'll have to take that one up with the author of maxya
>
> >>>> On Dec 23, 2009, at 4:34 PM, Martin La Land Romero wrote:
>
> >>>> Ok Chad, it seems to be working just fine!
>
> >>>> I have the professional version of Maxya Maya Scripter but when I run
> >>>> any pymel I get error messages, I guess it does not work with pymel so do I
> >>>> have to stick with the boring "script editor" I need syntax highlighting and
> >>>> all the good stuff.
>
> >>>> Martin
>
> >>>> On Wed, Dec 23, 2009 at 12:45 PM, Martin La Land Romero <
> >>>> martinmrom...@gmail.com> wrote:
>
> >>>>> Trying it again, I'll let you know how that goes, ok Chad?
>
> >>>>> I am really excited about this, I have been learning some python and I
> >>>>> know some mel so this will be a good opurtunity to start creating some good
> >>>>> stuff with Pymel.
>
> >>>>> Cheers,
>
> >>>>> Martin
>

> >>>>> On Wed, Dec 23, 2009 at 12:05 AM, Chad Dombrova <chad...@gmail.com>wrote:
>
> >>>>>> The installation went pretty well I guess however once in Maya 2009
> >>>>>> 64bit.
> >>>>>> When I typed
>
> >>>>>> from pymel.core import *
>
> >>>>>> It starts importing a lot of stuff and after 20 seconds it crashes.
> >>>>>> I have attached an image for you to see it.
>
> >>>>>> hi Martin,
> >>>>>> thanks for testing this out so early and getting us your feedback.
> >>>>>> turns out that there was a bug in install script. my fault, sorry! i've
> >>>>>> cleaned up the installation instructions as well, split them by OS, and
> >>>>>> made them more explicit and straight-forward. check them out and let me
> >>>>>> know what you think.
>
> >>>>>> Beta2 is up here:http://pymel.googlecode.com/files/pymel-1.0.0b2.zip
>
> >>>>>> I also updated the what's new as i left out some nice new features.
>
> >>>>>> -chad
>
> >>>>>> --
> >>>>>>http://groups.google.com/group/python_inside_maya
>
> >>>>> --
> >>>>> Martin La Land Romero
> >>>>>www.martinromerovfx.com

> >>>>> martinmrom...@gmail.com


> >>>>> (415)261-2172
>
> >>>> --
> >>>> Martin La Land Romero
> >>>>www.martinromerovfx.com

> >>>> martinmrom...@gmail.com

> >>> martinmrom...@gmail.com


> >>> (415)261-2172
>
> >> --
> >> Martin La Land Romero
> >>www.martinromerovfx.com

> >> martinmrom...@gmail.com

JP

unread,
Dec 24, 2009, 3:52:17 PM12/24/09
to python_inside_maya
Hey Chad,

I've just upgraded via the easy install. So far so good!

I mentioned to you a couple weeks back the auto-rigging script I've
been working on - I'm going to convert it to be compatible with PyMel
1.0, and I'll release it once it's complete. Ever since converting
all those someNode.setScale() commands to someNode.scale.set(), I
haven't had any problems, so thanks again for that tip. I still have
a ton of error checking to implement, as right now there are some very
rigid requirements for joint orientation (amongst other things), and
I'll give the new UI indentation stuff a whirl.

On Dec 22, 3:53 pm, Chad Dombrova <c...@chadrikvon.com> wrote:
> hi all,
> we've been working hard on the next major release of PyMEL and it's ready to beta test!  check out what's new here:  http://www.luma-pictures.com/tools/pymel/docs/1.0/whats_new.html
>
> there are some fairly big changes so be sure to read the "what's new" section first and pay close attention to the "install" documentation, as it has changed since verion 0.9.x.  keep in mind that some of the docs are still in progress.
>
> there's also a new beta for 0.9.3 which provides pymel 1.0 forward compatibility
>

> downloads:http://pymel.googlecode.com/files/pymel-1.0.0b1.ziphttp://pymel.googlecode.com/files/pymel-0.9.3b1.zip

Chad Dombrova

unread,
Dec 24, 2009, 4:19:05 PM12/24/09
to python_in...@googlegroups.com

> I mentioned to you a couple weeks back the auto-rigging script I've
> been working on - I'm going to convert it to be compatible with PyMel
> 1.0, and I'll release it once it's complete.

sounds good. look forward to checking it out.

> Ever since converting
> all those someNode.setScale() commands to someNode.scale.set(), I
> haven't had any problems, so thanks again for that tip.

we made some adjustments to the api wrap in 1.0 that *may* remedy the setScale problem. would you mind putting those back in place and letting us know if you notice any more instabilities?

-chad

Martin La Land Romero

unread,
Dec 24, 2009, 4:39:29 PM12/24/09
to python_in...@googlegroups.com
Hello Chad,

I just wanted to let you know that Pymel is working just fine with Maya 2009 and 2010 64bit.
I have a question since I didn't hear anything yet from Maxya.
I have ActiveState Komodo IDE 4.4, how do I import the pymel module into Komodo?

Martin




--
Martin La Land Romero
www.martinromerovfx.com
martin...@gmail.com
(415)261-2172

Chad Dombrova

unread,
Dec 24, 2009, 5:32:37 PM12/24/09
to python_in...@googlegroups.com
i've never used komodo. maybe someone else on the list can help.

btw, the eclipse completion stubs included with the 1.0 beta are not working properly.  i've got a fix ready that i'll release shortly.  

lastly, the completion stub files in extras/completion are exactly the same as wing's .pi files.  just rename the py's to pi's.

-chad



Martin La Land Romero

unread,
Dec 24, 2009, 5:47:37 PM12/24/09
to python_in...@googlegroups.com
Thanks Chad

Martin La Land Romero

unread,
Dec 24, 2009, 6:13:26 PM12/24/09
to python_in...@googlegroups.com
I was working on this little tool, but the last part is not working, any hints.

#This tool isolate on and off the selected objects.
import pymel.core as pm #doctest: +SKIP

    #Get the current panel.
myPanel = pm.getPanel(withFocus=True)


#Get active panel type of.
myPanelType = pm.getPanel(type='myPanel')

#Create a conditon for when modelPanel is on or off.
if (myPanelType == 'modelPanel'):
    #Querry the isolation state.
    myIsoSel=pm.isolateSelect('myPanel', q=True, state=1)

#Create a condition that says, if IsolateSel is 0 set it to 1.
if(myIsoSel == 0):
    enableIsolateSelect('myPanel',state =1 )
else:
    enableIsolateSelect('myPanel', state =0)

Chad Dombrova

unread,
Dec 24, 2009, 8:08:03 PM12/24/09
to python_in...@googlegroups.com

    #Get the current panel.
myPanel = pm.getPanel(withFocus=True)


#Get active panel type of.
myPanelType = pm.getPanel(type='myPanel')

this does not query the type of the panel, it lists the panels of the given type. also, i think your intention was to pass the value of the variable myPanel from the previous query, but instead you passed the string 'myPanel'


Martin La Land Romero

unread,
Dec 24, 2009, 8:41:47 PM12/24/09
to python_in...@googlegroups.com
THis is my mel script

//Get the current panel.
string $myCurrenPane = `getPanel -withFocus`;

//Get the panel type.
string $panelType = `getPanel -to $myCurrenPane`;

//Condition.
if ($panelType == "modelPanel")
{

//Querry the isolation state.
    int $myIsolState = `isolateSelect -q -state $myCurrenPane`;

//Create a condition that says, if IsolateSel is 0 set it to 1.
if ($myIsolState == 0)
{
  enableIsolateSelect $myCurrenPane true;
 }

 else
 {
  enableIsolateSelect $myCurrenPane false;
  }
}

I am just trying to convert this to pymel so that I can get the hang of it. It does exactly what I want, which is to unhide and hide it.

Hope that helps clarify my point.

Martin

Martin La Land Romero

unread,
Dec 24, 2009, 8:42:59 PM12/24/09
to python_in...@googlegroups.com
You might be right, I am just getting used to the Pymel workflow, perhaps is even shorter than what I have there.

Martin

Miguel González Viñé

unread,
Dec 26, 2009, 6:49:29 AM12/26/09
to python_in...@googlegroups.com
Hi Chad, thanks for this new release!I don't know if you have changed
this or there's something wrong in 1.0.0b2, but when I create an
sphere or any other node I don't get the type before its name:

sphere1, hist = polySphere(name='mySphere')
grp = group(sphere1)
sphere1
# Result: group1|mySphere #

instead of:
Transform(u'group1|mySphere')


If I get the list of cameras in the scene it shows the node type:
ls(type='camera')
# Result: [nt.Camera(u'frontShape'), nt.Camera(u'perspShape'),
nt.Camera(u'sideShape'), nt.Camera(u'topShape')] #

but if I assign the first camera to a variable:
camF = ls(type='camera')[0]
camF
# Result: frontShape #

Also I can't get it with the type() function:
type(camF)
# Result:  #
print type(camF)
<class 'pymel.core.nodetypes.Camera'>
type("test")
# Result: <type 'str'> #
print type("test")
<type 'str'>

I'm doing something wrong?
Thanks!


On Tue, Dec 22, 2009 at 9:53 PM, Chad Dombrova <ch...@chadrikvon.com> wrote:
> hi all,
> we've been working hard on the next major release of PyMEL and it's ready to beta test!  check out what's new here:  http://www.luma-pictures.com/tools/pymel/docs/1.0/whats_new.html
>
> there are some fairly big changes so be sure to read the "what's new" section first and pay close attention to the "install" documentation, as it has changed since verion 0.9.x.  keep in mind that some of the docs are still in progress.
>
> there's also a new beta for 0.9.3 which provides pymel 1.0 forward compatibility
>
> downloads:
> http://pymel.googlecode.com/files/pymel-1.0.0b1.zip
> http://pymel.googlecode.com/files/pymel-0.9.3b1.zip
>
> docs:
> ttp://www.luma-pictures.com/tools/pymel/docs/1.0/
>
> let us know if you have any problems so we can fix them for the final release.
>
> -chad
>
>

> --
> http://groups.google.com/group/python_inside_maya

Martin La Land Romero

unread,
Dec 26, 2009, 11:13:53 AM12/26/09
to python_in...@googlegroups.com
Hello Chad,

This might sound like a lame question but I am just getting used to Pymel.

This is my line in MEL
I am trying to query the isolateSelect mode.
     int $myIsolState = `isolateSelect -q -state modelPanel4`;

This is Pymel,

myIsoState = pm.isolateSelect(q=True, state, modelPanel4)
I get this error
# SyntaxError: ('non-keyword arg after keyword arg', ('<maya console>', 2, None, None)) #

Not sure if it is because I don't have any arguments in the state, since that is the one that I need to query I left it blank.


2009/12/26 Miguel González Viñé <lich...@gmail.com>

Martin La Land Romero

unread,
Dec 26, 2009, 5:11:43 PM12/26/09
to python_in...@googlegroups.com
I just realized that I did not ask you the question!
how do we query the state?

myIsoState = pm.isolateSelect(q=True, state, modelPanel4)


Martin La Land Romero

unread,
Dec 26, 2009, 8:29:52 PM12/26/09
to python_in...@googlegroups.com
Never mind, I just set up the state=1 with the q=True and it seems to be working just fine
thanks

Chad Dombrova

unread,
Dec 27, 2009, 1:41:22 PM12/27/09
to python_in...@googlegroups.com

sphere1, hist = polySphere(name='mySphere')
grp = group(sphere1)
sphere1
# Result: group1|mySphere #


nothing has changed in his regard.  from the beginning, autodesk chose to deviate from standard python practice of using repr() to display results, instead they use str().  this inevitably leads to confusion. here's how you can get what you expect:

  print repr(sphere1)

this prints:

  nt.Transform(u'group1|mySphere')

here's a shorthand for the same thing:

  print `sphere1`

i need to clarify this in the tutorial.

-chad


Miguel González Viñé

unread,
Dec 28, 2009, 4:04:15 AM12/28/09
to python_in...@googlegroups.com
Thanks for the explanation, Chad.
I was following the tutorial and I was totally confused. There's a few
examples like:
cam = ls(type='camera')[0]
parent = cam.getParent()
trans = parent.getTranslation() # <---
trans
# Result: dt.Vector([28.0, 21.0, 28.0])

where I was trying to get dt.Vector and I was thinking there was a
problem in my installation or something wrong.

Thanks again,
miguel.

> --
> http://groups.google.com/group/python_inside_maya

JP

unread,
Jan 4, 2010, 6:55:24 AM1/4/10
to python_inside_maya
Hey all,

I had an easy time using the included installer, however I'm having a
little trouble with a manual installation (which I need to set up to
put the PyMEL resources on our network).

What I'm doing instead of altering the system environment variables or
maya.env is running a procedure within usersetup.py that inserts the
path to the top-level pymel-1.x.x directory to sys.path. Here is my
sys.path after inserting:

for p in sys.path: print p

C:/Users/John/Documents/maya/scripts/pymel-1.0.0b2
C:\Program Files\Autodesk\Maya2009\bin
C:\Program Files\Autodesk\Maya2009\bin
C:\Program Files\Autodesk\Maya2009\bin\python25.zip
C:\Program Files\Autodesk\Maya2009\Python\DLLs
C:\Program Files\Autodesk\Maya2009\Python\lib
C:\Program Files\Autodesk\Maya2009\Python\lib\plat-win
C:\Program Files\Autodesk\Maya2009\Python\lib\lib-tk
C:\Program Files\Autodesk\Maya2009\Python
C:\Program Files\Autodesk\Maya2009\Python\lib\site-packages
C:/Users/John/Documents/maya/2009-x64/prefs/scripts
C:/Users/John/Documents/maya/2009-x64/scripts
C:/Users/John/Documents/maya/scripts
C:/Users/John/Documents/maya/scripts/.svn
C:/Users/John/Documents/maya/scripts/aor
C:/Users/John/Documents/maya/scripts/comet
C:/Users/John/Documents/maya/scripts/dev
C:/Users/John/Documents/maya/scripts/gnomonStudios
C:/Users/John/Documents/maya/scripts/jasonSchleifer
C:/Users/John/Documents/maya/scripts/jp
C:/Users/John/Documents/maya/scripts/kevinPoly
C:/Users/John/Documents/maya/scripts/maya
C:/Users/John/Documents/maya/scripts/stopStarring
C:/Users/John/Documents/maya/scripts/toolsGeneral
C:/Users/John/Documents/maya/scripts/toolsRigging
C:/Users/John/Documents/maya/scripts/toolsScripting
C:/Users/John/Documents/maya/scripts/toolsTexture

After this, I try to import pymel.core, and get this error:
# Error: If you manually installed pymel, ensure that pymel comes
before Maya's site-packages directory on PYTHONPATH / sys.path. See
pymel docs for more info.

The docs recommend adding this top-level directory to the path, but I
also tried individually adding the pymel and maya subdirectories to
sys.path with the same result.

If anyone has any thoughts as to what's happening here, I'm all ears!
Thanks all!

-JP
On Dec 28 2009, 4:04 am, Miguel González Viñé <lichi...@gmail.com>
wrote:


> Thanks for the explanation, Chad.
> I was following the tutorial and I was totally confused. There's a few
> examples like:
>   cam = ls(type='camera')[0]
>   parent = cam.getParent()
>   trans = parent.getTranslation() # <---
>   trans
>   # Result: dt.Vector([28.0, 21.0, 28.0])
>
> where I was trying to get dt.Vector and I was thinking there was a
> problem in my installation or something wrong.
>
> Thanks again,
> miguel.
>

Sylvain Berger

unread,
Jan 4, 2010, 8:59:36 AM1/4/10
to python_in...@googlegroups.com
Try adding the path to the sys.path in a usersetup.mel instead of the usersetup.py

I had trouble with the usersetup.py, it gets evaluated later than the .mel one.

I made a init.py script that I launch in the usersetup.mel using the python() command

python("myInitScript()")

Hope this helps

JP

unread,
Jan 8, 2010, 11:29:30 AM1/8/10
to python_inside_maya
Well, I've been experimenting with this a bit and I'm still stumped.
I thought perhaps the problem was that in my usersetup.py I was
importing maya.utils before inserting the pymel directory to sys.path,
so I tried disabling usersetup.py and adding these lines to the top of
usersetup.mel:

string $pymelPath = "C:\\Users\\John\\Documents\\maya\\scripts\
\pymel-1.0.0b2";
python("import sys");
python("sys.path.insert(0,\"" + $pymelPath + "\")");

However, I still get the same error message when importing pymel.core.
The funny thing is that when I set up and place the pymel.pth file
(included in extras) into mayapy's site-packages folder, everything
works great. I'm not up to speed on the intricacies of .pth files,
but my impression is that it basically does the same thing? It looks
like this file adds the PyMEL directory to the path and then
rearranges sys.path so that PyMEL comes first.

So long story short, it *works*, just not exactly the way I'd prefer,
and I feel like there's some path-related magic I'm not quite
understanding. I'm moving on for now, but if anyone can enlighten me,
I'd very much appreciate it!

Paul Molodowitch

unread,
Jan 8, 2010, 11:52:19 AM1/8/10
to python_in...@googlegroups.com
I think the problem here is is the order of operations in which things are executed.

In this case, I think the maya module is being imported before userSetup.py/mel are run.  So, even though you change the path before pymel is run, it's already "too late" to affect where maya is imported from; so when pymel runs, and checks the maya module, it finds the wrong one.

The .pth file works because it's a standard python way of modifying the path, and so essentially happens as soon as python starts up, before any special maya python magic happens.

- Paul


John Patrick

unread,
Jan 8, 2010, 12:28:36 PM1/8/10
to python_in...@googlegroups.com
Thanks Paul, that makes sense.  I guess I should have just followed the instructions and modified my environment!




--
John Patrick
404-242-2675
jspa...@gmail.com
http://www.canyourigit.com

kjaft

unread,
Jan 13, 2010, 5:17:19 AM1/13/10
to python_inside_maya
Hello,
I have the same problem over here, using pymel 1.0 beta2 on Maya 2009
64 bit (no SP) on two different Linux computers (OpenSuse 10.2 x64,
Centos 5.1 x64) - Maya crashes (Segfault) when executing "from
pymel.core import *. In mayapy it works. Also in Maya 2010.

Executing the diagnostic script from below gives:
pymelDir: /home/felix/dev/pymel-1.0.0b2/pymel
contents: ['api', 'internal', 'cache', 'all.py', 'mayautils.py',
'pymel.conf', 'util', 'tools', 'versions.py', 'mayautils.pyc',
'__init__.py', 'core', 'versions.pyc', '__init__.pyc']
cache dir present: True
cache contents: ['mayaApi2010.zip', 'mayaApi2008.zip',
'mayaCmdsExamples2009.zip', 'mayaCmdsList2008.zip',
'mayaCmdsDocs2010.zip', 'mayaApiMelBridge.zip',
'mayaCmdsDocs2009.zip', 'mayaCmdsDocs2008.zip', 'mayaApi2009.zip',
'mayaCmdsList2010.zip', 'mayaCmdsExamples2008.zip',
'mayaCmdsExamples2010.zip', 'mayaCmdsList2009.zip']

Thanks
Felix

On 23 Dez. 2009, 07:02, Paul Molodowitch <elron...@gmail.com> wrote:
> Hmm... odd. It's trying to regenerate the api cache files, which it
> shouldn't have to do.
>
> Could you copy and paste this into the python script editor in maya, and let
> me know what it prints out?
>
> import imp
> import os
> pymelDir = imp.find_module('pymel')[1]
> print "pymelDir:", pymelDir
> pymelContents = os.listdir(pymelDir)
> print "contents:", pymelContents
> cacheDir = os.path.join(pymelDir, 'cache')
> foundCache = os.path.isdir(cacheDir)
> print "cache dir present:", foundCache
> if foundCache:
>     cacheContents = os.listdir(cacheDir)
>     print "cache contents:", cacheContents
>
> - Paul
>
> On Tue, Dec 22, 2009 at 9:19 PM, martinmrom...@gmail.com <
>
> martinmrom...@gmail.com> wrote:
> > I tried it again and it keeps crashing, not sure what's going on.
>
> > Martin
>
> > On Dec 22, 9:17 pm, Martin La Land Romero <martinmrom...@gmail.com>
> > wrote:
> > > Hello Paul and everyone,

Paul Molodowitch

unread,
Jan 13, 2010, 12:45:40 PM1/13/10
to python_in...@googlegroups.com
Hmm... crashiness is not so good.  Sorry to hear you're having problems.

If you'd like to help us figure out what's going on, go to your pymel directory (/home/felix/dev/pymel-1.0.0b/pymel in your case), and open up the pymel.conf file.

Change:

[handlers]
keys=consoleHandler

to:

[handlers]
keys=consoleHandler,fileLogger

Change:

[logger_pymel]
## Set the root 'pymel' logger to DEBUG mode
## Setting PYMEL_LOGLEVEL environment variable will override this
level=INFO
qualname=pymel
handlers=

to:

[logger_pymel]
## Set the root 'pymel' logger to DEBUG mode
## Setting PYMEL_LOGLEVEL environment variable will override this
level=DEBUG
qualname=pymel
handlers=fileLogger

... and add the following section:

[handler_fileLogger]
## This will output to a file, pymel.log
class=FileHandler
level=DEBUG
formatter=pymelFormatter
args=(os.path.expanduser('~/pymel.log'), 'w')

Then restart maya. After it crashes, there should be a '~/pymel.log' file. If you could send me that file, it could at least give us an idea about where it's crashing...

Thanks,
   Paul





Paul Molodowitch

unread,
Jan 14, 2010, 10:54:21 AM1/14/10
to python_inside_maya
Hey Felix... could you try unloading all your plugins before importing pymel, to see if it makes a difference?

In particular, it looks like it may be crashing after / during loading of the mental ray plugin... obviously, this is a problem if this is the case, but I'm just trying to get an idea of what's going on here...

- Paul


On Thu, Jan 14, 2010 at 12:27 AM, Felix Ulber <f.u...@web.de> wrote:
Hi Paul,
first of all thanks very much for your quick response and thanks for all the effort. Attached is the log file.

Best regards
Felix


Paul Molodowitch schrieb:

martin...@gmail.com

unread,
Jan 17, 2010, 3:54:28 AM1/17/10
to python_inside_maya
Hello Everyone,

Well finally I got Pymel version 1.0 working properly on Maya 2009 and
2010 64 bit, I know i had some problems in the beginning but After
getting Beta2 from Chad everything seem to be working
properly.Eclipse is also working properly with pymel. NOW, since this
is a public group I will continue to post all of my questions here,
regardless of how simpler my problems or issues are, sometimes we need
that experienced feed back, wink. I have been getting to involve with
pymel and I would like to continue playing with the tool and creating
stuff.Ok now, lets finally start using the tool.

Regards,

Martin

On Dec 24 2009, 5:25 am, Sylvain Berger <sylvain.ber...@gmail.com>
wrote:


> Eclipse is my editor of choice.  I was on wing before. And some people here
> use Komodo.
>
>
>
>
>
> On Thu, Dec 24, 2009 at 3:57 AM, David Shaw <flopp...@gmail.com> wrote:
> > Exclipse with PyDev for an opensource one, for WingIDE for the other (they
> > have a personal version as well, just without some of the bells and
> > whistles)
>
> > Dave
>
> > On Thu, Dec 24, 2009 at 8:07 AM, Martin La Land Romero <
> > martinmrom...@gmail.com> wrote:
>
> >> Do you have any other alternatives if Maxya does not work? what other IDE
> >> could I use?
>
> >> On Wed, Dec 23, 2009 at 2:02 PM, Martin La Land Romero <
> >> martinmrom...@gmail.com> wrote:
>
> >>> Yeah, I'll email then and see what they say.
>
> >>> Thanks
>
> >>> Martin
>

> >>> On Wed, Dec 23, 2009 at 1:57 PM, Chad Dombrova <chad...@gmail.com>wrote:
>
> >>>> sounds like you'll have to take that one up with the author of maxya
>
> >>>> On Dec 23, 2009, at 4:34 PM, Martin La Land Romero wrote:
>
> >>>> Ok Chad, it seems to be working just fine!
>
> >>>> I have the professional version of Maxya Maya Scripter but when I run
> >>>> any pymel I get error messages, I guess it does not work with pymel so do I
> >>>> have to stick with the boring "script editor" I need syntax highlighting and
> >>>> all the good stuff.
>
> >>>> Martin
>
> >>>> On Wed, Dec 23, 2009 at 12:45 PM, Martin La Land Romero <
> >>>> martinmrom...@gmail.com> wrote:
>
> >>>>> Trying it again, I'll let you know how that goes, ok Chad?
>
> >>>>> I am really excited about this, I have been learning some python and I
> >>>>> know some mel so this will be a good opurtunity to start creating some good
> >>>>> stuff with Pymel.
>
> >>>>> Cheers,
>
> >>>>> Martin
>

> >>>>> On Wed, Dec 23, 2009 at 12:05 AM, Chad Dombrova <chad...@gmail.com>wrote:
>
> >>>>>> The installation went pretty well I guess however once in Maya 2009
> >>>>>> 64bit.
> >>>>>> When I typed
>
> >>>>>> from pymel.core import *
>
> >>>>>> It starts importing a lot of stuff and after 20 seconds it crashes.
> >>>>>> I have attached an image for you to see it.
>
> >>>>>> hi Martin,
> >>>>>> thanks for testing this out so early and getting us your feedback.
> >>>>>> turns out that there was a bug in install script.  my fault, sorry!  i've
> >>>>>> cleaned up the  installation instructions as well, split them by OS, and
> >>>>>> made them more explicit and straight-forward.  check them out and let me
> >>>>>> know what you think.
>
> >>>>>> Beta2 is up here:http://pymel.googlecode.com/files/pymel-1.0.0b2.zip
>
> >>>>>> I also updated the what's new as i left out some nice new features.
>
> >>>>>> -chad
>
> >>>>>> --
> >>>>>>http://groups.google.com/group/python_inside_maya
>
> >>>>> --
> >>>>> Martin La Land Romero
> >>>>>www.martinromerovfx.com

> >>>>> martinmrom...@gmail.com


> >>>>> (415)261-2172
>
> >>>> --
> >>>> Martin La Land Romero
> >>>>www.martinromerovfx.com

> >>>> martinmrom...@gmail.com

> >>> martinmrom...@gmail.com


> >>> (415)261-2172
>
> >> --
> >> Martin La Land Romero
> >>www.martinromerovfx.com

> >> martinmrom...@gmail.com

Count Zer0

unread,
Jan 21, 2010, 1:34:51 AM1/21/10
to python_inside_maya
Posting for Drew Skillman of DoubleFine from tech-artists.org forum:

"We're running into some trouble with the new deployment scheme for
1.0. Specifically, pymel now needs to be imported prior to the maya
libs, which means it needs to appear before those maya libs in
sys.path.

This is actually tricky to accomplish if you already have PYTHONPATH
defined as an environment variable, and aren't in a position to change
it. This is because if PYTHONPATH is defined, adding it to the
maya.env does nothing (i'm using maya 2008 and carefully verified
this).

I can move the 2 necessary PyMel folders into the folder that's
currently defined in PYTHONPATH, but that's pretty ugly since our maya
tools are supposed to live elsewhere (not to mention the confusion of
having those 2 folders piled in with a bunch of other modules).

So my question for you guys is does anyone know another way to get
PyMel added to the system paths before the standard maya libs, without
relying on PYTHONPATH (or hacking the maya install itself)."

Any help would be appreciated, I'll post response in other forum if
anybody has a good solution.

-jason

Chad Dombrova

unread,
Jan 21, 2010, 2:16:22 AM1/21/10
to python_in...@googlegroups.com
hi zero,
we know this ordering can be a bit tricky to accomplish for those who are not using the "easy" install method, especially on a windows machine where PYTHONPATH might be set as a system environment variable that the user cannot override. to help out in these situations, we've added a third install option to the 1.0 docs, for those who have write access to their maya site-packages directory: http://www.luma-pictures.com/tools/pymel/docs/1.0/install.html#manual-method-3-pymel-pth

let us know if that does not solve the problem. there is another variant to this 3rd option that we haven't fully explored, but it would only work for maya 2010, since .pth location restrictions were relaxed in python 2.6.

-chad

> --
> http://groups.google.com/group/python_inside_maya

Drew

unread,
Jan 21, 2010, 3:18:20 PM1/21/10
to python_inside_maya
Hi Chad,

Thanks to you and Jason for helping me out here.

Do you know if .pth files can have env variables in them? Our pymel
install location will vary from project to project (all project data
is lumped under a project specific directory), so if i do hack the
maya install it would be great if it could play nice when you're
switching between projects.

Even if it does support env vars, i'm still not super comfortable
hacking the maya install itself. I prefer to keep all the maya
customization we do easily tractable from the maya.env. For example a
tools programmer troubleshooting problems a year from now and not
realizing that custom scripts/plugins are being referenced from the
install directory itself. That said, it sounds like the .pth is
probably our best option right now. (and fyi - i am using maya 2008).

For the record, my ideal option would be a PYMELPATH env var
(definable either though windows or the maya.env) that makes all this
magic sauce work. Though I'm sure there are some good reasons why
it's not setup that way.

Thx again!
Drew

On Jan 20, 11:16 pm, Chad Dombrova <chad...@gmail.com> wrote:
> hi zero,

> we know this ordering can be a bit tricky to accomplish for those who are not using the "easy" install method, especially on a windows machine where PYTHONPATH might be set as a system environment variable that the user cannot override.   to help out in these situations, we've added a third install option to the 1.0 docs, for those who have write access to their maya site-packages directory:  http://www.luma-pictures.com/tools/pymel/docs/1.0/install.html#manual...

Ian Jones

unread,
Jan 21, 2010, 7:51:56 PM1/21/10
to python_in...@googlegroups.com
Drew,

What I've been doing is using sitecustomize to inject pymel to the
front of the python path at startup. The `downside` is that pymel
shows up in the python path universally but some of the utils that are
included I've been learning/finding great use for in other places. The
Path class in particular - love that thing. So it's not really that
much of a `downside` after all.

Ian

> --
> http://groups.google.com/group/python_inside_maya
>

Chad Dombrova

unread,
Jan 21, 2010, 9:21:35 PM1/21/10
to python_in...@googlegroups.com
ian, can you provide some instructions on how to set this up that we can include in the docs?


Ian Jones

unread,
Jan 21, 2010, 9:35:11 PM1/21/10
to python_in...@googlegroups.com

Drew

unread,
Jan 25, 2010, 2:47:59 PM1/25/10
to python_inside_maya
Awesome - i've never used sitecustomize before so seeing an example of
how to set this up would be great. Thx ian!

On Jan 21, 6:35 pm, Ian Jones <i...@ambientdivide.com> wrote:
> Sure can
>
>
>
> On Thu, Jan 21, 2010 at 6:21 PM, Chad Dombrova <chad...@gmail.com> wrote:
> > ian, can you provide some instructions on how to set this up that we can
> > include in the docs?
>
> > On Thu, Jan 21, 2010 at 4:51 PM, Ian Jones <i...@ambientdivide.com> wrote:
>
> >> Drew,
>
> >> What I've been doing is using sitecustomize to inject pymel to the
> >> front of the python path at startup. The `downside` is that pymel
> >> shows up in the python path universally but some of the utils that are
> >> included I've been learning/finding great use for in other places. The
> >> Path class in particular - love that thing. So it's not really that
> >> much of a `downside` after all.
>
> >> Ian
>

Chad Dombrova

unread,
Jan 25, 2010, 2:50:52 PM1/25/10
to python_in...@googlegroups.com
i hope to have the official docs updated in a few days. in the
meantime, ian was nice enough to post his instructions here: http://github.com/shrtcww/pymel/blob/1e4d2fbab671445b21e89c0c7a6f2b7d2dd8538e/docs/source/install.rst

github automatically turns the restructuredText into html, which is
awesome.

-chad

> --
> http://groups.google.com/group/python_inside_maya

Drew

unread,
Jan 25, 2010, 8:12:30 PM1/25/10
to python_inside_maya
This worked great!

On Jan 25, 11:50 am, Chad Dombrova <chad...@gmail.com> wrote:
> i hope to have the official docs updated in a few days.  in the  

> meantime, ian was nice enough to post his instructions here:  http://github.com/shrtcww/pymel/blob/1e4d2fbab671445b21e89c0c7a6f2b7d...

Drew

unread,
Jan 25, 2010, 10:07:58 PM1/25/10
to python_inside_maya
This may deserve a separate thread, but now i'm running into crash
that seems to occur between pymel and our custom plugins. On the
quest to narrow down the problem, I was wondering if you guys would
expect to see this type of feedback on maya startup:

import pymel.core; pymel.core._pluginLoaded("COLLADA14")
import pymel.core; pymel.core._pluginLoaded("DFAnimation")
import pymel.core; pymel.core._pluginLoaded("DFMaterialNode")
import pymel.core; pymel.core._pluginLoaded("DFEditor")
import pymel.core; pymel.core._pluginLoaded("DFTreeControl")
import pymel.core; pymel.core._pluginLoaded("objExport")
import pymel.core; pymel.core._pluginLoaded("DFModelling")
import pymel.core; pymel.core._pluginLoaded("DFPhysics")
file -f -new;
// Result: ./untitled //
commandPort -securityWarning -name commandportDefault;
import pymel.core; pymel.core._pluginLoaded("Fur")
import pymel.core; pymel.core._pluginLoaded("studioImport")
import pymel.core; pymel.core._pluginLoaded("DirectConnect")
import pymel.core; pymel.core._pluginLoaded("ikSpringSolver")
import pymel.core; pymel.core._pluginLoaded("compositingInterop")
import pymel.core; pymel.core._pluginLoaded("VectorRender")
import pymel.core; pymel.core._pluginLoaded("rotateHelper")
import pymel.core; pymel.core._pluginLoaded("fbxmaya")
import pymel.core; pymel.core._pluginLoaded("ik2Bsolver")
updateRendererUI;

thx
drew

Drew

unread,
Jan 25, 2010, 10:13:55 PM1/25/10
to python_inside_maya
Sry - ignore that! I didn't realize that feedback was being generated
from the script editor plugin, that's what's actually causing the
crash. Np, i'll just remove it for now.

pymel-1.0.0rc1\pymel\tools\scriptEditor

Chad Dombrova

unread,
Jan 26, 2010, 12:30:49 PM1/26/10
to python_in...@googlegroups.com
unfortunately, the script editor is probably too fragile to continue
including with pymel. we should probably dump it for 1.0. maybe
bring it back in a 'contrib' directory later on.

-chad

> --
> http://groups.google.com/group/python_inside_maya

Count Zer0

unread,
Feb 4, 2010, 1:45:19 PM2/4/10
to python_inside_maya
Is there a better way to have multiple versions of pymel (.7 & 1.0)
installed and not have this at the top of every one of my scripts:

"
import maya.mel as mm
ver = mm.eval("getApplicationVersionAsFloat")
if ver >= 2008: from pymel.core import *
else: from pymel import *
"

We'll have multiple teams using different versions of Maya (some
possibly using Maya 8.5 which does not work w/ pymel 1.0). Each team
will be calling from scripts that will be importing pymel. I need to
make sure every script imports the right version of pymel at the top,
thus my hacky code above. Just a little bulky is all. I tried to
create a little module with those lines and call that, but then, of
course, pymel is not loaded into the namespace of the actual script
I'm trying to run.

Perhaps there is a larger view I'm missing? a better way to install
multiple versions of pymel for multiple versions of Maya and let users
all call from the same Maya Python scripts?

Thanks,

-jason

Paul Molodowitch

unread,
Feb 4, 2010, 11:24:42 PM2/4/10
to python_in...@googlegroups.com
Well, one possible solution would be to make your own pymel.all module, and stick it into the 0.7 install... and have it do a "from pymel import *"
Of course, this would mean that all the scripts using 1.0 would be using pymel.all instead of pymel.core... which is essentially fine, just a little bit slower / bulkier.
Out of curiosity, other than that issue, do your scripts seem to work pretty well across the 2 versions? There's been a lot of change since 0.7... are you using 0.7 compatibility mode?
- Paul


Chad Dombrova

unread,
Feb 5, 2010, 1:42:25 AM2/5/10
to python_in...@googlegroups.com
do you mean 0.7 or 0.9? because 0.7 is really old. on our downloads page we've posted 0.9.3, which is a beta version that is more forward compatible with 1.0 (it offers a pymel.all, just like 1.0). i think a bit more work might need to be done to 0.9.3 to make it more forward compatible (like adding pymel.core.nt and pymel.core.dt aliases) , but you're gonna have to ditch the 0.7 branch.

if you're using 0.9.3 and 1.0 then you can just do:

from pymel.all import *

both versions provide a converter that will change all imports of pymel to pymel.all.


-chad

> --
> http://groups.google.com/group/python_inside_maya

Count Zer0

unread,
Feb 5, 2010, 2:30:27 PM2/5/10
to python_inside_maya
I mean 0.7.8, we have teams still on 8.5. Guess I could try to enforce
a SP1 upgrade, and go w/ 0.9.

Maybe I'll try Paul's suggestion, just for kicks. See if it works.

-jason

Count Zer0

unread,
Feb 5, 2010, 4:24:07 PM2/5/10
to python_inside_maya
"
Manual Method 4: sitecustomize

...

4. save this file as sitecustomize.py somewhere in your system python
path.
"


Only the default maya install locations, (*) paths, seem to inject
pymel path early enough, so you might as well use Method 3: pymel.pth.


(*)C:\Program Files\Autodesk\Maya2008\bin
..
(*)C:\Program Files\Autodesk\Maya2008\Python\DLLs
(*)C:\Program Files\Autodesk\Maya2008\Python\lib
..
(*)C:\Program Files\Autodesk\Maya2008\bin
(*)C:\Program Files\Autodesk\Maya2008\Python
(*)C:\Program Files\Autodesk\Maya2008\Python\lib\site-packages
C:/Documents and Settings/jparks/My Documents/maya/2008/prefs/scripts
C:/Documents and Settings/jparks/My Documents/maya/2008/scripts/
C:/Documents and Settings/jparks/My Documents/maya/scripts

Putthing this in userSetup.mel does not work either:
python("import sys;sys.path.insert(0,'/path/to/top-pymel-dir');");

Nor does this in userSetup.mel:
putenv "PYTHONPATH" (`getenv "PYTHONPATH"` + ";/path/to/top-pymel-
dir");

Adding PYTHONPATH to Maya.env or the system's environment variable
seems to work, but that is a pain to do w/ install scripts.

Anybody know how to get pymel path inserted early enough w/
sitecustomize in a non-Maya install folder?

-jason

On Jan 25, 11:50 am, Chad Dombrova <chad...@gmail.com> wrote:

> i hope to have the official docs updated in a few days.  in the  

> meantime, ian was nice enough to post his instructions here:  http://github.com/shrtcww/pymel/blob/1e4d2fbab671445b21e89c0c7a6f2b7d...

Ian Jones

unread,
Feb 5, 2010, 4:37:36 PM2/5/10
to python_in...@googlegroups.com
I've been doing this for sometime with great success. We currently
insert pymel (from a network location) to the front of the path with
sitecustomize. What is in your sitecustomize.py file? and are you sure
that it is being executed?

I have a print at the top of mine which you should see in the output
window when you start maya. A nice check is that if that print happens
in the script editor it is being executed too late in the process to
make a different.

Ian

> --
> http://groups.google.com/group/python_inside_maya
>

Count Zer0

unread,
Feb 5, 2010, 7:05:39 PM2/5/10
to python_inside_maya
Ian,

Tried to reply earlier, but don't know if it went through. Google
groups delays the post sometimes.

My sitecustomize.py is just like the instructions:

import sys
sys.path.insert(0,'Y:/Tools/SOEmayaTools/python/pymel-1.0.0rc1')

It is only being executed in these default maya install paths:

(*)C:\Program Files\Autodesk\Maya2008\bin

(*)C:\Program Files\Autodesk\Maya2008\Python\DLLs
(*)C:\Program Files\Autodesk\Maya2008\Python\lib

(*)C:\Program Files\Autodesk\Maya2008\bin
(*)C:\Program Files\Autodesk\Maya2008\Python
(*)C:\Program Files\Autodesk\Maya2008\Python\lib\site-packages

but not in these:

C:/Documents and Settings/jparks/My Documents/maya/2008/prefs/scripts
C:/Documents and Settings/jparks/My Documents/maya/2008/scripts/
C:/Documents and Settings/jparks/My Documents/maya/scripts

nor in any other path added via any kind of userSetup.mel.

Where is your sitecustomize.py? Is it in one of those default install
paths or a custom path? and if it is in a custom path, how was it
added? via sys.path.append/insert or putenv PYTHONPATH?

Thanks for print to output tip.

Thanks,

-jason

Chad Dombrova

unread,
Feb 5, 2010, 7:14:47 PM2/5/10
to python_in...@googlegroups.com
hi zero,

> It is only being executed in these default maya install paths:
>
> (*)C:\Program Files\Autodesk\Maya2008\bin
> (*)C:\Program Files\Autodesk\Maya2008\Python\DLLs
> (*)C:\Program Files\Autodesk\Maya2008\Python\lib
> (*)C:\Program Files\Autodesk\Maya2008\bin
> (*)C:\Program Files\Autodesk\Maya2008\Python
> (*)C:\Program Files\Autodesk\Maya2008\Python\lib\site-packages
>
> but not in these:
>
> C:/Documents and Settings/jparks/My Documents/maya/2008/prefs/scripts
> C:/Documents and Settings/jparks/My Documents/maya/2008/scripts/
> C:/Documents and Settings/jparks/My Documents/maya/scripts

i believe that's because the last three are added by maya after it has
already begun it's startup process. check maya.app.startup.basic:

def setupScriptPaths():
"""
Add Maya-specific directories to sys.path
"""
# Extra libraries
#
try:
# Tkinter libraries are included in the zip, add that subfolder
p = [p for p in sys.path if p.endswith('.zip')][0]
sys.path.append( os.path.join(p,'lib-tk') )
except:
pass

# Per-version prefs scripts dir (eg .../maya8.5/prefs/scripts)
#
prefsDir = cmds.internalVar( userPrefDir=True )
sys.path.append( os.path.join( prefsDir, 'scripts' ) )

# Per-version scripts dir (eg .../maya8.5/scripts)
#
scriptDir = cmds.internalVar( userScriptDir=True )
sys.path.append( os.path.dirname(scriptDir) )

# User application dir (eg .../maya/scripts)
#
appDir = cmds.internalVar( userAppDir=True )
sys.path.append( os.path.join( appDir, 'scripts' ) )


On Feb 5, 2010, at 4:05 PM, Count Zer0 wrote:

> Ian,
>
> Tried to reply earlier, but don't know if it went through. Google
> groups delays the post sometimes.
>
> My sitecustomize.py is just like the instructions:
>
> import sys
> sys.path.insert(0,'Y:/Tools/SOEmayaTools/python/pymel-1.0.0rc1')
>
>
>

> --
> http://groups.google.com/group/python_inside_maya

Ian Jones

unread,
Feb 5, 2010, 7:26:14 PM2/5/10
to python_in...@googlegroups.com
Looks like what is inside your sitecustomize.py file is correct
(assuming the paths etc are all spelled correctly) which means that
the sitecustomize.py file is likely not in your PYTHONPATH by the time
maya starts. The folder containing sitecustomize must be in the
PYTHONPATH when the python interpreter is first initialized.

> --
> http://groups.google.com/group/python_inside_maya
>

Count Zer0

unread,
Feb 5, 2010, 7:38:03 PM2/5/10
to python_inside_maya
I agree Ian,

Are you hand-setting PYTHONPATH in all of your user's system
environment
variables (via windows System Properties-> Advanced -> Environment
Variables, etc.)?

or are you setting PYTHONPATH via Maya.env?
(which is my current plan to do, which means my install scripts
need to hack everybody's Maya.env upon install of our tools).

I tried to 'putenv PYTHONPATH 'via userSetup.mel scripts but it did
not put it
'quick enough', it is too late once it gets to userSetup.mel scripts.

Thanks,

-jason

On Feb 5, 4:26 pm, Ian Jones <i...@ambientdivide.com> wrote:
> Looks like what is inside your sitecustomize.py file is correct
> (assuming the paths etc are all spelled correctly) which means that
> the sitecustomize.py file is likely not in your PYTHONPATH by the time
> maya starts. The folder containing sitecustomize must be in the
> PYTHONPATH when the python interpreter is first initialized.
>

> ...
>
> read more »

Ian Jones

unread,
Feb 5, 2010, 7:46:23 PM2/5/10
to python_in...@googlegroups.com
Sort of.

I do set this at the operating system but not by hand but rather
another python script that configures the workstations (mapped drives,
environment variables, application installation etc).

This script is essentially our tools 'installer' and runs when artists
log into their machines. That way we can maintain the script and
artists machines apply the changes.

Ian

> --
> http://groups.google.com/group/python_inside_maya
>

Count Zer0

unread,
Feb 5, 2010, 8:06:06 PM2/5/10
to python_inside_maya
OK, that's what I suspected.

Just wanted to make sure there wasn't some easier way.

I think I'm going w/ Maya.env hack as the path needs to change per
version of Maya. I cannot have 1 path designated for the entire
machine.

Appreciate your responses,

-jason

On Feb 5, 4:46 pm, Ian Jones <i...@ambientdivide.com> wrote:
> Sort of.
>
> I do set this at the operating system but not by hand but rather
> another python script that configures the workstations (mapped drives,
> environment variables, application installation etc).
>
> This script is essentially our tools 'installer' and runs when artists
> log into their machines. That way we can maintain the script and
> artists machines apply the changes.
>
> Ian
>

> ...
>
> read more »

Message has been deleted

Judah Baron

unread,
Feb 6, 2010, 2:05:07 AM2/6/10
to python_in...@googlegroups.com
Does anyone use a launcher app? That's what we do. It sets all of our environment vars based on the run location and settings from an xml file. There is a small executable that knows how to find python (that way developers don't have to install python on their machines). It reads a configuration xml, sets some env vars, and calls a python Qt app that serves as our launch platform. We do all of our config  management this way, including running a small sitecustomize.py, and that gets us away from having to rely on Maya's mechanisms, such as Maya.env.

If people are interested in it I could make it available. It has made configuration a piece of cake for us.

On Fri, Feb 5, 2010 at 5:13 PM, Count Zer0 <coun...@gmail.com> wrote:
OK, that's what I suspected.

Just wanted to make sure there wasn't some easier way.

I think I'm going w/ Maya.env hack as the path needs to change per
version of Maya. I cannot have 1 path designated for the entire
machine.

Appreciate your responses,

-jason


On Feb 5, 4:46 pm, Ian Jones <i...@ambientdivide.com> wrote:
> Sort of.
>
> I do set this at the operating system but not by hand but rather
> another python script that configures the workstations (mapped drives,
> environment variables, application installation etc).
>
> This script is essentially our tools 'installer' and runs when artists
> log into their machines. That way we can maintain the script and
> artists machines apply the changes.
>
> Ian
>

David Shaw

unread,
Feb 6, 2010, 3:51:01 AM2/6/10
to python_in...@googlegroups.com
Have you tried defining an environment variable for MODULES?

I have a master modules folder with version sub-folders to support different projects running different version of maya.

Each version of Maya gets its own .env file which has the version specific module path before the main one
(The main folder is for version independant scripts etc)

eg:

MAYA_MODULE_PATH = D:/pipeline/maya/modules/2010/;D:/pipeline/maya/modules/;

Create a maya module definitions file save it as python_startup.txt

Add the following contents:

+ python_startup 2010 D:/pipeline/maya/modules/2010/python_startup

Create a folder called python_startup and another called scripts inside it

so:
python_startup
----scripts

Past the sitecustomze.py in the scripts folder.

Reload maya and after loading enter from pymel.all import *

and you should see # pymel.core : Updating pymel with pre-loaded plugins: DirectConnect, VectorRender, studioImport, Mayatomr, ikSpringSolver, rotateHelper, MayaMuscle, fbxmaya, ik2Bsolver #


David Shaw

unread,
Feb 6, 2010, 3:59:02 AM2/6/10
to python_in...@googlegroups.com
Sorry I forgot to add that I also define a user environment variable

I have it working this way on my machine here.

PYTHONPATH to D:/pipeline/python/site-packages/

which in turn as a pymel10 folder in it

Right now I have not tried multiple versions of pymel in the site-packages but you should be able to do add them and adjust the
sitecustomise.py in each versions module path.

Dave

Chad Dombrova

unread,
Feb 6, 2010, 4:25:25 PM2/6/10
to python_in...@googlegroups.com
yeah, you should open-source this.  it would be really awesome.


Ian Jones

unread,
Feb 6, 2010, 4:42:14 PM2/6/10
to python_in...@googlegroups.com
I've been toying around with a launcher app for awhile I'd love to see
what you have. Especially the xml backend to it.

> --
> http://groups.google.com/group/python_inside_maya

Keir

unread,
Feb 7, 2010, 6:47:28 PM2/7/10
to python_inside_maya
Yes do the same thing,
Our version is a C# app that parses an xml launcher definition, sets
environmental variables, copies files and launches Maya.
We have a global definition that does all our common scripts and
plugins.
The project specific definitions include the global and make
overrides.

The main advantage of this system being that the Maya install stays
nice and clean. All the scripts and plugins get linked up by the
launcher at run time.
This lets our artist switch projects with out the worry of version
miss-matches or conflicts.

> > > >> >>>>>>>>>> maya install it would be great if it could...
>
> read more »

Matt Estela

unread,
Feb 7, 2010, 11:25:42 PM2/7/10
to python_in...@googlegroups.com
We use a launcher here, pretty useful. Tied into our asset tracking
system too, so anything rendered not only has a dependency graph of
the scenes and references used to create it, but versions of software,
versions of script paths, versions of libraries.... everything. Means
we never get stuck with the 'but this shot used to render!' problem,
as resurrecting an old shot also resurrects all the versions of all
the tools and scripts used when that frame ran.

On Mon, Feb 8, 2010 at 10:47 AM, Keir <keir...@gmail.com> wrote:
> Yes do the same thing,
> Our version is a C# app that parses an xml launcher definition, sets
> environmental variables, copies files and launches Maya.

<snip>

f.michal

unread,
Feb 9, 2010, 10:56:44 AM2/9/10
to python_in...@googlegroups.com
Hello everybody,
I really got interested in this 'launcher' thing, as this is similar to
what I've done here. I too have mini py scripts that reads envvars from
configuration file, and launches maya.
However I was unable to boot maya on a machine, that had maya never
installed before. I downloaded all missing DLLs and set relevant paths,
but still, maya won't launch. Has anybody experience with such problem ?
Here's a fragment of conf file showing maya part (${SERVER} is an envvar
pointing to server keeping maya entire maya directory):

#maya
MF_SKIP_INSTALL_SHARED= 1
MAYA_LOCATION=//${SERVER}/RenderfarmConf/Apps/Maya/${PLATFORM}/2009ServicePack1
MAYA_SCRIPT_PATH=${DELIGHT}/maya/scripts;//hal/RenderfarmConf/Maya/scripts;${MAYA_SCRIPT_PATH}
MAYA_PLUG_IN_PATH=${DELIGHT}/maya/plugins;//hal/RenderfarmConf/Maya/plugins/${PLATFORM}/2009;${MAYA_PLUG_IN_PATH}
MAYA_HELP_URL=C:\Program Files\Autodesk\Maya2009\docs\Maya2009\en_US
AW_JPEG_Q_FACTOR=85
PATH=//${SERVER}/RenderfarmConf/Apps/Maya/${PLATFORM}/2009ServicePack1/bin;${PATH}


I have to add, that under linux, this setup is fully functional. I have
no idea what maya needs to properly boot. I use dependency tracking tool
to find all missing DLLS and put them in maya/bin and system32 dirs.

any hints are greatly appreciated, as I have run out of ideas.
thanks
Michal Fratczak

Matt Estela pisze:

Reply all
Reply to author
Forward
0 new messages