Created
December 7, 2018 11:55
-
-
Save rondreas/d6582bcbc6e4a2b0299860162690557f to your computer and use it in GitHub Desktop.
Count the number of scriptCtx in scene, checking only default named ones.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Count the number of scriptCtx in scene, checking only default named ones. | |
""" | |
import pymel.core as pm | |
def countScriptCtx(): | |
count = 0 | |
mel_command = 'scriptCtx -ex "scriptCtx{}"' | |
n = 1 | |
exist = True | |
while exist: | |
exist = pm.mel.eval(mel_command.format(n)) | |
count += 1 | |
n += 1 | |
return count | |
c = countScriptCtx() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment