AutoKey Switch and Auto Depth Arrange

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

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
dkwroot
Posts: 677
Joined: Thu May 02, 2013 6:56 am
Location: USA
Contact:

AutoKey Switch and Auto Depth Arrange

Post by dkwroot »

I created two menu scripts that take care of some redundant tasks. The first script will auto arrange all of the child layers within a group according to Z-depth value. How this works is that it looks at the layer at the very bottom and sets it's Z value to zero, then it goes up the list increasing the z-depth of the layers by some increment determined by the user. This is useful for folks that like to arrange layers by z-depth. All you have to do is have a group or bone or switch layer selected and activate this script.

The second script autokeys all of the child layers within a switch layer. It will key all of the layers from the bottom layer up. All you have to do is have a switch or FBF layer selected and activate this script.

LINK:

*EDIT*
The url has been updated with a newer version of the script.
Last edited by dkwroot on Sat Oct 02, 2021 1:44 pm, edited 3 times in total.
dkwroot
Posts: 677
Joined: Thu May 02, 2013 6:56 am
Location: USA
Contact:

Re: AutoKey Switch and Auto Depth Arrange

Post by dkwroot »

I updated this script. It now has the added feature that when a group or bone layer is selected, it will switch out the visibility of the child layers. This essentially allows the user to easily turn a bone layer into a switch layer using smart bones.

To use this script, just have a group, switch or bone layer selected and activate the script. If you are using a bone or group layer, you will have the additional option of selecting child layers which will make the script use only those child layers in the switch visibility. This allows the user to make certain child layers exempt from the switch.
Last edited by dkwroot on Tue Jan 31, 2017 7:47 am, edited 1 time in total.
User avatar
synthsin75
Posts: 9964
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: AutoKey Switch and Auto Depth Arrange

Post by synthsin75 »

At first that sounded redundant, since we can already convert bone layers to switches, but then being able to make some layers exempt would allow for masking with the smart bone switching. Nice.
dkwroot
Posts: 677
Joined: Thu May 02, 2013 6:56 am
Location: USA
Contact:

Re: AutoKey Switch and Auto Depth Arrange

Post by dkwroot »

synthsin75 wrote:At first that sounded redundant, since we can already convert bone layers to switches, but then being able to make some layers exempt would allow for masking with the smart bone switching. Nice.
There are limitation to working with switch layers that Bone layers don't have. For example, create a switch layer and make a bone inside of it. Then create a group layer and place it within the switch. Then create a vector layer and place it inside of the nested group layer.

If you click on the vector layer, you will discover that you can't bind the vector layer directly to the bone in the switch. This is a big problem if you want to create complex rigs using Victor's technique: viewtopic.php?f=9&t=30445

Interestingly, if you use a bone layer instead of a switch layer everything works fine.
Post Reply