Am Freitag, 10. September 2010 19:20:24 UTC+2 schrieb hapgilmore:
> 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?

Hello I have had the same problem with Pymel for Maya 2015.
What I wanted to do is to start mayapy.exe as a new process from C# and relink 
the standard I/O back to C#. It worked out when I was loading packages from the 
from maya-module, it always hung up when I tried to implement pymel.core.
Our pipeline highly depends on Pymel so using cmds is not an option.
Interesting fact: Without rerouting the standard I/O this works very well, so 
importing pymel.core did not gave me any freeze. Unfortunately not having an 
output is no option in this project.

What I did was to set the "RedirectStandardError" Flag to false, thus the 
process-call looks like:

ProcessStartInfo PythonStartInfo = new ProcessStartInfo()
{
   FileName = "C:/Program Files/Autodesk/Maya2015/bin/mayapy.exe",
   Arguments = this.OutputScriptPath + " " + this.AssetPath,
   //CreateNoWindow = true,
   UseShellExecute = false,
   RedirectStandardInput = true,
   RedirectStandardOutput = true,
   RedirectStandardError = false
};
MayaPythonProc = new Process();
MayaPythonProc.StartInfo = PythonStartInfo;

After calling it that way I'm able to get the output from python and use input 
data from C# directed to python as well.

I'm posting this cause it might give you an idea why the server-stuff did not 
work out the way you wanted and maybe someone else is currently trying what I'm 
doing here.

Best regards

Mirko

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/ae07138c-1e88-4584-a1c9-1a5d046ede68%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to