My Nudge Keys Toolset... Finally!!!!

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

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
Rudiger
Posts: 786
Joined: Sun Dec 18, 2005 2:25 am

My Nudge Keys Toolset... Finally!!!!

Post by Rudiger »

*****************************
UPDATE (29-June-2011)
*****************************
On a request from Selgin, I have added the extra channels from AS7 and AS8 rt_key_tool_v1.2.zip.

*****************************
UPDATE (27-April-2011)
*****************************
Wow, is has it really been a year and a half :shock:? Anyway, here is a long overdue update rt_key_tool_v1.1.zip.

Apart from a bunch of bug fixes, tidying up, and support for AS7, there is now has an overwrite mode which lets you delete keys without shifting. It also now uses new scripting features for checking whether layers are visible or selected instead of the hacks that it used previously, but that means that it now requires AS6.2 or above.

By the way, I used Ramón López's idea of putting all of the button icons in their own folder inside ScriptResources, so you might want to clear that folder out of icons related to rt_key_tool before reinstalling.

*****************************
UPDATE (01-Nov-2009)
*****************************
A new version of these tools has been released in the form of a single new tool called KeyTool! It has a lot of new options and bug fixes since the initial version. It can be downloaded from here:
rt_key_tool_v1.0.zip

For those that still prefer having the separate tools, I have also written a set of button tool wrappers that call the same core functions that are used by the new KeyTool. These tools can be downloaded from here.
rt_nudge_keys_buttons_v0.1.zip

*****************************
Original Post (14-Jul-2009)
*****************************
OK, I think I'm finally prepared to release a version of my "nudge keys" set of tools. As well as making them work with the new features of ver 6.0, I've been busy added some extra options as well as optimizing everything to be much more responsive. In particular, the Menu script which creates a consolidated timeline for a set of layers used to take up to a minute to run, but is now pretty much instant.

By the way, the tools should work for both versions 5.6 and 6.0, except for version 5.6, the interpolation mode will be overwritten and also, the layer ordering keys will not be shifted.

You can download the full set of tools and scripts from here...
rt_nudge_keys_v0.1.zip

The toolset consists of the following button tools:
rt_nudge_keys_left ,
rt_nudge_keys_right .
rt_global_nudge_keys_left <
rt_global_nudge_keys_right >
rt_prev_keyframe -
rt_next_keyframe +

the following menu script:
rt_create_consolidated_timeline_layer.lua
and the following utilities script, that contains some common functions:
rt_utilities.lua
I've also included a file, _tool_list_fragment.txt, that shows my recommended key assignments.

I admit that the the icons are pretty poor, so if anyone wants to volunteer to make better ones, please go right ahead.

So hopefully it's pretty self explanatory, but here's a brief description on how to use it.

1. In any layer, press ',' and all of the keys at or to the right of the cursor will be nudged 1 place to the left. Press '.' and the keys will be nudged 1 place to the right. If the current layer has children then all layers below it will also be affected. If there is a key to the immediate left of the cursor, then a left nudge won't be performed.

2. In any layer, hold down shift when you press ',' or '.' and all keys in the document, including the camera keys will be nudged. The document's endframe will also be automatically adjusted.

3. In any layer, run the rt_create_consolidated_timeline_layer script and all keys in parent (if exists) and sibling layers (if exists) will consolidated into a special non-rendering layer which placed alongside the original layer. Whenever you nudge left or right in this layer its parent and the parent's children are automatically affected. This script can also be run at the top level as well and is useful for monitoring global nudges.

4. There are a number of option variables at the bottom of the rt_nudge_keys_left.lua file, which I plan to implement as options one day using a separate set option script. I'm too tired to explain them all now, but an interesting one is "enable_fake_curvature_channel". The thing is that the curvature channel for each point is not currently available in the script interface, but I worked out a fairly robust way to fake it by assuming that each curvature key has a corresponding point position key. Where it gets a bit hacky is that it uses an action with a single curvature key at a high frame to blank the current curvature channel. This is why it's disabled by default.

Anyway, what I love about Anime Studio is that it's so much fun to use. I just hope this tool makes tweaking the timing as fun as everything else!

Of course it goes without saying, if anyone finds any bugs or has any suggestions for making it better, I would love to hear them.
Last edited by Rudiger on Wed Jun 29, 2011 3:41 pm, edited 9 times in total.
User avatar
Víctor Paredes
Site Admin
Posts: 5646
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Post by Víctor Paredes »

Wow, this sounds huge!!! :D
Thanks Rudiger, I'm downloading the file and will be testing soon in my break.
Long life to scripters!!
User avatar
ulrik
Posts: 1087
Joined: Thu Aug 11, 2005 10:32 pm
Location: Stockholm Sweden
Contact:

Post by ulrik »

Fantastic tools Rudiger, I've just tested them with AS Pro 6 on mac ppc computer running os 10.5.7 and it works like a charm! Thanks a lot for this. :D
User avatar
Víctor Paredes
Site Admin
Posts: 5646
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Post by Víctor Paredes »

It's fantastic! Thanks!
It was hard to understand the consolidate layer, but now it's all clear. It's so simple and logic! I love it
I just found a problem with nudge: when you have layers with frame zero before or after global frame zero (I mean, when you translate layers with sequencer), the nudge doesn't work good, it offsets the cursor place.

PD: Seems to be it's part of an AS 6 bug I find some days ago, if you have a layer moved on sequencer and add keyframes with right click, AS copies the position the character has on global frame zero instead just adding a key.
Rudiger
Posts: 786
Joined: Sun Dec 18, 2005 2:25 am

Post by Rudiger »

I was hoping to at least get past the first hour without a bug being found. Oh well :D. To be honest, I never tested it with the sequencer, but you're right that the nudge position becomes offset with respect to the cursor. Whether it's a bug in ASP6 or not, there's not much I can do about it, as I don't think any of the sequencer stuff has been included in the scripting interface. Anyway, you don't need the sequencer anymore, now that you can shift keys globally, right? :wink:
User avatar
ulrik
Posts: 1087
Joined: Thu Aug 11, 2005 10:32 pm
Location: Stockholm Sweden
Contact:

Post by ulrik »

I found that the "consolidate layer" don't notice keyframes from effect panel like gradient shade or other changes, is it supposed to?

None of the "nudge" buttons find thoose either
User avatar
Víctor Paredes
Site Admin
Posts: 5646
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Post by Víctor Paredes »

Rudiger wrote:I was hoping to at least get past the first hour without a bug being found. Oh well :D. To be honest, I never tested it with the sequencer, but you're right that the nudge position becomes offset with respect to the cursor. Whether it's a bug in ASP6 or not, there's not much I can do about it, as I don't think any of the sequencer stuff has been included in the scripting interface. Anyway, you don't need the sequencer anymore, now that you can shift keys globally, right? :wink:
Oh, sorry, I'm working right now in a project where I'm using a lot the sequencer to recycle some animations, so my very first tests were with the layers offset on sequencer. But you are right, for new projects seems to be I won't need the sequencer so much because your new tools.
Thank you again, this set of tools is of that ideas that make you think How could this software exist all this years without them!
Rudiger
Posts: 786
Joined: Sun Dec 18, 2005 2:25 am

Post by Rudiger »

ulrik wrote:I found that the "consolidate layer" don't notice keyframes from effect panel like gradient shade or other changes, is it supposed to?

None of the "nudge" buttons find thoose either
Thanks for the info, Ulrik. Alas, this channel does not seem to have been included in the scripting interface. However, after looking I did find some extra effect handle transform channels that were missing from my script, so I've included them and will post a new version when more people have tested it out.
User avatar
Víctor Paredes
Site Admin
Posts: 5646
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Post by Víctor Paredes »

Hi again Rudiger, I'm playing with your scripts and found another bug, sorry, I don't want to be a bad guy, just want to help you with this fantastic set of buttons.
Well, I think it shouldn't be a very complex to fix bug, just when you nudge keys which have cycles, the cycle is established always in frame zero, no matters where it was before.
That's all, I keep playing! :roll:
Rudiger
Posts: 786
Joined: Sun Dec 18, 2005 2:25 am

Post by Rudiger »

selgin wrote:Hi again Rudiger, I'm playing with your scripts and found another bug, sorry, I don't want to be a bad guy, just want to help you with this fantastic set of buttons.
Well, I think it shouldn't be a very complex to fix bug, just when you nudge keys which have cycles, the cycle is established always in frame zero, no matters where it was before.
That's all, I keep playing! :roll:
No need to apologize at all. I'm actually very grateful. Because these scripts affect all possible types of layers and channels, it would have taken me ages to test every possible combination. I appreciate you reporting any bugs you find, and I'll definitely fix them, as long as the scripting interface will let me, of course.
User avatar
Touched
Posts: 504
Joined: Mon Dec 11, 2006 7:33 am
Location: Sunny California
Contact:

Post by Touched »

This looks like exactly what I've been wanting for adjusting the timeline, with a brilliant implementation, and I'm glad to see it will work on 5.6!. I'll be experimenting with this on AS5.6 today, and report on my experience. Thank you very much!
User avatar
Barry Baker
Posts: 342
Joined: Fri Aug 27, 2004 6:58 am
Location: UK
Contact:

Post by Barry Baker »

Your set of tools sounds exactly like what Moho/ASP has needed all these years! I can't wait to try them out on a job. Thanks.
User avatar
Touched
Posts: 504
Joined: Mon Dec 11, 2006 7:33 am
Location: Sunny California
Contact:

Post by Touched »

Okay, after an experiment, I'm wondering if there's a way to exempt specific layers from being affected by the scripts. The reason being that when I want to adjust the timing of the actions, I almost never want to affect the mouth switch layers, because the lip sync would be messed up. Additionally, since there's a lot of talking in my animation, the consolidation layer is almost completely filled with keyframes, with very few empty frames, which reduces its usefulness as a gauge of movement.

Another consequence of this, since the scripts consider these lip sync keyframes when deciding what can be shifted to the left, I can't actually shift anything to the left, because there's always a lip sync keyframe in the way. When I first tried the scripts, I found that I could shift keys to the right, but not the left, and it took a little while to figure out it was because of the lip sync.

The way I usually work is to animate the lip sync first, then animate the motion to accent the dialogue. I can see one possible workaround using the scripts as-is, if I can find a way to export lip sync into the kind of data files that AS can read back in after I delete them and work with the timing, re-loading the lip sync whenever I want to check how it all looks or render.
User avatar
Víctor Paredes
Site Admin
Posts: 5646
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Post by Víctor Paredes »

I'm using it right now in a project and it's fantastic to adjust the times, I'm avoiding a lot of work!
Rudiger, a question about what Touched said, can a script affect several selected layers?, maybe that could be the solution, but I don't know if scripting interface has access to several selected layers. Uhm, but if that works you should select all layers you want to move, even the children of a parent layer... and that wouldn't be so cool.

Another think, as you authorized me to report bugs :roll: I find a new one. Bone Dynamic keyframes are not affected by the scripts. It is not a huge problem, anyway.

Thanks again! :D
User avatar
Touched
Posts: 504
Joined: Mon Dec 11, 2006 7:33 am
Location: Sunny California
Contact:

Post by Touched »

Perhaps another workaround I could do would be to temporarily move my switch layers out of the hierarchy, then use the non-global tools only, for a layer and its children. But this also has a problem that hadn't occurred to me before, that I use bones on my mouth layers for movement in addition to the switch data, so what I really need is just a way to make the scripts completely ignore the switch-swapping keys only, and not the bone movements ON the switch layers.
Post Reply