delete keyframe range

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 09 September 2009   #1
delete keyframe range

Hey,
I want to delete keyframe of selected objects from a range of key.
I found this but can't use a time :/range
Quote:
deleteKeys o.pos.controller #allKeys
deleteKeys o.rotation.controller #allKeys


Thank you for help
 
Old 09 September 2009   #2
Code:
selectKeys o.pos.controller 0f 30f deleteKeys o.pos.controller #selection selectKeys o.rotation.controller 0f 30f deleteKeys o.rotation.controller #selection
__________________
----------------------------------
Akram Parvez
http://www.akramparvez.com/
 
Old 04 April 2010   #3
Quote:
Originally Posted by AkramParvez
Code:
selectKeys o.pos.controller 0f 30f deleteKeys o.pos.controller #selection selectKeys o.rotation.controller 0f 30f deleteKeys o.rotation.controller #selection


I noticed that my animation controllers are not position and rotation related but are animated vertices. I tried:

Code:
o.editpoly.controller


instead of the above, but that doesnt work, is there a list of animation controllers somewhere that can be used?
 
Old 04 April 2010   #4
Use this
Code:
o.modifiers[#Edit_Poly][#Master_Point_Controller]
__________________
----------------------------------
Akram Parvez
http://www.akramparvez.com/
 
Old 04 April 2010   #5
Quote:
Originally Posted by AkramParvez
Use this
Code:
o.modifiers[#Edit_Poly][#Master_Point_Controller]


Hmmm unfortunately it doesn't work, tried a few ways with the code you gave me also the maxscript help doesnt supply any info on this. (at least for what I could find)

Code:
on del_key pressed do ( for o in selection do ( selectKeys o.modifiers[#Edit_Poly][#Master_Point_Controller] 0f 500f deleteKeys o.modifiers[#Edit_Poly][#Master_Point_Controller] #selection selectKeys o.pos.controller 0f 500f deleteKeys o.pos.controller #selection selectKeys o.rotation.controller 0f 500f deleteKeys o.rotation.controller #selection ) )


The last 4 lines btw only remove keyframe 1 until 500, how come it doesn't remove frame 0? Is there a logic to this?
 
Old 04 April 2010   #6
It looks like that should work, unless it's a key from another controller. You can try this, it's a function to delete keys from a provided controller. Just pass through a controller you want to delete keys from and the delete range.

Code:
( /**************************************** Info: Deletes keys from a controller Arguments: con <controller> deleteRange <interval> ****************************************/ fn deleteKeysByRange con deleteRange = ( for x in con.keys.count to 1 by -1 do ( if (con.keys[x].time >= deleteRange.start) and (con.keys[x].time <= deleteRange.end) do deleteKey con x ) ) for obj in selection do ( mPointCon = obj.baseObject[#Master_Point_Controller] if mPointCon != undefined do deleteKeysByRange mPointCon.controller (interval 0f 50f) deleteKeysByRange obj.position.controller (interval 0f 100f) deleteKeysByRange obj.rotation.controller (interval 0f 100f) deleteKeysByRange obj.scale.controller (interval 0f 100f) ) )
__________________
www.jasonlabbe3d.com
 
Old 04 April 2010   #7
The code i have given works if you are animating vertices with edit_poly modifier on the object.
If you are animating without it then this should work.
Code:
selectKeys o.baseObject[#Master_Point_Controller] 0f 500f deleteKeys o.baseObject[#Master_Point_Controller] #selection


@jason Thanks for the function..
__________________
----------------------------------
Akram Parvez
http://www.akramparvez.com/
 
Old 04 April 2010   #8
Quote:
Originally Posted by labbejason
It looks like that should work, unless it's a key from another controller. You can try this, it's a function to delete keys from a provided controller. Just pass through a controller you want to delete keys from and the delete range.

Code:
( /**************************************** Info: Deletes keys from a controller Arguments: con <controller> deleteRange <interval> ****************************************/ fn deleteKeysByRange con deleteRange = ( for x in con.keys.count to 1 by -1 do ( if (con.keys[x].time >= deleteRange.start) and (con.keys[x].time <= deleteRange.end) do deleteKey con x ) ) for obj in selection do ( mPointCon = obj.baseObject[#Master_Point_Controller] if mPointCon != undefined do deleteKeysByRange mPointCon.controller (interval 0f 50f) deleteKeysByRange obj.position.controller (interval 0f 100f) deleteKeysByRange obj.rotation.controller (interval 0f 100f) deleteKeysByRange obj.scale.controller (interval 0f 100f) ) )


Awesome, thnx Jason this code works perfectly.

Quote:
Originally Posted by AkramParvez
The code i have given works if you are animating vertices with edit_poly modifier on the object.
If you are animating without it then this should work.
Code:
selectKeys o.baseObject[#Master_Point_Controller] 0f 500f deleteKeys o.baseObject[#Master_Point_Controller] #selection


@jason Thanks for the function..



Akram: I just found out what the problem was with the previous code.

Code:
selectKeys o.modifiers[#Edit_Poly][#Master_Point_Controller] 0f 500f deleteKeys o.modifiers[#Edit_Poly][#Master_Point_Controller] #selection


My object was in editable_poly mode. So before I could use this line I had to add a edit_poly modifier. Weird as both are editable poly's. But thnx anyways
 
Old 04 April 2010   #9
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
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Currently Active Users Viewing This Thread: 1 (1 members and 0 guests)
nickyliu
Forum Jump
Miscellaneous

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


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