insert keyframes

Wondering how to accomplish a certain animation task? Ask here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
arfa
Posts: 244
Joined: Tue Dec 23, 2008 8:15 pm
Location: New Zealand

insert keyframes

Post by arfa »

So, my sequence progresses then, as I often do, I change my mind. It would be sweeter with a wee extra bit before this bit. But, extra frames are needed to accomodate the new idea-bits. I have tried animation>rescale keyframes but that just seems to, well, rescale; the keyframes that are already there.

How, if at all, to add in extra (blank) frames?
I have tried writing my new-bit in a separate file and importing, I have tried...

Tis the hope that there *might* be a script to insert extra frames. Say yes - please...

Links or suggestions please.

> arfa
Genete
Posts: 3483
Joined: Tue Oct 17, 2006 3:27 pm
Location: España / Spain

Post by Genete »

Right click > Add Keyframe helps?
-G
JNandC
Posts: 17
Joined: Fri Jan 23, 2009 1:41 am

Post by JNandC »

If your trying to add keyframes between two other keyframes, just right click and select option "add keyframes"

If your trying to add frames between keyframes (more time between the actions) just click the keyframe(s) you want extend and then move them along the timeline.
User avatar
slowtiger
Posts: 6098
Joined: Thu Feb 16, 2006 6:53 pm
Location: Berlin, Germany
Contact:

Post by slowtiger »

(He's asking about an easy way to add additional time before or between keys.)

No, there's no easy way to do this. But it can be done by shifting the existing animation in time. You were on the right track.

First: you need to define your segment of the timeline you wish to shift. This means that it must have a key on the start frame as well as on the end frame. If you only have 1 channel to move, this is easy. If you want to move animation which exists in several timelines, you need to create these start and end keys in each and every timeline.

I find it easier to create keys in each timeline by using the "copy current frame" command from the Animation menu. I go to, say, frame 1, check "entire document" and frame 1 as destination. The same I do for the end frame, let's say it's # 200.

Now we have keys at beginning and end of each timeline. With this we can use the "rescale keyframes" command, again with "entire document" checked, to shift our animation from #1 - #200 to #100 - #300.

This works only if there's no animation after #200.
Greysnarthur
Posts: 35
Joined: Wed Jun 18, 2008 8:51 am

Post by Greysnarthur »

Thanks Slowtiger, that sorted something I'd been struggling with for some time.

What arfa was wanting was 'extra time' between keyframes and that does it. I'm not sure why you say this only works when there is nothing after your 'fame 200'. I doubled the number for frames mid animation and it has been fine.
arfa
Posts: 244
Joined: Tue Dec 23, 2008 8:15 pm
Location: New Zealand

the question

Post by arfa »

Well spotted slowtiger. As is often the case getting the question rightly posed is half the trick.

Yes, taking ALL keyframes, ALL timelines of say frames, 40-60 and moving them all 20 frames to the right - so I can do an extra bit of ani. over those (empty) 20 frames.

I will test this later this evening.

Many thanks - arfa
arfa
Posts: 244
Joined: Tue Dec 23, 2008 8:15 pm
Location: New Zealand

missing something

Post by arfa »

I have been busy for a bit but the issue persists.

I am missing something. Sorry if my newness lacks.

>> keys in each timeline - does this need to be done in every timeline?
>> using "copy current frame" - fine.

>> rescale keyframes
Not quite sure if I have the concept rightly in mind here.
Say I want to insert 20 frames at frame 20. Ie. push the whole ani. 20 frames to the right.
I go to frame 20, copy all frames, whole document, to frame 20.
ditto frame 21?

What then are the settings for rescaling?
My logic on the two start/end cases...
I have frame 20 to start and I want frame 20 to stay where it is.
I want frame 20 to remain as, to be my new start but frame 40 to be the new end.

Start frame: 20 End frame: 21
New Start frame: 20 New End frame: 40

Nope.
I tried this and that and many things and - help?

thx - arga
User avatar
slowtiger
Posts: 6098
Joined: Thu Feb 16, 2006 6:53 pm
Location: Berlin, Germany
Contact:

Post by slowtiger »

You need 20 extra frames with no animation in it. In oder to get these, you have to shift all of your existing animation to the right, after frame 20. That's what the re-calculating does. It only saves you from the task to go into each timeline, select all keys in it, and shift them 20 frames to the right manually. This is the basic way to do, it will always work, but will take some time.
arfa
Posts: 244
Joined: Tue Dec 23, 2008 8:15 pm
Location: New Zealand

script?

Post by arfa »

layer by layer...
I guess it depends how far the project had developed. Could be very tedious :>)

Not that I have done so much animation (quite a bit in Flash) but I always seem to want a few extra frames, timing mostly. Sometimes it is a whole new segment that 'should have been' planned for - but wasn't.

I imagine that this happens for many others.
I have had a quick look at the .anme file and, with what little I know, imagine that it wouldn't be that difficult to write a script.
Take all keys after 20 and add 20 to their value. It would push everything down 20 frames and those 20 would have no keys.

I wonder if Lua can do this?

- arfa
User avatar
slowtiger
Posts: 6098
Joined: Thu Feb 16, 2006 6:53 pm
Location: Berlin, Germany
Contact:

Post by slowtiger »

This ability to shift animation in time, layer by layer, or everything, is one of my greatest feature requests for a next version. *sigh*

When I started digital animation, I mostly used Director, which had a frame-based timeline with a very transparent approach: everything just stayed where I put it. When I wanted to insert some time, I could easily insert empty frames anywhere.

This totally changed with Flash - although the timeline looked the same, it behaved completely different. That's still my main reason why I never liked Flash.
arfa
Posts: 244
Joined: Tue Dec 23, 2008 8:15 pm
Location: New Zealand

not just me

Post by arfa »

OK, so its not just me. Being new one can never be sure if it is just another nerdy tangent.

In Swish (my flash clone) it still needed to be done by timeline but there was a shortcut - F5 or shift F5 for 10 frames. Relatively quick and easy.

So, I will find some play time and have a go at scripting a solution. It will be in PHP (my javascript is a bit weak and Lua (as yet?) non-existant) but it will test my initial presumptions that it is possible.

The only (current) reservation is around actions - they must be maintained as a block. Anyhow, watch this space - but don't hold your breath ;)

breathing - arfa
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

I'm surprised no one has tried to script this. However it might not be as simple as it sounds.

The trick would be finding and moving all the keys... yikes... without moving a key on top of another one. The trouble with AS scripting is that you have to make "lists" and do something to each thing. So even if you move ALL the keys 4 frames ahead, you do each one, one at a time which could mean you put one key on top of another before you move it.


-vern
User avatar
slowtiger
Posts: 6098
Joined: Thu Feb 16, 2006 6:53 pm
Location: Berlin, Germany
Contact:

Post by slowtiger »

Hm, what about a temporary location then? The pseudocode would be like this:

- find keys in timelines
- list all timelines with keys in it
- check if keyed timelines have keys at beginning and end of to-be-moved selection - if not, add them
- add 10.000 to all keys, thus safely shift them into an area with no other keys (OR find the last existing key in the document an use that position +1000 as temporary location)
- subtract (10.000 - amount of shift) from each key
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

Oh good grief. 5 minutes after typing that I realized how stupid it is. :oops:.

Just start at the END of the list and move forward, never hit another key frame.

-vern
arfa
Posts: 244
Joined: Tue Dec 23, 2008 8:15 pm
Location: New Zealand

great

Post by arfa »

This is great.

I have made some study of the anme file - not having the least clue how Lua would do it - but, it seems to me that it is an easy matter to go through the file line-by-line, find each line (that has a key value), test whether it is greater than my selected start frame, if so - add the number of extra frames. Keep a running track of changes and compile those as a new file at the end. There is a break if a transform runs before/after my start frame but i suspect that is relative easily remedied after the compilation - in the timeline. But my thinking is distorted by my PHP view.

Actions do seem to present special consideration.

I have made a small start but would be delighted if it were done (by someone else :)) more directly in the program. My approach is with PHP which involves mucking about with separate copies of files. Messy.

Its a job for... The lads in Lualand - up, up and awayyyyyy.!

the day begins - arfa
Post Reply