Switch layer tool that uses key commands to add keys

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

Moderators: Víctor Paredes, Belgarath, slowtiger

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

Switch layer tool that uses key commands to add keys

Post by heyvern »

This was driving me crazy. I have a lot of lip sync to do and it's really easy but it would go so much faster if I could use a key command to key the different switch layers.

Unfortunately it only works with the first 10 layers of a switch.

Type cmd+number (0-9) for mac. ctrl+number on windows.

===================
EDIT!!! July 3rd
Previous version did not work on Windows.


New version works this way:

On the Mac it is CMD + the number (0-9)
On Windows it is ALT + the number (0-9)

===============
Udated July 4th!!! Kaboom!
Added screen update so the switch changes shows imediately upon selection with the key command.

===============

It is technically 0-9 but it is really 1-0 on the keyboard. the 0 is actually 10 so that it goes in a logical order on the keyboard. So cmd-1 keys the first layer in the switch, cmd-0 would key the 10th layer.

My goodness this saves me lot of right clicking... no more right clicking... well... unless you have another tool selected of course, but if you are doing a long session of lip sync this really speeds things up.

Below is the script and the icon. The icon is just a copy of the original LM tool.
http://www.lowrestv.com/anime_studio/sc ... _layer.lua
Image

-vern
Last edited by heyvern on Fri Jul 04, 2008 5:29 pm, edited 2 times in total.
User avatar
toonertime
Posts: 595
Joined: Tue Feb 27, 2007 8:34 am
Location: ST. LOUIS

curious

Post by toonertime »

I am wondering which folder you would save
your useful script in?
User avatar
synthsin75
Posts: 9934
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Post by synthsin75 »

:( I guess this only works with a number pad. Regrettably my laptop doesn't have one, and it doesn't appear to work with the keyboard numbers.
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

IT DOESN"T WORK ON WINDOWS?????????

What the heck?

I just can't win. It works fine on the mac, doesn't work at all on windows. Oh well back to the drawing board.


Sorry guys. I think I should stop sharing this stuff. Apparently it only works for me.

:oops:

-vern
User avatar
mkelley
Posts: 1647
Joined: Fri Nov 02, 2007 5:29 pm
Location: Sunny Florida
Contact:

Post by mkelley »

That's okay, Vern --your heart is in the right place.

I really wish it did work for us Window users. I have a Shuttle Pro and I was envisioning adding the commands to the buttons (I already have a "key all" as well as "Key various thingees" assigned that make it super fast to animate -- but I do have to do the right click number when working with switch layers, which I do A LOT!

Sigh.
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

FIXED!!!


Dagnabbit.

So CTRL key works on mac but not PC.

ALT KEY works on PC BUT NOT ON MAC!!!!!

-----------

I hate to do two different versions so...

On the Mac it is CMD + the number (0-9)
On Windows it is ALT + the number (0-9)

So freaking stupid annoying. It's just key commands. I thought they were the same?

-vern
Last edited by heyvern on Fri Jul 04, 2008 5:18 am, edited 1 time in total.
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

I don't have Linux to test this. If it was this much trouble on Win/Mac I have no idea for Linux.

No wonder I've had so much trouble with platform line breaks too.

-vern
User avatar
mkelley
Posts: 1647
Joined: Fri Nov 02, 2007 5:29 pm
Location: Sunny Florida
Contact:

Post by mkelley »

Yeah -- I can use this a lot (too bad I didn't have it a few days ago... but at least I finished my job with the whole three day weekend to spare!).

I love this key command stuff -- using the shuttle pro I can edit so much quicker in AS than I can with the keyboard (because that way I can keep one hand on the mouse -- with key commands it's invariably the mouse hand I need to press the right key :>).

My only pet peeve is the keyboard play command, spacebar, behaves differently when you are in a vector layer. So I can't stop and start play if I'm editing a vector layer except with the mouse on the arrow key of the display. That's a real PITA.

Thanks a lot, Vern, for all your efforts!
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

mkelley wrote:
My only pet peeve is the keyboard play command, spacebar, behaves differently when you are in a vector layer. So I can't stop and start play if I'm editing a vector layer except with the mouse on the arrow key of the display. That's a real PITA.
That's weird. On the mac if you hit the "space" while creating shapes in the time line, it starts to play... freaks me out! Space bar works to play and stop on a vector layer too.

I guess pc and mac of AS isn't the same.

----------------

I saw an add on the Content Paradise site. Right on the home page, of a FREE copy of an "Anime Studio Pro Windows/Mac Hybrid". They were giving it away for free. If they have a hybrid to give away, why don't they sell it like that?

I didn't get the free version...you had to put yourself on 50 baziillion email marketing lists. You couldn't even opt out. It said that even if you don't sign up with any of our sponsors we will still give them your email... and they only tell you this AFTER you give them your email. Nothing is worth that kind of trouble.

-vern
User avatar
mkelley
Posts: 1647
Joined: Fri Nov 02, 2007 5:29 pm
Location: Sunny Florida
Contact:

Post by mkelley »

You could always sign up for a hotmail account and then never bother checking it again.

As someone who runs a lot of websites I'm pretty sure a lot of people do *exactly* that.
User avatar
synthsin75
Posts: 9934
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Post by synthsin75 »

mkelley wrote:My only pet peeve is the keyboard play command, spacebar, behaves differently when you are in a vector layer. So I can't stop and start play if I'm editing a vector layer except with the mouse on the arrow key of the display. That's a real PITA.
Yeah I don't follow Mike. I'm on Windows and the space bar works the same (play & stop) on vector layer as any other.
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

I update the script. It was teeny tiny fix that is very helpful. It refreshes the screen now so after changing the switch it updates the screen.

It's those tiny things you miss that drive you crazy.

-vern
User avatar
mkelley
Posts: 1647
Joined: Fri Nov 02, 2007 5:29 pm
Location: Sunny Florida
Contact:

Post by mkelley »

synthsin75 wrote:
mkelley wrote:My only pet peeve is the keyboard play command, spacebar, behaves differently when you are in a vector layer. So I can't stop and start play if I'm editing a vector layer except with the mouse on the arrow key of the display. That's a real PITA.
Yeah I don't follow Mike. I'm on Windows and the space bar works the same (play & stop) on vector layer as any other.
Not if you have any of the vector editing keys active -- try this, select a vertex (with T) and then press the spacebar. On any of my machines this disables the ability to play (because the spacebar is a vertex editing command when any of the editing keys are selected -- it joins vertices together).

This HAS to be the case -- the spacebar can't function both ways. But it's frustrating to me because I'm always editing vertices and wanting to play and either need to select out of the edit keys or press the arrow (or select another layer). It's even more frustrating because I have my shuttle pro defined to act as the spacebar so normally that's *always* a play key for me (except when I'm editing vertices, which is a lot).
User avatar
madrobot
Posts: 667
Joined: Mon Apr 07, 2008 3:07 pm

Post by madrobot »

:shock:
Thanks Vern!

You obviously put a LOT of work into all these scripts you've produced.
I'm sure you've heard this before, but I have to thank you for your efforts mate. This will save a lot of time keying switch layers.
Cheers!

And I have a question - would it be possible to do something similar with actions? So if you were rigged with actions for your phonemes you could use a similar method in lipsyncing?
User avatar
synthsin75
Posts: 9934
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Post by synthsin75 »

mkelley wrote:Not if you have any of the vector editing keys active -- try this, select a vertex (with T) and then press the spacebar. On any of my machines this disables the ability to play (because the spacebar is a vertex editing command when any of the editing keys are selected -- it joins vertices together).
I'll be damn. The original LM tools do work that way. Wow, I could really use that sometimes. I usually use Fazek's tools exclusively, but I haven't removed the LM ones (just changed the shortcuts to Fazek's).

You may like Fazek's versions, since the space bar is always 'play/stop' on any frame other than zero and any layer type. The only problem is when you do want to use the Fazek tool to join points, it joins them and plays.

I've gotten to where I'll hit the space bar two times real quick to then stop playback. I kind of wish Fazek's didn't do this, but it sounds like it may be useful to you.

:wink:
Post Reply