select keyframes -- after frame 'x'

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

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

select keyframes -- after frame 'x'

Post by arfa »

A theme revisited.

My timing regularly needs more/less time and I am still thinking of a time shift script - mass keyframe adjustments across a whole project.
I wrote a PHP script that worked a treat but, when I threw a big file (like 100,000 lines +) at it - grunt, wheeze. My internal checking loops were just too inefficient. Still working on it.

In the meantime, I wonder if a lua script exists and, if not how difficult it would be to create one, that selects keyframes on a layer-timeline -- after a set keyframe? I can see that ALL layers is probably too complex but...
for example:
I want to insert 10 frames into the whole project say, after frame 55.
Layer by layer seems to be the easiest way to work this.
If there was a script that had a persistent dialogue box with a number input and a "Select" button.
Go to a layer - enter 55, click 'Select' - shift all selected keys 10 frames.
Next layer. 55 persists. Click. Shift.

There is a menu script - animation > select ALL keyframes so I wonder if this could be modified? [couldn't find it in the scripts/menu folder]
And, what do i know about lua? Zip, doodly squat. Still, it seems feasible. Yes? No? Maybe?

ever in hope...
arfa
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

That menu "script" for scaling the key frames is actually part of AS and not a lua script.

I think this topic has already come up before in another thread. There was a fairly big discussion on the topic of "adding" or "shifting" frames via scripting.
There is an existing script that puts key frames on every channel. I thought there was a script that would key every layer as well? I can't recall and would need to check that.

If a script is created that can do what you want for 1 layer it's fairly straightforward to apply the same script to ALL layers in one shot. The main issue would be that all channels are accessible via scripting. I think there are some things that can't be changed.

For instance animated layer order is not scriptable. You can't move those keys. You can't even see those keys via scripting. There may be other animation channels that might be missed. I seem to recall there was something like that in the "key all" script someone here created.

I have yet to do any scripting that involves moving keys (or even creating bunches of keys actually). I tend to stick to scripting that doesn't involve creating keys at all (keeps file size small that way).

-vern
User avatar
synthsin75
Posts: 10280
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Post by synthsin75 »

Macton's cc_shift_layer_keyframes menu script already does this for one or every layer. With the exception of channels that can't be accessed with scripting, like Vern said.

Here's the only place I know to get all of the Macton scripts:viewtopic.php?t=10551

It's a large download, but very worth it. :wink:
arfa
Posts: 244
Joined: Tue Dec 23, 2008 8:15 pm
Location: New Zealand

Post by arfa »

Vern,

Thanks for your well considered (as always) reply.
I think this topic has already come up before in another thread.
Yes...
viewtopic.php?t=12779
and you had an inspired revelation:
Just start at the END of the list and move forward, never hit another key frame.
and I thought - 'YES!' - but I guess Lua, like all things, has limitations. The idea seems incredibly useful
Slowtiger:
"...one of my greatest feature requests for a next version"
I am 99% sure I can do it with PHP but it is a very clumsy solution.

I have started the 32Mb download for Macton's scripts and will return in 02:13:22 to explore the contents.

I am super tempted to dive into Lua but know that I will totally lose focus on AS and drawing and animation -- which is really where I want to stay.

thanks again - arfa
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

arfa,

Just so you know, lua is a pretty quick and easy learn if you have previous programming skills like PHP or Javascript. It's not exactly the same but very close. When I first started playing with it the only experience I had was Javascript and Actionscript.

Yes... it can pull you away from the "animation" fun of AS. That's happened to me before. It's fun to script. ;)

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

Post by arfa »

lua is a pretty quick and easy learn
Sure. I imagine it would come together well enough but... the time. Where to focus?

I get a real buzz from coding (scripting, programming - never quite sure what to call it) and particularly enjoy the lateral layering, the logistics of logic and all. I am pleasantly surprised to find much of this when building an animation. I didn't expect that. How to get things, stuff on and off stage. From one hand to another, from one place to another. Buzz enough for now :)

Most likely you will find me hacking lua lumps -- eventually.

fun indeed - arfa
Post Reply