Created
August 6, 2021 12:50
-
-
Save BigRoy/5db5b73ea6fc8d84cec48bec1cb6217f to your computer and use it in GitHub Desktop.
Maya Playblast Option Vars for "Playblast Display" options for viewport and some examples
This file contains hidden or 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
from maya import cmds | |
# List all optionVars starting with "playblast" | |
# The ones for the Playblast Display start with "playblastShow" | |
# And the "playblastOverrideViewport" enables/disables them all together | |
vars = sorted([var for var in cmds.optionVar(list=True) if var.startswith("playblast")]) | |
for var in vars: | |
print var | |
# Set an optionVar | |
cmds.optionVar(intValue=("playblastOverrideViewport", True)) | |
# You can also set multiple at a time | |
options = { | |
"playblastOverrideViewport": True, | |
"playblastShowCVs": True, | |
"playblastShowCameras": True, | |
"playblastShowClipGhosts": True, | |
"playblastShowControllers": True, | |
"playblastShowDeformers": True, | |
"playblastShowDimensions": True, | |
"playblastShowDynamicConstraints": True, | |
"playblastShowDynamics": True, | |
"playblastShowFluids": True, | |
"playblastShowFollicles": True, | |
"playblastShowGreasePencil": True, | |
"playblastShowGrid": True, | |
"playblastShowHUD": True, | |
"playblastShowHairSystems": True, | |
"playblastShowHandles": True, | |
"playblastShowHoldOuts": True, | |
"playblastShowHulls": True, | |
"playblastShowIKHandles": True, | |
"playblastShowImagePlane": True, | |
"playblastShowJoints": True, | |
"playblastShowLights": True, | |
"playblastShowLocators": True, | |
"playblastShowMotionTrails": True, | |
"playblastShowNCloths": True, | |
"playblastShowNParticles": True, | |
"playblastShowNRigids": True, | |
"playblastShowNURBSCurves": True, | |
"playblastShowNURBSSurfaces": True, | |
"playblastShowOrnaments": True, | |
"playblastShowParticleInstancers": True, | |
"playblastShowPivots": True, | |
"playblastShowPlanes": True, | |
"playblastShowPluginShapes": True, | |
"playblastShowPolyMeshes": True, | |
"playblastShowSelectionHighlighting": True, | |
"playblastShowStrokes": True, | |
"playblastShowSubdivSurfaces": True, | |
"playblastShowTextures": True | |
} | |
cmds.optionVar(intValue=options.items()) | |
# Changing the values doesn't automatically update the show menu. | |
# You can force that with: | |
from maya import mel | |
mel.eval("rebuildShowMenu;") | |
# ---- | |
# Note that there are also "plugin display options" like 'gpuCache' | |
# for example. Those are stored in the optionVar "playblastShowPluginObjects" | |
# The option var might not exist - so be aware of that. | |
if cmds.optionVar(exists="playblastShowPluginObjects"): | |
# Note that this is an "EXCLUDE" list. So anything it returns | |
# are the filters that are disabled for showing | |
exclude = cmds.optionVar(query="playblastShowPluginObjects") | |
print exclude | |
# Enabling all plug-ins filters thus is as easy as clearing that optionVar's value | |
# So use EITHER of the following: | |
cmds.optionVar(clearArray="playblastShowPluginObjects") | |
cmds.optionVar(remove="playblastShowPluginObjects") | |
# And disabling all plug-in filters for showing can be done with | |
filters = cmds.pluginDisplayFilter(query=True, listFilters=True) | |
for filter in filters: | |
cmds.optionVar(stringValueAppend=("playblastShowPluginObjects", filter)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
More details on the
optionVar
command in Maya documentation.Messing a lot with Maya playblasts? Also look into maya-capture!