Page 1 of 1

New Script to reorder FBF layers

Posted: Sat Jul 11, 2015 3:03 am
by strider2000
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

Re: New Script to reorder FBF layers

Posted: Sat Jul 11, 2015 6:34 am
by chucky
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:

Re: New Script to reorder FBF layers

Posted: Sat Jul 11, 2015 12:08 pm
by cableon
It does work indeed! :D Awesome work, thanks a lot Strider2000!!

Re: New Script to reorder FBF layers

Posted: Sat Jul 11, 2015 1:31 pm
by strider2000
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.

Re: New Script to reorder FBF layers

Posted: Sun Jul 12, 2015 3:24 am
by VĂ­ctor Paredes
Thank you!

Re: New Script to reorder FBF layers

Posted: Sun Jul 12, 2015 8:04 am
by ulrik
Thanks for sharing! :)