Custom Tool - Keyboard shortcuts for Switch layers

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

Custom Tool - Keyboard shortcuts for Switch layers

Post by heyvern »

This came up in another post requesting keyboard shortcuts for Switch layers. Not as simple as "1 key" as it requires the cmd or ctrl (mac/win) modifier, but it does speed things up.

You select a switch layer, select the tool. It is just like the regular switch tool, but it has key commands in the dropdown menu. The keys are set for CMD+0-9 (mac) and CTRL+0-9 (win) at least I hope that's it for windows. Haven't tested it on that one yet. If it isn't CTRL than it's ALT. I had to add an "extra" menu item at the top of the list "Select Layer" because of the key command set up. I needed a default 10 starting with 1 and 10 is 0 so I had to have that extra "empty" menu item that doesn't do anything. Confusing I know but it works well and it's only FYI for scripting people. From the front end it just works.

At this time it only does shortcuts for 10 switch layers which is the basic set for phonemes for ASP. I do plan to expand that list but have to check through and make sure I find other keys that won't conflict. I like using 0-9, and could extend that with another modifier like; cmd+shift+0-9 for Switch layers higher than 10. Extra modifier keys aren't too bad.

Just the script. Haven't done icons for it yet.
hm_switch_commander.zip

-vern
User avatar
madrobot
Posts: 667
Joined: Mon Apr 07, 2008 3:07 pm

Re: Custom Tool - Keyboard shortcuts for Switch layers

Post by madrobot »

Yay! I think this might fit my workflow...
Yoink!
User avatar
madrobot
Posts: 667
Joined: Mon Apr 07, 2008 3:07 pm

Re: Custom Tool - Keyboard shortcuts for Switch layers

Post by madrobot »

Aaaannnnd it does. Thanks, it's a time saver. Pew!

Win ALT+ 0 down to 1 runs down your switch layers from top to bottom
Not a big deal but the mouse stays on the timeline while hotkeys carpet bomb keyframe pew pew pewwwww
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Re: Custom Tool - Keyboard shortcuts for Switch layers

Post by heyvern »

Yes the order is "backwards" will try to fix that. I'm using the same code that's used in the switch layer tool to build the menu and shortcuts and it's "upside down". Should be able to just reverse the for loop to go in the opposite direction.

-vern
User avatar
madrobot
Posts: 667
Joined: Mon Apr 07, 2008 3:07 pm

Re: Custom Tool - Keyboard shortcuts for Switch layers

Post by madrobot »

No Vern don't change it, I am in Australia so the upside down actually looks correct here.
Adrian
Admiral Halsey
Posts: 45
Joined: Wed Jul 11, 2012 7:53 pm

Re: Custom Tool - Keyboard shortcuts for Switch layers

Post by Admiral Halsey »

I have a question (sorry if it's wrong thread for that) - is there any script allowing to extract pictures from animation to the folder on the computer? I mean to save each frame of animation as png file? Of course I could do that manyally but it would be real pain.
User avatar
jahnocli
Posts: 3471
Joined: Fri Oct 29, 2004 2:13 pm
Location: UK

Re: Custom Tool - Keyboard shortcuts for Switch layers

Post by jahnocli »

You can export a movie as a sequence of picture files, including png.
You can't have everything. Where would you put it?
Admiral Halsey
Posts: 45
Joined: Wed Jul 11, 2012 7:53 pm

Re: Custom Tool - Keyboard shortcuts for Switch layers

Post by Admiral Halsey »

Of course! i totally forgot about this option! Thanks!
Btw, when uploading images to switch layer is there any way to upload many mages at the same time and not to do that manually for every image? I couldnt find any option for group uploading.
User avatar
jahnocli
Posts: 3471
Joined: Fri Oct 29, 2004 2:13 pm
Location: UK

Re: Custom Tool - Keyboard shortcuts for Switch layers

Post by jahnocli »

I've only got an old version of AS, but under the Scripts | Image menu item is a script, "Import Image Sequence" . As long as your images are sequentially numbered (pic0001, pic0002 etc), this script will import them all. Didn't somebody also develop a script for importing an entire directory? Or am I dreaming? Why am I asking myself rhetorical questions?
You can't have everything. Where would you put it?
Admiral Halsey
Posts: 45
Joined: Wed Jul 11, 2012 7:53 pm

Re: Custom Tool - Keyboard shortcuts for Switch layers

Post by Admiral Halsey »

Jahnocli, you are amazing! I really feel dumb now asking such lame questions! Thanks a bunch!
User avatar
jahnocli
Posts: 3471
Joined: Fri Oct 29, 2004 2:13 pm
Location: UK

Re: Custom Tool - Keyboard shortcuts for Switch layers

Post by jahnocli »

Glad to help. I was a newbie once...
You can't have everything. Where would you put it?
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Re: Custom Tool - Keyboard shortcuts for Switch layers

Post by heyvern »

For anyone interested in "Frame by frame" display of images in Anime Studio, I created a pretty darn cool script for that.

Basically you only need ONE image layer to play back a sequence. That single layer has an embedded script that will access and playback sequential images from a folder based on the frame number. You can change a value in the script to change the "frame rate" of the image sequence. Instead of an image for each frame, it will hold each image for any number of frames.

The beauty of this is PERFORMANCE. It dramatically improves the performance because the file never has more than one image layer. It just changes the image SOURCE on each frame.

I have to track it down and will post it in the script forum. I should modify it so it uses "layer frame" so you could offset the start time of the image playback. I wrote this script I think, back before the sequencer feature.

-vern
User avatar
gr33ndaybd
Posts: 11
Joined: Wed Aug 03, 2011 9:22 am
Location: somewhere i belong
Contact:

Re: Custom Tool - Keyboard shortcuts for Switch layers

Post by gr33ndaybd »

thanks for script :wink:
User avatar
Shade
Posts: 8
Joined: Tue Sep 27, 2011 4:22 pm

Re: Custom Tool - Keyboard shortcuts for Switch layers

Post by Shade »

hello. I previously made a request for this tool
viewtopic.php?f=12&t=22967&sid=8b65e0f8 ... 70f4d#wrap
can you say.. it really make this script?
User avatar
madrobot
Posts: 667
Joined: Mon Apr 07, 2008 3:07 pm

Re: Custom Tool - Keyboard shortcuts for Switch layers

Post by madrobot »

Hey... Heyvern
I am a big fan of your switch commander script and found it worked beautifully in AS8

Check this out:
Image

It's an iPad1 running "Actions" app with custom hotkeys for AS9.2. Works a treat in tandem with my Asus slate.

My lipsync rig is mostly automated, I use the inbuilt sound file phoneme reader (I'm sure its actual name is more elegant than that) and then do a "tidy" pass with Switch Commander. I think the custom hotkeys will make this more efficient, particularly as I have a butt-tonne of dialogue scenes to key.

The problem I am having is that the script is not working in AS9.2. I got in and changed it to Ctrl+SHift+(0-9), but that still only worked with "0". The rest simply don't respond (it doesn't key) and Ctrl+8 give me noise settings and Ctrl+9 cycle settings.
(I'm guessing they are hotkeys set in AS9, since an earlier release for all I know. Interestingly they are still called on Ctrl+Shift. I thought adding the Shift key might get around it but no.)

So Vern if you have any thoughts please let me know, and if anyone else has any ideas they are welcome also. I don't mind having a go at the script but I don't really know what I'm doing...
Post Reply