Skip to content

Instantly share code, notes, and snippets.

@n1ckfg
Last active November 7, 2017 16:58
Show Gist options
  • Save n1ckfg/4125814 to your computer and use it in GitHub Desktop.
Save n1ckfg/4125814 to your computer and use it in GitHub Desktop.
Turn object sequence on and off in Maya
from maya.cmds import *
numObjs = 19
objPrefix = "vectorsquid"
objSuffix = ":polySurface1"
t = 0
tDelta = 5
for i in range(numObjs):
currentTime(t)
for j in range(numObjs):
temp = objPrefix + str(j+1) + objSuffix
setAttr(temp + ".visibility",0)
setKeyframe(temp + ".v")
temp = "vectorsquid" + str(i+1) + objSuffix
setAttr(temp + ".visibility",1)
setKeyframe(temp + ".v")
t += tDelta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment