Skip to content

Instantly share code, notes, and snippets.

@BigRoy
Created January 4, 2023 11:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BigRoy/01fee5b2c99a5b1dd6f35f4c88b70df2 to your computer and use it in GitHub Desktop.
Save BigRoy/01fee5b2c99a5b1dd6f35f4c88b70df2 to your computer and use it in GitHub Desktop.
Maya print all option vars in sorted manner (just because I'm lazy)
from maya import cmds
STR_VALUE_SINGLE_LINE = True
for var in sorted(cmds.optionVar(list=True)):
value = cmds.optionVar(query=var)
if isinstance(value, str) and STR_VALUE_SINGLE_LINE:
value = value.replace("\n", " ")
print(var.ljust(50) + " " + str(value))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment