mel.eval('filetest -d "'+var1 + '";')
you have to put " around your path in the eval statement
On Wed, Aug 4, 2010 at 6:15 AM, Red <[email protected]> wrote:
> Hello all,
>
> can anyone explain why this does not work ?
>
> def melVarTest():
>
> var1 = "C:/Program Files/Autodesk/Maya2011/bin/plug-ins/"
> result = mel.eval("string $var1Mel = `python var1`;")
> print result
>
> melVarTest()
>
> # MelError: Error during execution of MEL script: line 1: name 'var1'
> is not defined
>
> The reason for doing this is because I want to use the mel filetest
> command and this seemed to me to be the best option.
>
> I have also tried:
>
> mel.eval("filetest -d "+var1)
>
> But that instantly crashes maya. (fatal error)
>
>
> And when writing it the pymel way it gives me a syntax error that I
> can not figure out
>
> mel.filetest(var1, d=True)
>
> # MelError: Error during execution of MEL script: line 1: Invalid call
> to "filetest". Check number and types of arguments expected by the
> procedure.
> # Calling Procedure: filetest, in Command
> # filetest("var1, d=True") #
>
> Would anyone be so kind to help me out :)
>
> Thanks,
> Red
>
> --
> http://groups.google.com/group/python_inside_maya
>
--
http://groups.google.com/group/python_inside_maya