Distribute layers to frames

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

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
jahnocli
Posts: 3471
Joined: Fri Oct 29, 2004 2:13 pm
Location: UK

Distribute layers to frames

Post by jahnocli »

Could anyone tell me whether there is a script to take a bunch of vertical layers and distribute them as a sequence of frames? I've had a look in the scripting documentation, and I can't see anything like that. It would be really useful, so I'd be amazed if it didn't exist.
You can't have everything. Where would you put it?
User avatar
Víctor Paredes
Site Admin
Posts: 5646
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Re: Distribute layers to frames

Post by Víctor Paredes »

I remember a script which automatically added keys to a switch layer, following the order of the layers it contained.
I haven't been able to find it yet, but I'm sure it should be somewhere in the forum.
Image Image Image Image
Moho Product Manager

www.mohoanimation.com
Rigged animation supervisor in My father's dragon - Lead Moho artist in Wolfwalkers - Cartoon Saloon - My personal Youtube Channel
User avatar
jahnocli
Posts: 3471
Joined: Fri Oct 29, 2004 2:13 pm
Location: UK

Re: Distribute layers to frames

Post by jahnocli »

Thanks for the reply Victor -- I'll try searching the forum (although in the past that has never been that successful!)
You can't have everything. Where would you put it?
User avatar
Maestral
Posts: 531
Joined: Tue Jan 27, 2009 5:44 pm
Location: Belgrade, Serbia

Re: Distribute layers to frames

Post by Maestral »

Could some of Mynd Tools do?
User avatar
SimplSam
Posts: 1033
Joined: Thu Mar 13, 2014 5:09 pm
Location: London, UK
Contact:

Re: Distribute layers to frames

Post by SimplSam »

I thought I had also seen this before, but could not find it -- so ...

A basic tool is available at: https://github.com/SimplSam/moho-switch ... ch2fbf.zip - with icon. I may update it later to add other bits.

To use, ensure the target layers are grouped into a Switch layer as uniquely named sub-layers. Select the Switch layer, and run the tool.

You can optionally set (using Dialog):
  • FBF Interval: - The Frame by Frame interval. (default: 1)
  • Start with: - The translation sort order: Top Layer for Top to Bottom (top => 1st frame), Bottom Layer for Bottom to Top (bot => 1st frame). (default: Top Layer)
Last edited by SimplSam on Sun Jul 04, 2021 7:09 pm, edited 4 times in total.
Moho 14.1 » Win 11 Pro 64GB » NVIDIA GTX 1080ti 11GB
Moho 14.1 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam


Sam
User avatar
jahnocli
Posts: 3471
Joined: Fri Oct 29, 2004 2:13 pm
Location: UK

Re: Distribute layers to frames

Post by jahnocli »

Many thanks SS - I'm indebted to you once again! (There didn't seem to be any access for setting sorting direction or fbf intervals -- am I missing something, or are these future possibilities?).
EDIT: Ah, I see -- just looked at the script, and these are a couple of lines that can be changed to affect the above outcomes; easy enough to tinker about with. Thanks again!
...and thanks Maestral for your suggestion -- that is a great collection of scripts, to be sure..
You can't have everything. Where would you put it?
User avatar
SimplSam
Posts: 1033
Joined: Thu Mar 13, 2014 5:09 pm
Location: London, UK
Contact:

Re: Distribute layers to frames

Post by SimplSam »

Hi. I have updated to add a Dialog for setting the configuration parameters.
Moho 14.1 » Win 11 Pro 64GB » NVIDIA GTX 1080ti 11GB
Moho 14.1 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam


Sam
User avatar
jahnocli
Posts: 3471
Joined: Fri Oct 29, 2004 2:13 pm
Location: UK

Re: Distribute layers to frames

Post by jahnocli »

Works perfectly! You, sir, are a gentleman and a scholar.
You can't have everything. Where would you put it?
F.M.
Posts: 497
Joined: Thu Nov 04, 2004 4:29 pm
Location: Between my ears

Re: Distribute layers to frames

Post by F.M. »

Thanks for your generosity!
"and then Man created god!"
Post Reply