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 <[email protected]> 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 ([email protected]) or I ([email protected])
> 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 <[email protected]> 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 <[email protected]>
> > 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 <[email protected]> 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 service?
>
> > > --
> > >http://groups.google.com/group/python_inside_maya
>
> > --
> >http://groups.google.com/group/python_inside_maya

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

Reply via email to