Re: [Maya-Python] converting Mel help

5 views
Skip to first unread message

Joe Weidenbach

unread,
Dec 23, 2014, 11:25:58 AM12/23/14
to python_in...@googlegroups.com
In Python, you don't put you if statements in Parentheses.  So, it would be something like this:

import maya.cmds as cmds

if cmds.file(query=True, location=True) == "unknown":
    print "New File"

On 12/23/2014 2:16 AM, yann19 wrote:
I am trying to convert a mel function into python. While I am able to do so for the rest, I am meeting with some issues in this mel code line

if(`file -q -loc` == "unknown")

I have tried something like :
if (cmds.file(query = True, location = True)) == "unknown"
while it does not seems to generate any sort of errors/warning in the editor, my function isn't popping out its dialog

Any ideas?
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/340d2041-d475-4439-8566-c311f65c7cdb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.




This email is free from viruses and malware because avast! Antivirus protection is active.


Reply all
Reply to author
Forward
0 new messages