Delete all keyframes from objects?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
Old 04 April 2013   #1
Unhappy Delete all keyframes from objects?


how do I delete all keyframes from selected objects (such as models, control rig/handles) by using a mel-script? Manually I do that by selecting the object/s, double click on timeline, right click (on timeline) and select "Delete".
I`m not that much experienced in scripting, so I don`t know what to "wrap around" the "timeSliderClearKey" command, I guess thats what I have to use?

Help is greatly appreciated
Old 04 April 2013   #2

I have a solution in python, you can try it :

import maya.cmds as cmds mySel = test = [] try: test += cmds.listConnections(mySel,s=True, type="animCurveTU") except: pass try: test += cmds.listConnections(mySel,s=True, type="animCurveTL") except: pass try: test += cmds.listConnections(mySel,s=True, type="animCurveTA") except: pass cmds.delete(test)

hope it works,

--- EDIT ---
As always, identation seems to go wrong above so I uploaded the .py file on mediafire :
My Blog
My Vimeo

Last edited by DrWeeny : 04 April 2013 at 12:25 PM.
Old 04 April 2013   #3
just use the cutKey command
Founder & CEO : Red9Consultancy
Red9 StudioPack : Red9 StudioPack GitHub
Author: Autodesk Masterclass 2011 - 'Live Animation Binding'
Old 04 April 2013   #4
I have forgotten this command.

You just have to run in Python :

import maya.cmds as cmds mySel = #my current selection cmds.cutKey(mySel, s=True)#delete key command
My Blog
My Vimeo
Old 04 April 2013   #5
You may also want to look at the 'delete' command with the 'channels' option. Channels represent attributes which are animated in Maya.
Old 04 April 2013   #6
Thumbs up

DrWeeny, Mark-J, V_man - thank you very much!

An alternative solution maybe
performClearKeyArgList 1 {"0", "animationList", "0", "0"};
... I guess.
Old 04 April 2013   #7
Thread automatically closed

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.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 05:08 AM.

Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.