Bypass confirmDialog[python]


#1

Hello everyone,
I’m using Optimize Scene Size option in my script to delete unused Rendering Nodes.

from pymel.core import*
mel.eval("scOpt_performOneCleanup( { "shaderOption" } );")

But I can’t rid of confirmDialog asking to confirm this action. Is it possibel to bypass it?


#2

Looking at the code in the script cleanUpScene.mel, you can set the following envVar to bypass the confirmDialog:

MAYA_TESTING_CLEANUP=1


#3

Thank you Keilun! It works now.I found that script but did not figured out to use environment variables.