Did some searching of the archives, people say this is supposed to work:
import maya.cmds as cmds
def importImage(fileName, fileType):
print "I am here\n"
print fileName
return 1
cmds.fileBrowserDialog( m=0, fc=importImage, ft='image',
an='Import_Image', om='Import' )
But I get the same syntax error. Looks like it's interpreting as if it were MEL?
On Wed, Jul 21, 2010 at 1:18 PM, Alan Fregtman <[email protected]> wrote:
> The provided example from the docs gives me an error:
> -----------------------
> import pymel.core as pm
>
> def importImage( fileName, fileType):
> pm.file( fileName, i=True );
> return 1
>
> pm.fileBrowserDialog( m=0, fc=importImage, ft='image',
> an='Import_Image', om='Import' )
>
> # Error: <function callback at 0x00000000468F9898> "D:/test.tga" "image"; #
> # Error: Line 1.1: Syntax error #
> -----------------------
>
> Also, what's the difference between the fileCommand (fc) and the
> actionName (an)?
> (fc) is "script to run on command action" and (an) is "script to be
> called when the file is validated."
>
> Sounds like almost the same thing to me. Is one of them optional?
>
> Any help appreciated.
> Cheers,
>
> -- Alan
>
--
http://groups.google.com/group/python_inside_maya