New Script to reorder FBF layers

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
User avatar
strider2000
Posts: 443
Joined: Sat Mar 07, 2015 5:14 pm
Contact:

New Script to reorder FBF layers

Post by strider2000 » Sat Jul 11, 2015 3:03 am

In the Frame By Frame discussion
viewtopic.php?f=5&t=27514#p155715
there was discussion on FBF layer naming/numbering, in particular with the fact that in betweens don't have a number "in between" the initial key frames.

I was wanting to learn more about AS scripts and agreed with the thoughts, so I've just added a script, msFBFReorder, that will reorder layers based on the order of their appearance in the timeline. The script is at
http://www.mediafire.com/download/9qef3 ... eorder.lua

It's also at in github at
https://github.com/Strider22/AnimeStudi ... %20Effects
for the programmer types.

- Ordering - The ordering follows the order of initial appearance in the timeline. In other words, if multiple keys reference the same layer the name/number is based on the order first reference in the timeline (I know FBF doesn't typically do this, but standard Switch layers do, and I've used it some in FBF).
- Ordering Direction - The ordering is from bottom to top, because that's the way that FBF naturally adds layers.
- Starts at 0 - The ordering starts at 0, because FBF always puts a key at 0. If you're on 0 and you create a FBF layer, it actually creates a layer, even though their seems to be no key. Then when you press + it will create a layer at whatever your frame spacing is, so you'll already have 2 layers. Since FBF seems to be following the idea of drawing on frame 0, it seemed more in agreement with the frame 0 issue to start layer numbering/naming at 0 rather than 1. It's also helpful to me to know that you can't really move that key (you'll always see a key starting at frame 0). I thought about adding a dialog to allow the user to choose 0 or 1, but thought it was cleaner to allow the renumbering without a dialog popping up.
- Testing - I've tried to test it pretty well. I've used the standard FBF approach (add, delete, duplicate, move), but also deleted, copied, and created keys based on typical switch layer approach. So I think things are working well, but I'd still advise people to save before applying just in case :wink:

Hope you enjoy :D
My new website (just getting started) | M1 Characters for Moho
User avatar
chucky
Posts: 3922
Joined: Sun Jan 28, 2007 4:24 am
Location: Van Diemen's Land
Contact:

Re: New Script to reorder FBF layers

Post by chucky » Sat Jul 11, 2015 6:34 am

Hey that is just brilliant Strider, I actually have requested this, thinking it was simple for a real programmer but impossible for a dunce like myself.
It works perfectly, though I think it should be called 'OCD alleviation script' :wink:
Sequential offender.
my latest animations
User avatar
cableon
Posts: 151
Joined: Thu Jan 17, 2008 6:44 pm
Contact:

Re: New Script to reorder FBF layers

Post by cableon » Sat Jul 11, 2015 12:08 pm

It does work indeed! :D Awesome work, thanks a lot Strider2000!!
User avatar
strider2000
Posts: 443
Joined: Sat Mar 07, 2015 5:14 pm
Contact:

Re: New Script to reorder FBF layers

Post by strider2000 » Sat Jul 11, 2015 1:31 pm

chucky wrote:... I think it should be called 'OCD alleviation script' :wink:
:lol:
I'm glad it's helpful. I love the fact that AS is making strides at better integration of drawing and bones (FBF of course, but drawing in general too). I also love the help that everyone on the forum gives, so I hope this is helpful to others.
My new website (just getting started) | M1 Characters for Moho
User avatar
Víctor Paredes
Posts: 4874
Joined: Wed Jan 26, 2005 12:18 am
Location: Ireland/Chile
Contact:

Re: New Script to reorder FBF layers

Post by Víctor Paredes » Sun Jul 12, 2015 3:24 am

Thank you!
Víctor Paredes
Former Moho Product Manager
Animator in Cartoon Saloon
My Youtube Channel - My webinars
ulrik
Posts: 1073
Joined: Thu Aug 11, 2005 10:32 pm
Location: Stockholm Sweden
Contact:

Re: New Script to reorder FBF layers

Post by ulrik » Sun Jul 12, 2015 8:04 am

Thanks for sharing! :)
Post Reply