PDA

View Full Version : Keep the position key for the first and the last frame


SamSed
02-02-2007, 03:34 AM
Hi , i wrote a script that kills the position or/and rotation or/and scale for selected objects ,what i want to know is how can i keep for example the postion key for the first and the last frame of selected objects.
Here's a piece from the code i wrote:

on trsf pressed do
(
for i in selection do deleteKeys i.pos.controller
)
on rot pressed do
(
for i in selection do deleteKeys i.rotation.controller
)
on scl pressed do
(
for i in selection do deleteKeys i.scale.controller

The objects don't have the same animation lenght.
Thanks!

skywisenight
02-02-2007, 02:13 PM
In the maxscript documentation look up "Controller Key Functions".

You are going to want to get the number of keys on the controller (total), make sure they are in order, and delete key 2 through to key (total-1) in a loop.

skywisenight
02-02-2007, 02:16 PM
-Edit:duplicate-

dutch_delight
02-05-2007, 12:51 PM
for n = 2 to (numKeys $.pos.controller)-1 do deleteKey $.pos.controller 2

SamSed
02-06-2007, 02:14 AM
Sorry for the late reply.
skywisenight: yeah i looked in to the documentation , i found what i wanted but couldn't translate it in a proper clean code (still learning maxscript), dutch_delight made it for me.
Many Thanks both of you , really appreciate it !:)

CGTalk Moderation
02-06-2007, 02:14 AM
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.