Need a hotkey to make the next layer active

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

Post Reply
bill_lake
Posts: 8
Joined: Tue Mar 13, 2012 4:08 pm
Location: Virginia
Contact:

Need a hotkey to make the next layer active

Post by bill_lake » Thu Aug 06, 2015 7:58 pm

Scenario:
I have a vector head turn (complex head with multiple layers.) The head turn takes 8 frames. Later, I want to slide the head turn to a new point in time, to get my timing just right. So I go to each of the 18 layers that make up the head, select all the keyframes, and slide them to the right. (some layers are vectors, some are masked, some are switch-phonemes).

I want this to be easier. Simply moving my mouse all the way back to the layer panel to select the next layer makes it take twice as long. If I could program a hotkey to select the next layer (like a alt-downarrow/alt uparrow) - at least that way, I don't have to keep moving my mouse so much and I can stay in the timeline.

Anyone know of a solution?
User avatar
synthsin75
Posts: 7103
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Need a hotkey to make the next layer active

Post by synthsin75 » Fri Aug 07, 2015 12:07 am

Make the head turn into an action. Then you can add the action at any frame you like.
bill_lake
Posts: 8
Joined: Tue Mar 13, 2012 4:08 pm
Location: Virginia
Contact:

Re: Need a hotkey to make the next layer active

Post by bill_lake » Fri Aug 07, 2015 3:24 pm

Synthsin75: Thanks but that doesn't really address my need. I don't think I explained it correctly: I’m looking for a script.

I’m a professional AS user and I am editing 500 existing AS character files (created in early versions of AS Pro) and I need to move gestures to align with revised voiceover tracks. A single gesture involves bone or point-animation on 20 bone or vector layers (they are not movable actions, but keyframes). To do this currently, we select each layer, select the key-frames within the gesture-range and cut-paste to the current time marker. Then we select the next layer and do it again, for all 20 layers. I want to automate this, or part of this, with a script.

I think there are 2 options:
1) Use a key-bound script to moves the bone or point keyframes within the gesture-range to the current time marker.
I could select multiple layers, then start the script. The script could accept keyboard input to specify the selection-range (start-frame end-frame #), then cycle through all selected layers and do: with selected-layers, make first selected-layer active layer: with active layer select all bone/point key-frames in selection-range, cut keys, paste keys at current time-marker, increment to make next layer of selected-layers, repeat.

2) Or, use a key-bound Script ctrl-up-arrow/(ctrl-down-arrow): increment active layer +1 (or -1). This would allow me to at least rapidly change active layers. This would be very useful, anyway.

Does anyone know of a script that does this? Or how to create it?
User avatar
synthsin75
Posts: 7103
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Need a hotkey to make the next layer active

Post by synthsin75 » Sat Aug 08, 2015 12:09 am

Unless you have a scripter in your pocket, finding someone to write this sort of limited-need script will not be easy (unless someone already happens to have similar code they could easily repurpose).

The most immediate solution would be to create a new action at the top group/bone layer of the layers you need to adjust, copy the mainline to this action, and then add the action where needed. The only problem will be deleting the old position of the animation across all those layers. If the animation is everything in a particular group/bone layer then the menu command Animation>Delete animation from current frame can be used, selecting to delete from sublayers. But you have to do that for every frame in the range.

If you know how to write macros, there is software that would allow you to automate the process. Personally, I'm surprised you animated 500 characters and didn't use actions for things you need to reuse often, like head turns, especially if not animating to a finalized voice track. Maybe easier if you can get away with editing the timing of the voice track. Or if you are brave, you could edit the AS file format directly (always backup the file first).
Post Reply