Delete all animated keys using MAXScript in 3ds Max globally

I am trying to use MAXScript to remove all animated keys from my scene using MAXScript. Right now I'm using a mouse and pressing CTRL + A to select all objects, thereby raising the keys for all objects in my scene. Then I select all the keys on the timeline of the animation with the mouse, and then select all the keys on the timeline and delete them. How to do it in MAXScript?

I found this in the MAXScript documentation , but I don't know how to use it:

deleteKeys <controller> [#allKeys | #selection] 

I tried to use

 deleteKeys globaltracks #allKeys 

but it seemed to do nothing.

+4
source share
5 answers

This is the method that I posted as part of this call to CGTalk . I changed it to remove all keys on animated controllers. It manages the built-in functions of the Trackbar custom filter to automatically iterate all the controllers of all objects, instead of loading all the controllers on its own.

 ( fn filterCallbackFunction theAnimatable theParent theSubAnimIndex theGrandParent theNode = ( if isController theAnimatable do deleteKeys theAnimatable #allKeys true ) with redraw off ( trackbar.filter = #all local filtind = maxops.trackbar.registerFilter filterCallbackFunction undefined "." 1 active:on disableRefMsgs() local sel = getCurrentSelection() select objects maxops.trackbar.redraw forceRedraw:on maxops.trackbar.unregisterfilter filtind select sel enableRefMsgs() ok ) ) 

Edit: Sorry or just use this :)

 deleteKeys objects #allKeys 
+3
source
 max select all macros.run "Animation Tools" "DeleteSelectedAnimation" clearSelection() 

or drag this code to the toolbar to make a macro!

+1
source

OR just remove keys from a limited group of objects try

 for o in objects where matchpattern o.name pattern:"*somename*" do deleteKeys o #allKeys 

or select objects to delete keys and try

 for o in selection do deletekeys o #allkeys 
+1
source

I used to delete all keys with this command:

 deletekeys $*.controller #allkeys 
+1
source

No scripts: press Ctrl-A, then Main menu> Animation> Delete selected animation

0
source

Source: https://habr.com/ru/post/1397291/


All Articles