def PlaceNote():
# Notetrack number
note_tracks = 0
# We need to ask for a name
if not (cmds.objExists("SENotes")):
# We need to make the SENotes parent first
base_track = cmds.spaceLocator()
# Rename
cmds.rename(base_track, "SENotes")
# Notetrack name
noteName = "new_notetrack" + str(note_tracks)
# Now we can make the child (if you have > 50000 notetracks, we got a problem...)
for npos in xrange(note_tracks, 50000):
# Setup
noteName = "new_notetrack" + str(npos)
# Check
if not (cmds.objExists(noteName)):
# Exit
break
# Now make it and parent it
notetrack = cmds.spaceLocator()
# Rename
cmds.rename(notetrack, noteName)
# Parent it
mel.eval("parent " + noteName + " SENotes")
# Get current time
currentFrame = cmds.currentTime(query = True)
# Key it
cmds.setKeyframe(noteName, time = currentFrame)
# Log it
print("A new notetrack was created")
# Selects all bones
评论列表
文章目录