opening .ma files in silent mode

209 views
Skip to first unread message

gnn

unread,
Jun 16, 2017, 8:06:38 PM6/16/17
to Python Programming for Autodesk Maya
Hello all,
i want to batch editing maya scene, so i need to open them in silent mode, without any warnings:
for example;
'errors have occured while reading this scene that may result in data loss'
or:
 “Reference file not found” warning dialog...
but i just know this command:
cmds.file( last_file, open=True, force=True )
there's another way?
By advance, thanks

Han Jiang

unread,
Jun 16, 2017, 9:23:56 PM6/16/17
to python_in...@googlegroups.com
set environment variable MAYA_IGNORE_DIALOGS to 1

--
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_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/409683e3-c2dd-4b3f-a2c6-2e882452d2e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Marcus Ottosson

unread,
Jun 17, 2017, 4:02:42 AM6/17/17
to python_in...@googlegroups.com
Thanks for sharing this Han.

I keep coming across these (undocumented?) variables, does anyone know of any source where I can find what variables are actually available?

It put together this just now, partly for myself and partly such that anyone who knows of any more variables can fill them in so we can get a hold of what's out there in one big place.

​

gnn

unread,
Jun 17, 2017, 5:48:40 AM6/17/17
to Python Programming for Autodesk Maya
​Thanks for your help Oglop and Marcus,
the way MAYA_IGNORE_DIALOGS 1 can't be run inside a python script no?
it looks to be in: #C:\Documents and Settings\<username>\My Documents\maya\<Version>\scripts
so it need to reboot maya and be a little too definitive, no?
there's not another way to said to maya the defaut answer to give for this message: (as it need an action)?

Andrew Hazelden

unread,
Jun 17, 2017, 3:23:49 PM6/17/17
to Python Programming for Autodesk Maya
Hi Marcus.

The Domemaster3D "domeDiagnostics.mel" script lists quite a few of the undocumented Maya environment variables.

Regards,
Andrew Hazelden
domeDiagnostics.mel

Marcus Ottosson

unread,
Jun 18, 2017, 10:14:58 AM6/18/17
to python_in...@googlegroups.com
Updated, thanks Andrew.


--
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_maya+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/6f0939bd-aab4-4ffe-a227-a5265d468c85%40googlegroups.com.

Michael Boon

unread,
Jun 22, 2017, 5:27:28 PM6/22/17
to Python Programming for Autodesk Maya
You can set environment variables from within Maya. The standard Python way is
import os
os.environ['MAYA_IGNORE_DIALOGS'] = '1'
That will set it for the current Maya session, but not for Windows in general. I haven't checked to see if Maya takes notice of the change to this particular variable though.

Ravi Jagannadhan

unread,
Jun 22, 2017, 5:29:46 PM6/22/17
to python_in...@googlegroups.com
It looks like (at least in the file translator part), it checks it once per session.

--
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_maya+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Where we have strong emotions, we're liable to fool ourselves - Carl Sagan
Reply all
Reply to author
Forward
0 new messages