Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

opening .ma files in silent mode (without warnings)

opening .ma files in silent mode (without warnings)

manue154
Enthusiast Enthusiast
1,866 Views
2 Replies
Message 1 of 3

opening .ma files in silent mode (without warnings)

manue154
Enthusiast
Enthusiast

Hello all,
i want to batch editing maya scenes, so i need to open them in silent mode, without thoses warnings:
“Reference file not found” warning dialog
As it need an action, how to said to maya the defaut answer to give for this message?
I just know this command: cmds.file( last_file, open=True, force=True )
there's another way than MAYA_IGNORE_DIALOGS 1 ?
By advance, thanks

0 Likes
Accepted solutions (1)
1,867 Views
2 Replies
Replies (2)
Message 2 of 3

RFlannery1
Collaborator
Collaborator
Accepted solution

You can use the "prompt" flag of the "file" command.  For example:

promptValue = cmds.file(q=True, prompt=True)
cmds.file(prompt=False)
try:
    for filePath in filesToBatch:
cmds.file(filePath, open=True, force=True)
# Process each file here. finally:
# Restore the old "prompt" value when you are done. cmds.file(prompt=promptValue)
Message 3 of 3

manue154
Enthusiast
Enthusiast

Thank you very much for your answer 🙂

0 Likes