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

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

Moderators: Fahim, Distinct Sun, Víctor Paredes, erey, Belgarath, slowtiger

User avatar
heyvern
Posts: 6964
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern » Wed Jul 15, 2009 9:21 pm

Woohooo!! This is GREAT! Dang! I really really needed this LAST week!

I have a suggestion for a feature:

Nudge only key frames of selected bones or points.

My head rig has groups of bones for eyes, mouth, eyebrows etc. I often select a set of bones within these groups to adjust the keys. It would be fantastic if the nudge keys would only move keys of the SELECTED bones.

I created a script that selects only the bones that have keys on a frame. It's not a perfect solution and I still have to shift select bones sometimes but it saves a little time. This is great for adjusting the keys of specific groups of bones on a frame. Having the nudge keys work with selected bones would be great.

p.s. I don't think it is possible to check for selected KEYS in the time line. I don't think the AS script interface recognizes selected keys. It does recognize selected objects which could then check for keys of that object.

-vern
Rudiger
Posts: 786
Joined: Sun Dec 18, 2005 2:25 am

Post by Rudiger » Thu Jul 16, 2009 1:58 am

Hehe, I thought this might happen. There is already a provision in the code to exclude layers by name... (RT_NudgeKeysLeft.filterOutLayersExpr at the bottom of rt_nudge_keys_left.lua). It uses string.find, so you can use the standard lua pattern matching syntax. However, Selgin's idea of only affecting selected layers (if more than one is selected) is probably a better way to go.

Also, excluding channels or only acting on selected points/bones is certainly doable as well. All of the tools use the same rt_get_layer_channels function in the rt_utilities.lua file, so it should be fairly straight-forward to add extra filtering to this function.

I was also wondering, do people like the way this is implemented as separate button scripts or would they prefer a single tool that you have to select if you want to nudge keys? That way you could have the options available at the top of the workspace, but you would always have to switch tools before you could start nudging keys. If keep it as separate button scripts you would set options with a separate menu script.

Thanks for spotting another missing channel, Selgin. I also noticed that I'm missing audio channel keys as well. I believe all of these are available in the scripting interface, so should be easy enough to add. Also, I got a message from SynthSin telling me that the frame offset due to the sequencer is indeed available in the scripting interface, so that issue should be fixable as well. I also found out that I'm not preserving the parameters of any of the keys which is why the cycle keys were always going back to frame 0, as reported by Selgin.

I should be able to post an update with all of these bug fixes and feature requests next week. Should also be able to come up with a menu script for setting the options as well.

I'm glad people like this tool and please keep the suggestions coming.
User avatar
heyvern
Posts: 6964
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern » Thu Jul 16, 2009 4:08 am

Actually I think I would almost like there to be just one button with everything. I will use the key commands to move the keys. Simple to just memorize that then to click the buttons. As you can imagine the tool palette is getting quite packed on my system.

The fact that there IS easy simple key commands I don't think I would ever use the actual buttons ever.

Love these scripts!!! Woohooo!

-vern
User avatar
Víctor Paredes
Posts: 4997
Joined: Wed Jan 26, 2005 12:18 am
Location: Ireland/Chile
Contact:

Post by Víctor Paredes » Thu Jul 16, 2009 4:45 am

I prefer to have buttons for everything, just because that means hotkeys for everything.
In AS 5 I was worry about the size of my tool palette -my notebook screen is 12''- but in version 6 I can just make it disappear with control+T (because of my workspace tip), and it's great because I know most of the shortcuts, so I don't need to see the tool window often.
Anyway, it would be cool if you could add shortcuts to menu scripts... because you can't, right? :roll:
Or at least add shortcuts to tools inside tools (like the new draw shape tool).


Rudiger, the problem with the idea of nudging only the selected layers is that you would need to select all children (and children of children) layers, which would be a nightmare with complex projects.

Thanks again for the scripts and for future version. It's just awesome, I hope to show you all soon the project I'm working with it.
Rudiger
Posts: 786
Joined: Sun Dec 18, 2005 2:25 am

Post by Rudiger » Thu Jul 16, 2009 5:24 am

Selgin, can't wait to see what project you're working on. Hopefully, these scripts will help us get to see it slightly sooner than without them.

And don't worry, if I did add the ability to only operate only on selected layers, it would most definitely be a set and forget option.
User avatar
Touched
Posts: 504
Joined: Mon Dec 11, 2006 7:33 am
Location: Sunny California
Contact:

Post by Touched » Thu Jul 16, 2009 5:26 am

I like the separate hotkeys myself, and I find the buttons to work fine that way.

So are you saying I could edit the script and tell it to ignore any layer named "mouth"? If so, does that also ignore keys on its children? Still, the problem would remain that I want it to nudge the bone keys on the switch layers, just not the switches themselves. I use bones on switch layers to position the mouths during head turns, and if I nudged a keyframe during a head turn, the mouth position would go out of sync with the rest of the head if it ignored the layer entirely. So, unless there's a way to tell it just to NOT nudge switch keys, I'm left with the one workaround of trying to find some way to export switch data to reload after I've deleted it for the purpose of nudging. I haven't been able to find such a script to export switches into a Papagayo-like .dat file from an Anime Studio file. (I don't use Papagayo, I animate the lip sync directly in AS).
Rudiger
Posts: 786
Joined: Sun Dec 18, 2005 2:25 am

Post by Rudiger » Thu Jul 16, 2009 6:06 am

Touched wrote:I like the separate hotkeys myself, and I find the buttons to work fine that way.

So are you saying I could edit the script and tell it to ignore any layer named "mouth"? If so, does that also ignore keys on its children? Still, the problem would remain that I want it to nudge the bone keys on the switch layers, just not the switches themselves. I use bones on switch layers to position the mouths during head turns, and if I nudged a keyframe during a head turn, the mouth position would go out of sync with the rest of the head if it ignored the layer entirely. So, unless there's a way to tell it just to NOT nudge switch keys, I'm left with the one workaround of trying to find some way to export switch data to reload after I've deleted it for the purpose of nudging. I haven't been able to find such a script to export switches into a Papagayo-like .dat file from an Anime Studio file. (I don't use Papagayo, I animate the lip sync directly in AS).
If you're talking about editing the script and you want to use it right now, you could just go in the rt_utilities.lua file and look for where it adds the switch values and temporarily comment that out. It will affect all of the scripts, including the create_consolidated layer script. Hopefully, next week I'll be able to post a new version which will let you exclude certain channels using a menu script.
User avatar
Touched
Posts: 504
Joined: Mon Dec 11, 2006 7:33 am
Location: Sunny California
Contact:

Post by Touched » Thu Jul 16, 2009 1:44 pm

That appears to have worked perfectly! My problems are solved. Thank you! :D
User avatar
ink animations
Posts: 24
Joined: Wed Jun 27, 2007 12:33 am
Location: UK
Contact:

Post by ink animations » Thu Jul 16, 2009 5:42 pm

Just wanted to say thanks very much for putting your time into this and releasing it to the community.

We have requested this feature ages ago, AS really needed it.
Hopefully in future versions Mike will think to implement it as a standard feature.

Thanks again Rudiger!! :D
stefman
Posts: 75
Joined: Mon Jul 20, 2009 6:46 pm

Post by stefman » Mon Jul 20, 2009 7:00 pm

Hello Rudiger,

I am sorry, but I don't get the script to work in AS Pro 6.

I can create the consolidated timeline and the menu is integrated to AS's inter face. But when I try to nudge keys with the keybord short cuts or the new buttons nothing moves.

At the same time the LUA Console shows error messages like this

"...\Anime Studio Pro\scripts\tool\lm_smooth.lua:24: error in function 'localize',
argument #2 is 'string'; '[no object]' expected"
(perhaps this has nothing to do with it, I just try to provide as many information as possible)

Do you know what could be the reason.

Thank you very much in advance for your help,

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

Post by Rudiger » Mon Jul 20, 2009 8:14 pm

You're right that the error is unrelated to my nudge tools, but what might be happening is that AnimeStudio stops loading in tools when it encounters the error, so the nudge tools aren't getting loaded.

lm_smooth is a v5.6 tool that you've copied over to your v6.0 directory, right? There are some incompatibilities between versions (eg the Localize function) which means that you have to modify v5.6 tools if you want to use them in v6.0. The easiest fix is to simply get rid of the localize functions and use the string directly instead. Otherwise, you can try modifying the Localize function calls to use the new syntax..
MOHO.Localize("/Scripts/Tool/Curvature/Description=Drag side to side to adjust the curvature through the selected points")

I'm sure other people have already done it on here, so just have a bit of a look around.

Good luck and hope you like these scripts when you get them working. A new version is in the works. All the bugs that people have reported are fixed and I am now adding a menu for modifying all of the new options.
stefman
Posts: 75
Joined: Mon Jul 20, 2009 6:46 pm

Post by stefman » Mon Jul 20, 2009 10:22 pm

Mmm, I never had another version than the v6.0 running on it. So, I didn't inherit older scripts.

Now, I reinstalled AS and the LUA Console doesn't appear any more.

But, I still can't use the script. The buttons are well integrated in the interface but they unfortunatly don't do anyting.

Did I do something wrong?
I copied the element from the "Other" folder to the AS's "Other" folder and the same for the elements in the "tool" and "utility" folder.

Do I have to install anything else or in another way?

Please, excuse my stupid questions. But, I am really new to AS and I really don't know much about scripting in it.

Thanks a lot,

stefman
User avatar
Víctor Paredes
Posts: 4997
Joined: Wed Jan 26, 2005 12:18 am
Location: Ireland/Chile
Contact:

Post by Víctor Paredes » Mon Jul 20, 2009 10:34 pm

Did you modify the "_tool_list.txt"?
stefman
Posts: 75
Joined: Mon Jul 20, 2009 6:46 pm

Post by stefman » Mon Jul 20, 2009 10:49 pm

Oh, no I hadn't done that.

Know it works fine. Great!!!.

As you can see I really am new to this topic.



Thank you very much Rudiger and Selgin!


stefman
User avatar
Víctor Paredes
Posts: 4997
Joined: Wed Jan 26, 2005 12:18 am
Location: Ireland/Chile
Contact:

Post by Víctor Paredes » Mon Jul 20, 2009 11:08 pm

I'm glad that worked, welcome to the amazing world of scripts :roll:
Post Reply