Ok, here is how it works.
There are four kinds of scripts
Menu, button, tool and layer
A
menu script is which will appear on Script menu on the top main Anime Studio window. Once you clicked it, it will do his work automatically or will appear a popup window offering you some options before pressing OK.
A
button script works just like a menu script (and actually, are equals), but the difference is that a button script is "installed" on the tool palette and you have the option to give it a shortcut. So, once you press the shortcut, it will do his work or will offer you some options before pressing OK.
A
tool script must be installed on tool palette too. The difference between this and a button is that the tool doesn't make the work immediately when you click it. Clicking it means you are selecting the tool to work with it. A tool can have a shortcut too.
For example, on the tool palette, Insert text is a button. It offers you some options and once you click ok, the work is done.
Add points is a tool. Once you click it, you are selecting it to work, then you make the work of adding points in the way you want.
A
layer script is a script you embed in a specific layer. It must be safe on the same folder of the project you are working (similar to when you import an image). To embed a script to a layer you must go to the proprieties of the layer and in General tab check "embedded script file" and then select the script you want.
Ok, with that idea in mind, let's see how to install a button script.
First, you copy the script on the folder "tool"
C:\Program Files\Anime Studio Pro 7\scripts\tool (in my case)
Maybe the script has more files, like an icon and a cursor in png format. Copy them on the same tool folder, at least they have specific instructions of doing on another place.
Now open the text file "_tool_list.txt", which is inside the same "tool" folder.
It's a text visualization of your tool palette. You will see it's separated by groups: draw, fill, bone, layer, etc.
All the tools and buttons you are using are wrote there. So, to add our new button we have to write his name in some of the groups.
You must write the name of the script without the ".lua" extension.
so you write "button", then press tab, "DR_two_way_ticket_frame0", tab again, and the shortcut you want to add for this tool (K in the example)
Be sure that the "K" shortcut not being used by other tool or button.
If you don't want a shortcut, wrote "..." instead "K".
for example, I have added it to the group Workspace, so now it looks like this
Code: Select all
group MOHO.Localize("/Tools/Group/Workspace=Workspace")
tool lm_pan_workspace ...
tool lm_zoom_workspace ...
tool lm_rotate_workspace 8
tool lm_orbit_workspace 9
button DR_two_way_ticket_frame0 K
Now, save the changes you made on "_tool_list.txt", close Anime Studio (if it was opened) and open it again.
You will see your new button completely working on the tool palette.
I hope it be clear enough and don't look to tricky. It's actually very easy when you get it.
PD: You can create new groups too. Just use the native ones as example.
PD2: If you copy a script on the tool folder without changing the "_tool_list.txt" file, AS will automatically will think that the script is a tool (and not a button) and will create a group called "other" on the tool palette.