Yeah I have python 2.5 installed on my system.
That shouldn't be a problem right?
I just copy & pasted the script directly into my command edittor and executed it.
I assume that everything that is executed in there should be global.
I tried this:
in mel:
CODE
global proc importImage(string $f, string $m){
print "Woohoo";
}
in python:
CODE
import maya.cmds as cmds
cmds.fileBrowserDialog( m=0, fc='importImage', ft='image', an='Import_Image', om='Import' )
which prints out: woohoo.
now in python without the quotations:
CODE
import maya.cmds as cmds
def importImage( fileName, fileType):
cmds.file( fileName, i=True );
return 1
cmds.fileBrowserDialog( m=0, fc=importImage, ft='image', an='Import_Image', om='Import' )
Which returns an error:
# Error: "C:/Documents and Settings/maya/Desktop/bpw_test1.0275.iff" "image"; #
# Error: Line 1.1: Syntax error #
The command calls to the python procedure like this:
importImage "C:/Documents and Settings/maya/Desktop/bpw_test1.0275.iff" "image"
which is cool in MEL, but in python should be like this:
importImage("C:/Documents and Settings/maya/Desktop/bpw_test1.0275.iff", "image")
the last one works when I execute it manually in the editor.
Do you think there is a way past this syntax problem?