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 CLOSED
 
Thread Tools Search this Thread Display Modes
Old 04 April 2013   #1
Unhappy Delete all keyframes from objects?

Hallo,

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
Hello,

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


  import maya.cmds as cmds
    
    mySel = cmds.ls(sl=1)
    
    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,
Alexis

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

http://www.mediafire.com/view/?8zk5pgw13apkfd4
__________________
DrWeeny
My Blog
My Vimeo
LinkedIn

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 = cmds.ls(sl=1) #my current selection

cmds.cutKey(mySel, s=True)#delete key command
__________________
DrWeeny
My Blog
My Vimeo
LinkedIn
 
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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
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
CGSociety
Society of Digital Artists
www.cgsociety.org

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

All times are GMT. The time now is 02:57 PM.


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