I'd like to run a Maya Python Script (NOT a single Python command) from within 
my userSetup.mel script. The Python script is simple but does use some 
Maya-specific commands. The Pythong script for testing is:

#Python script:
import maya.cmds as cmds
Returned=cmds.fileDialog(mode=1, title="Save Layer/Pass list for Miranda:")



The closest I've gotten to running it from MEL is something like:

//Within the MEL Script:
python (exec("\\Server\MyFolder\SaveLPLFile.py"));


I've tried various cnfigurations of \\, \\\\, //, etc to accomodate the 
potential errors of escape characters but nothing seems to have any effect. The 
python/exec command appears to run without error (to the Maya console) but the 
actual script is not running because a cmds.fileDialog() never appears. Even 
when there is a typo in the filename the command appears to run.....apparently 
there is some long-standing bug in python that doesn't return an error message 
properly under some instances.

Any alternatives that might be a better method of running a Python script from 
within MEL?




-- 
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/231755dc-700c-4961-bc54-1a214ac0fc75%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to