PDA

View Full Version : Ketframe Selected


beetz15s
09-01-2009, 03:33 PM
Looking for a script Key frame visibility off and then on on the next frame. But the script should be able to apply to any selection.

RyanT
09-01-2009, 06:17 PM
Here is a Python script that does that, select the objects in the scene which you want to turn invisible then on the next frame they will be keyed to be visible again.

import maya.cmds as cmds

selection = cmds.ls(sl=True)
frame = cmds.currentTime(query=True)

for obj in selection:
cmds.setKeyframe( (obj + '.visibility'), value=0, time=frame )
cmds.setKeyframe( (obj + '.visibility'), value=1, time=frame+1 )

beetz15s
09-01-2009, 07:09 PM
perfect thanks a lot

CGTalk Moderation
09-01-2009, 07:09 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.