Re: [Maya-Python] Re: pymel in mayapy.exe hanging

2010-09-22 Thread Paul Molodowitch
Hey there - first of all, I'm sorry I didn't notice your earlier issue.  We
try to scan this list for pymel related stuff and respond, but sometimes we
miss stuff...

However, regarding some of your questions about pymel support: well, there
is no official support.  It is still being actively developed, and we try to
get to tickets when we can but having said that, we don't receive any
money for pymel, so our time is essentially donated to the project, and
sometimes we simply don't have much time to devote to pymel.  There is a
chance that you will have to end up troubleshooting on your own though - all
of pymel is open source, and it's all python, so you should be able to use
all the usual python-debugging tricks.

It can help to email Chad (chad...@gmail.com) or I (elron...@gmail.com)
directly... particularly if you want to let us know about something urgent /
important for your project / pipe.

Anyway, to the issue at hand - my guess is that Chris is on the right track
- it's probably the process of starting maya itself that's causing the
problem.  Ie, does doing this:

import maya.standalone
maya.standalone.initialize()

...in your service also result in a crash? If so, that's the issue...
whenever pymel.core is imported, if maya isn't already running, it tries to
start it by doing the above two lines (as pymel.core requires a running maya
to do anything).

If that isn't it, I'll try to figure out what's wrong when I get home later
tonight.  Also, some general debugging stuff you can try:

1) enable pymel logging

To do this, go to your pymel directory (if you're using the default install,
somewhere inside the maya install... don't remember where exactly it puts it
in windows, but I think it's in %MAYA_INSTALLATION%\Python...), and find the
file called pymel.conf.  You'll need to either edit this in this location,
or copy it to your home directory... (if no %HOME% environment variable is
defined, you'll need to define that...), or define a %PYMEL_CONF%
environment var, and have it contain the location of wherever you'd like
you're pymel.conf to be.

Once you've got that, you'll need to add 'fileLogger' to the logger_pymel
handlers... ie, change this:

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

to this:

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

Once you've done that, pymel should log stuff to your homeDir/pymel.log...
which may at least give us an idea of how far it gets before it crashes.

Another option would be:

2) Remote debugging

More powerful / useful, but you'll need an IDE that supports it (and can
also be more involved to get working).  Both eclipse and Wing support remote
debugging; exactly how to go about setting it up depends on what IDE you're
using.  For eclipse + pydev, the process is explained here:

http://pydev.org/manual_adv_remote_debugger.html

...but the basic idea is that you'd insert code like this:

import sys
sys.path.append(r'D:\bin\eclipse_36_final\plugins\org.python.pydev.debug_1.6.1.2010072814\pysrc')
import pydevd
pydevd.settrace()

...into wherever you're importing pymel.core, right before the pymel.core
import.  Then you'd fire up eclipse, and go to the python debugging view,
and click on the button to hook up to a remote debugging session.

- Paul

On Tue, Sep 21, 2010 at 5:22 PM, Chris G cgreb...@gmail.com wrote:

 It might be that maya can't run as a windows service.  I'm not
 familiar with windows services, but there must be a way to edit the
 security policies ?


 On Tue, Sep 21, 2010 at 3:29 PM, hapgilmore hapgilm...@hotmail.com
 wrote:
  I posted this bug on the pymel issues page. (http://code.google.com/p/
  pymel/issues/list) Haven't had a reply in a week. (I posted a bug a
  year ago, still no reply)
  Also, I filed a bug with autodesk through our studio's support
  contract.  Autodesk said i'm S.O.L, as pymel isn't supported.
 
  What do you guys recommend to get any help/support with pymel bugs.
  Now that my studio is starting to use pymel more, are we at risk
  depending on an unsupported tool?  Do you guys just get used to
  solving issues on your own?
 
  On Sep 10, 11:20 am, hapgilmore hapgilm...@hotmail.com wrote:
  I'm trying to set up an automated asset testing service on a server.
 
  We use TeamCity to run a python script, which in turn imports pymel
  and starts a maya shell to perform the asset testing.
 
  TeamCity runs the python script under a Windows Service (which has
  limited access to windows resources) , and it appears that something
  about this method causes the import pymel.core as pm command to hang
  mayapy.exe.
 
  Running the python script on the server from the command line works
  fine.
 
  Any ideas what pymel could be accessing that wouldn't work when run as
  part of a 

[Maya-Python] Re: pymel in mayapy.exe hanging

2010-09-22 Thread hapgilmore
Thanks for the suggestions, I really appreciate your help.

I am already remote debugging with Wing, though I could never get a
connection on the server.

I spent a couple hours yesterday setting up my local machine to
replicate the environment on the server.  It turns out that because
the Windows Service isn't run as a regular user with regular
permissions, maya standalone won't launch.
On my local machine, the service pops up a warning (from the maya
instance) that a valid MAYA_APP_DIR can be found.
I assume that because I was using a remote desktop connection to the
server, I never sawt the pop-up, and the process wasn't really
hanging, just waiting for user input.

Now I just need to figure out how to give maya a valid MAYA_APP_DIR
under a service, which doesn't have the same user/system permissions
that a regular user login gives.

-Ian



On Sep 22, 11:48 am, Paul Molodowitch elron...@gmail.com wrote:
 Hey there - first of all, I'm sorry I didn't notice your earlier issue.  We
 try to scan this list for pymel related stuff and respond, but sometimes we
 miss stuff...

 However, regarding some of your questions about pymel support: well, there
 is no official support.  It is still being actively developed, and we try to
 get to tickets when we can but having said that, we don't receive any
 money for pymel, so our time is essentially donated to the project, and
 sometimes we simply don't have much time to devote to pymel.  There is a
 chance that you will have to end up troubleshooting on your own though - all
 of pymel is open source, and it's all python, so you should be able to use
 all the usual python-debugging tricks.

 It can help to email Chad (chad...@gmail.com) or I (elron...@gmail.com)
 directly... particularly if you want to let us know about something urgent /
 important for your project / pipe.

 Anyway, to the issue at hand - my guess is that Chris is on the right track
 - it's probably the process of starting maya itself that's causing the
 problem.  Ie, does doing this:

 import maya.standalone
 maya.standalone.initialize()

 ...in your service also result in a crash? If so, that's the issue...
 whenever pymel.core is imported, if maya isn't already running, it tries to
 start it by doing the above two lines (as pymel.core requires a running maya
 to do anything).

 If that isn't it, I'll try to figure out what's wrong when I get home later
 tonight.  Also, some general debugging stuff you can try:

 1) enable pymel logging

 To do this, go to your pymel directory (if you're using the default install,
 somewhere inside the maya install... don't remember where exactly it puts it
 in windows, but I think it's in %MAYA_INSTALLATION%\Python...), and find the
 file called pymel.conf.  You'll need to either edit this in this location,
 or copy it to your home directory... (if no %HOME% environment variable is
 defined, you'll need to define that...), or define a %PYMEL_CONF%
 environment var, and have it contain the location of wherever you'd like
 you're pymel.conf to be.

 Once you've got that, you'll need to add 'fileLogger' to the logger_pymel
 handlers... ie, change this:

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

 to this:

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

 Once you've done that, pymel should log stuff to your homeDir/pymel.log...
 which may at least give us an idea of how far it gets before it crashes.

 Another option would be:

 2) Remote debugging

 More powerful / useful, but you'll need an IDE that supports it (and can
 also be more involved to get working).  Both eclipse and Wing support remote
 debugging; exactly how to go about setting it up depends on what IDE you're
 using.  For eclipse + pydev, the process is explained here:

 http://pydev.org/manual_adv_remote_debugger.html

 ...but the basic idea is that you'd insert code like this:

 import sys
 sys.path.append(r'D:\bin\eclipse_36_final\plugins\org.python.pydev.debug_1. 
 6.1.2010072814\pysrc')
 import pydevd
 pydevd.settrace()

 ...into wherever you're importing pymel.core, right before the pymel.core
 import.  Then you'd fire up eclipse, and go to the python debugging view,
 and click on the button to hook up to a remote debugging session.

 - Paul



 On Tue, Sep 21, 2010 at 5:22 PM, Chris G cgreb...@gmail.com wrote:
  It might be that maya can't run as a windows service.  I'm not
  familiar with windows services, but there must be a way to edit the
  security policies ?

  On Tue, Sep 21, 2010 at 3:29 PM, hapgilmore hapgilm...@hotmail.com
  wrote:
   I posted this bug on the pymel issues page. (http://code.google.com/p/
   pymel/issues/list) Haven't had a reply in a week. (I posted a bug a
   year ago, still no reply)
   Also, I filed a bug 

Re: [Maya-Python] Re: pymel in mayapy.exe hanging

2010-09-22 Thread John Creson
you could possibly put it into a Maya.env file...

http://download.autodesk.com/us/maya/2011help/files/Environment_Variables_Setting_environment_variables_using_Maya.env.htm

On Wed, Sep 22, 2010 at 2:26 PM, hapgilmore hapgilm...@hotmail.com wrote:
 Thanks for the suggestions, I really appreciate your help.

 I am already remote debugging with Wing, though I could never get a
 connection on the server.

 I spent a couple hours yesterday setting up my local machine to
 replicate the environment on the server.  It turns out that because
 the Windows Service isn't run as a regular user with regular
 permissions, maya standalone won't launch.
 On my local machine, the service pops up a warning (from the maya
 instance) that a valid MAYA_APP_DIR can be found.
 I assume that because I was using a remote desktop connection to the
 server, I never sawt the pop-up, and the process wasn't really
 hanging, just waiting for user input.

 Now I just need to figure out how to give maya a valid MAYA_APP_DIR
 under a service, which doesn't have the same user/system permissions
 that a regular user login gives.

 -Ian



 On Sep 22, 11:48 am, Paul Molodowitch elron...@gmail.com wrote:
 Hey there - first of all, I'm sorry I didn't notice your earlier issue.  We
 try to scan this list for pymel related stuff and respond, but sometimes we
 miss stuff...

 However, regarding some of your questions about pymel support: well, there
 is no official support.  It is still being actively developed, and we try to
 get to tickets when we can but having said that, we don't receive any
 money for pymel, so our time is essentially donated to the project, and
 sometimes we simply don't have much time to devote to pymel.  There is a
 chance that you will have to end up troubleshooting on your own though - all
 of pymel is open source, and it's all python, so you should be able to use
 all the usual python-debugging tricks.

 It can help to email Chad (chad...@gmail.com) or I (elron...@gmail.com)
 directly... particularly if you want to let us know about something urgent /
 important for your project / pipe.

 Anyway, to the issue at hand - my guess is that Chris is on the right track
 - it's probably the process of starting maya itself that's causing the
 problem.  Ie, does doing this:

 import maya.standalone
 maya.standalone.initialize()

 ...in your service also result in a crash? If so, that's the issue...
 whenever pymel.core is imported, if maya isn't already running, it tries to
 start it by doing the above two lines (as pymel.core requires a running maya
 to do anything).

 If that isn't it, I'll try to figure out what's wrong when I get home later
 tonight.  Also, some general debugging stuff you can try:

 1) enable pymel logging

 To do this, go to your pymel directory (if you're using the default install,
 somewhere inside the maya install... don't remember where exactly it puts it
 in windows, but I think it's in %MAYA_INSTALLATION%\Python...), and find the
 file called pymel.conf.  You'll need to either edit this in this location,
 or copy it to your home directory... (if no %HOME% environment variable is
 defined, you'll need to define that...), or define a %PYMEL_CONF%
 environment var, and have it contain the location of wherever you'd like
 you're pymel.conf to be.

 Once you've got that, you'll need to add 'fileLogger' to the logger_pymel
 handlers... ie, change this:

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

 to this:

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

 Once you've done that, pymel should log stuff to your homeDir/pymel.log...
 which may at least give us an idea of how far it gets before it crashes.

 Another option would be:

 2) Remote debugging

 More powerful / useful, but you'll need an IDE that supports it (and can
 also be more involved to get working).  Both eclipse and Wing support remote
 debugging; exactly how to go about setting it up depends on what IDE you're
 using.  For eclipse + pydev, the process is explained here:

 http://pydev.org/manual_adv_remote_debugger.html

 ...but the basic idea is that you'd insert code like this:

 import sys
 sys.path.append(r'D:\bin\eclipse_36_final\plugins\org.python.pydev.debug_1. 
 6.1.2010072814\pysrc')
 import pydevd
 pydevd.settrace()

 ...into wherever you're importing pymel.core, right before the pymel.core
 import.  Then you'd fire up eclipse, and go to the python debugging view,
 and click on the button to hook up to a remote debugging session.

 - Paul



 On Tue, Sep 21, 2010 at 5:22 PM, Chris G cgreb...@gmail.com wrote:
  It might be that maya can't run as a windows service.  I'm not
  familiar with windows services, but there must be a way to edit the
  security policies ?

  On Tue, 

[Maya-Python] getting a node's typeID

2010-09-22 Thread Chad Dombrova
i've searched for this before without avail, but it's biting me again in a 
different context, so i thought i'd check:

is there a way to get the typeId of a node without having an existing instance 
of the node?

i would expect a static method on MFnDependencyNode, like the following:

MFnDependencyNode.getTypeId('transform')

but i can't find anything

-chad


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


[Maya-Python] MFnRotateManip world space

2010-09-22 Thread Chad Vernon
I'm implementing a custom rotate manipulator and I'm having trouble
converting the manipValues in world space mode to the proper values. The
documentation says that in world space mode, the manipValues are the same as
in object mode while the manipulator stays in the default (world space)
position.

Has anyone had experience implementing world space rotation with
MFnRotateManip?

Thanks,
Chad

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

Re: [Maya-Python] getting a node's typeID

2010-09-22 Thread Jan Berger


there is MFnDependencyNode::typeId()
to get it for a specific node type I guess one would need to use the 
create function beforehand



At 08:26 PM 9/22/2010, you wrote:
i've searched for this before without avail, but it's biting me 
again in a different context, so i thought i'd check:


is there a way to get the typeId of a node without having an 
existing instance of the node?


i would expect a static method on MFnDependencyNode, like the following:

MFnDependencyNode.getTypeId('transform')

but i can't find anything

-chad


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


Jan Berger
j...@janberger.de :: www.janberger.de  


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

Re: [Maya-Python] getting a node's typeID

2010-09-22 Thread Chad Dombrova

On Sep 22, 2010, at 9:39 PM, Jan Berger wrote:

 
 there is MFnDependencyNode::typeId() 
 to get it for a specific node type I guess one would need to use the create 
 function beforehand

yes, it's not a static/class method so the MFnDependencyNode class needs to be 
instantiated to use that method... meaning you need an existing node.  i've 
done some very nasty things using dg modifiers to create ghosedt nodes that 
do not yet exist to find out their type, the revert the dgmod, but i'd rather 
not have to do that.

-chad



 
 
 At 08:26 PM 9/22/2010, you wrote:
 i've searched for this before without avail, but it's biting me again in a 
 different context, so i thought i'd check:
 
 is there a way to get the typeId of a node without having an existing 
 instance of the node?
 
 i would expect a static method on MFnDependencyNode, like the following:
 
  MFnDependencyNode.getTypeId('transform')
 
 but i can't find anything
 
 -chad
 
 
 -- 
 http://groups.google.com/group/python_inside_maya
 Jan Berger  
 j...@janberger.de :: www.janberger.de
 
 
 -- 
 http://groups.google.com/group/python_inside_maya

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