CGTalk > Software Specific Forums > Autodesk 3ds max > 3dsMax SDK and MaxScript
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 09-07-2009, 04:03 PM   #1
loran
3dsmaxer
 
loran's Avatar
portfolio
laurent Renaud
Blender/3dsmax
France
 
Join Date: Feb 2004
Posts: 680
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-07-2009, 04:59 PM   #2
AkramParvez
Tech Art
 
AkramParvez's Avatar
portfolio
Akram Parvez
Technical Artist
Ubisoft Singapore
Singapore, Singapore
 
Join Date: Apr 2006
Posts: 93
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-19-2010, 02:23 AM   #3
Papigiulio
feelin' frisky?
 
Papigiulio's Avatar
G G
FRISKY.FM
Osaka, Japan
 
Join Date: Sep 2004
Posts: 204
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-19-2010, 02:57 PM   #4
AkramParvez
Tech Art
 
AkramParvez's Avatar
portfolio
Akram Parvez
Technical Artist
Ubisoft Singapore
Singapore, Singapore
 
Join Date: Apr 2006
Posts: 93
Use this
Code:
o.modifiers[#Edit_Poly][#Master_Point_Controller]
__________________
----------------------------------
Akram Parvez
http://www.akramparvez.com/
 
Old 04-21-2010, 04:11 AM   #5
Papigiulio
feelin' frisky?
 
Papigiulio's Avatar
G G
FRISKY.FM
Osaka, Japan
 
Join Date: Sep 2004
Posts: 204
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-21-2010, 06:06 AM   #6
labbejason
Rigger
 
labbejason's Avatar
portfolio
Jason Labbé
Rigger
Lucasfilm Animation
Singapore, Singapore
 
Join Date: Jan 2006
Posts: 420
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-21-2010, 06:55 AM   #7
AkramParvez
Tech Art
 
AkramParvez's Avatar
portfolio
Akram Parvez
Technical Artist
Ubisoft Singapore
Singapore, Singapore
 
Join Date: Apr 2006
Posts: 93
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-21-2010, 07:28 AM   #8
Papigiulio
feelin' frisky?
 
Papigiulio's Avatar
G G
FRISKY.FM
Osaka, Japan
 
Join Date: Sep 2004
Posts: 204
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-21-2010, 07:28 AM   #9
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 08:09 AM.


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