Updated: June 20, 2008
- Version 1.0. Fixed a few things for v7. Interpolation is now saved. Can import directly to an action. Includes icons when used as buttons (for Debut. Debut has no menu scripts).
There is a folder called menu_or_button_scripts.
Either place these scripts in the scripts/menu folder of your Anime Studio Pro installation or put them in your scripts/tool folder.
Then you need to edit your _tool_list.txt by adding this line of text to the bottom or your vector button listing as shown here:
Code: Select all
group Bone color 204 220 232 255 tool lm_select_bone B tool lm_translate_bone Y tool lm_scale_bone S tool lm_rotate_bone R tool lm_add_bone A tool lm_reparent_bone P tool lm_bone_strength ... tool lm_manipulate_bones Z tool lm_bind_layer ... tool lm_bind_points I tool lm_offset_bone ... button hv_save_bone_animation ... button hv_load_bone_animation ...
Oh good grief it's so freaking EASY! I don't even need to explain it.
There are two test files in the zip archive. One is "A" and one is "B".
Open the "A" file in AS. Make sure you select the top layer which is a bone layer. You must select a bone layer to use these scripts. Then select the save bone animation script; either the button or from the scripts/menu.
A window pops up that is pretty self explanatory. You can set the frame range of the saved animation.
Hit okay, name and save the file to your hard drive. There is no custom file format so you can save with the ".txt" extension. I may add a custom extension but it hardly seems necessary. Now close the "A" file.
Open the "B" file and run the load bone animation script.
Remember you must select a bone layer.
This has more "stuff". Choose the attributes of the bones animation channels you want to copy. Also there is a check box for "overlay" that will leave any keys already in place alone.
You can experiment with the sample files to see how the different settings effect the file diffferently. For instance there are no constraints or bone offset in the "B" file. When you load the animation file you saved and check the bone offset attribute that gets applied.
The only way to copy bone animation from the file is if the bones from the file you are importing into has the same named bones as the original you saved from. All other extra bones are ignored.
Notice in the "B" file there are a bunch of extra bones. When loading the animation files these bones are left alone. If you delete the "head" bone for instance the animation still loads. It just ignores the missing head bone.
NEW! Select all keyed bones
Updated: Dec 8, 2008
Download and unzip directly into your scripts/tool folder. Edit the _tool_list.txt file and add the name of this script as a button:
Code: Select all
button hv_select_keyed_bones ...
Another one of those "this is driving me CRAZY" scripts created out of frustration in in 15 minutes. I always have to figure out which bones have keys and which don't so I can copy keys only for the bones that HAVE keys from one frame to the next.
Very simple to use. With a bone layer selected click this button on any frame in the time line (other than zero). Any and all bones that have translation, rotation or scale keys will be selected. Then it is an easy matter to just select the keys of the selected bones and copy or delete or move them.
I would like to add to "filter" different bone channels. So you can select all bones on a frame with only rotation keys, or just translation keys etc. Not sure exactly how to implement this but a pop up with check boxes might be a way to go, or if possible holding down a modifier key. Have never tried that with a button so I'm not sure if it works or not.
Another option would be to have multiple buttons for each channel. Don't like that one much. And yet ANOTHER option would be to make this a tool instead of a button with check boxes for the tool and then you just click on the screen to select. Seems like it breaks the flow if you have to switch tools though.
NEW! Copy Paste Bones!!!!!!!!!!!
Updated: July 12, 2008
Download the script and place into your scripts/tool folder. Edit the _tool_list.txt file and add the name of this script as a button. Other wise if you don't want to use it as a button and you have AS Pro, install in the scripts/menu folder
Pretty simple. Select the bones you want to copy. Set the percentage of scale. Check the box if you want to flip the bones left to right. Optionally check the "Copy to parent" check box if this is a child layer of a bone layer and you want to copy bones to the parent layer.
When copied to the same layer the bones are "offset" and "_copy" is appended to the name. However if you copy the SAME bones you will end up with a duplicate set with the same names. It will still work fine it just might be confusing to tell them apart. I reccomend my bone renamer script to keep the names unique after copying. It's up to you.
When copying bones all the constraints (except dynamics) are copied and applied. If the bones copied have control parents that are ALSO being copied the constraints are changed to point to the new copied bones.
If you copy bones and the constraint target is NOT copied the copied bones constraint target will be the same as the originals.
The scale function is FANTASTIC BABY! Set the scale and the bones are reduced or enlarged, including offset!!!!
I'm very happy with this script. it makes copying complex joint rigs a total breeze.
Find them for me. It's working pretty good for me.
NEW! Flip Points With Bone Binding button script
Updated: June 25, 2008
Place this script in the scripts/tool folder of your Anime Studio Pro application directory.
Then you need to edit your _tool_list.txt by adding this line of text to the bottom or your vector button listing as shown here:
Code: Select all
spacer button lm_smooth M button lm_peak P button lm_flip_points_h ... button lm_flip_points_v ... button hv_flip_points_h ...
This is intended for use with the Copy Flip Bones and Bone Renamer scripts below this one. It is very simple.
You have an arm vector layer. You have bound points to different bones in the the parent bone layer. Now you want to duplicate the arm for the other side but you don't want to go through the trouble of binding all the points on the opposite bones.
First make sure you have IDENTICALLY NAMED BONES in your bone layer. They must be exact copies with extensions EXACTLY like this:
etc etc. The names must use _right and _left or the script won't do its magic. The flipper and renamer scripts make simple work of that task. Very easy.
Once the bones are setup simply duplicate your example arm layer, select all of the points and click the "flp horizontal" button I created for you.
The points will flip... but they aren't in the precise location (I'm working on this I promise).
All you do now is using the Standard AS translation tool (not fazek's if you have his tools installed) change the value in the x translation box so it is the opposite of what ever is there.
If the grouped points x position is say -1.346 remove the minus sign and the points will "flip" to the other side.
This flipping is of course based on the origin point of the layer. If the layer or the bones are not exactly centered you will have to slide the points in to the correct position.
Now check to make sure it worked by click on bones with the bone tool while still having the vector layer selected. The bound points will become selected showing that the binding was properly flipped.
Any questions or comments please post them here.
UPDATED! Copy and Flip Bones menu script and Rename Bones menu script
Updated: June 25, 2008
Place these scripts in the scripts/menu folder of your Anime Studio Pro application directory.
OR just add them as tools to your scripts/men/tool folder. Then you must edit the _tool_list.txt file and add these scripts as buttons (see the description above for the point flipper).
UPDATED!Now flips angle constraints and angle parent values (still working on the others)
Bone Renamer script. Very simple to use. Either replace text in a bunch of bones or append text to the end of each bone name like an extension. Select any number of bones and run the menu script.
I made this for use with the copy flip script. Now you can easily add or change the extensions on all the bone names.
Here is a sample file you can use for testing. It is the same file I used in the instructions below:
Create one side of a skeleton or symmetrical bone rig and copy and flip to the other side.
Completely FIXED 100% functional!
(I still haven't added the translation constraint values or the dynamic constraints but the other errors are fixed)
Script copies and flips angle limitation constraints and also the angle parent constrain values.
Angle constraints (or limits at the top) are "flipped". The negative minimum value is swapped with the max value. Both values have their negative/positive values flipped.
For instance a bone with angle constraints; min: -100 max: 50; will be copied and flipped with these values; min: -50 max: 100.
I am still working on the translation and scale constraints. I just did this quick because I needed it right away.
This script only works on frame 0.
No bone needs to be selected.
Just run the script. Flipping is based on the LAST in the "chain". The root bone of each "group".
For instance if you have a chest bone and all the arm bones have the extension _right at the end of the name running the script will flip those bones using the chest bone as the center axis for flipping.
All of the bones you want to flip must have an extension at the end of the bone name. If you have multiple sets of mirrored bones you need to make sure the "extension" is different for each set for something like hips or chest.
If all of your "flipped" bones have the same extension, for example _right then running the script will flip all the bones.
If you only want to flip the arm bones, change the extension to something else and use that in the script dialog box for the copied extension
For example thigh_hips-rt or thigh_h-rt or bicep_chest-rt or bicep_c-rt. This name would be used for a bicep since it would most likely be a child of the chest. You can always use the bone renamer script later to change all the bone names after you are finished.
Using Bone Renamer with Copy Fip Bones
As a sort of "helper" script to go along with this one I created a menu script (see link above) that will add or replace text in the names of selected bones. So you would select a bunch of bones and add an extension to the end of the name. Or you could select bones and change or remove an existing extension. This will make the Copy Flip script easier to work with.
To use the Copy Flip Bones script select just select it from the scripts menu. The image below shows a bone selected but this is no longer necessary. You don't have to select any bones to use the script![/b]
In the dialog that pops up shown below, there is a check box for flipping, a text field for the "copied" extension and "pasted" extension. The "copied extension" is for the existing bones. Type in the name you used to identify those bones. "Pasted extension" is the new "extension" for the pasted bones.
If "flip" is checked all of the bones that are named with the extension indicated by typing in the first box will be copied and pasted on the other side of their corresponding root bone with a NEW extension indicated by the second text box.
If "Flip" is not checked all of the copied bones will just be pasted on top of the originals but with new names based on the second text box.
Below is the result of running the script and copying just the bones that were designated with an extension for the arms. Note there is an angle constraint on one of the "finger" bones. It is copied and transfered to the new matching bone on the opposite side:
Angle or parenting of the root bone makes no difference. If the root bone of the copied flipped bones is rotated the bones copied and flipped with reflect that rotation. they will be "mirrored" to the "opposite side" of the rotated bone.
Almost everything (see below). Angle, length, position, strength etc.
Bones that have NO PARENT should not be copied, meaning do not add and extension and use the script with that extension. the script will fail.
Remember that flipping is based on the last bone of the chain that DOES NOT HAVE A MATCHING EXTENSION. If you for example added the extension to the chest bone and ran the script it would copy/flip based on IT'S parent. Basically you would get unexpected results.
Translation, scale and dynamic constraints are not copied.
This went pretty well and I don't see why it can't be extended further. That is why I deleted my previous section here about the other "copy/paste" bones script. I plan to use the code from this script since it is pretty much mine and I understand it.
A future update for this script in particular would be adding in the rest of the constraints; translation, scale, dynamics.
NEW! Bone Groups Tool
Updated: Dec 19, 2007
Taken off line temporarilly. It works fine but I decided to complete ALL the tools and fix various "problems". So far so good.
Issues being addressed:
Layers with the same name
The grouping is based on the layer name. I have fixed the problem with layers that have the same name by adding a simple function that alters the name of a selected layer if there is another layer at the same level with the same name. It only checks bone layers for now. All other types can have duplicate names since it has no effect on bone groups.
Child layer animation
A problem with the last set of scripts had to do with layer animation. If a vector layer was translated, scaled or rotated etc, the bone grouping didn't draw correctly. This is fixed.
Modified tool set
I have modified ALL OF THE FREAKING TOOLS! All of them... draw tools, layer tools... the whole thing. That was fun! Actually it isn't so bad now. All of my custom tools only have a simple reference to my utility script. I won't have to touch them again after this.
Bone selection of "hidden" grouped bones
I am still working on this one although it works... sort of. The problem is that even if you can hide grouped bones and "deactivate" selection of those bones, the "hidden" bones are still "there" as far as AS is concerned. They can get in the way of selecting bones "underneath" them. I want to have bone selection based on selecting MY bone coloring system. Instead of selecting a bone through the application UI the bones are selected based on clicking on the bone groups bone shapes in the new script. this would mean no more trouble selecting through a pile of bones. If a group is hidden it can't get in the way of bones under it.
I made a lot of mistakes up to this point. I apologize for that. I will try to make sure the big issues are fixed before posting the new scripts. I hope some of you will give it another shot when it's ready.
NEW! Aim Bone layer script
Updated: Sept 14, 2007
This contains a sample "leg" walk cycle Anime Studio file along with the script. Both should be in the same folder.
Here is a new sample file including script of a stick figure with arms:
http://www.lowrestv.com/moho_stuff/scri ... ot_rig.mov
http://www.lowrestv.com/moho_stuff/scri ... ot_rig.zip
This is still a work in progress. I have used a "separate" control rig that is labeled in the file that moves the leg bones.
The following two files don't contain the script file. Place these Anime Studio files in the same folder with the script from the above download.
Crank shaft sample file.
Arm sample file. Rigged arm with "3D" motion.
You can't parent an aimer bone to another aimer bone. You can parent an aimer bone to ANOTHER target bone but not its OWN target bone.
Added scale limits. Not a perfect solution. The bones won't scale when dragged too far but they will "disconnect" at the joint. I don't find this to be too bad and just keep an eye on the bones so they don't disconnect... too much.
http://www.lowrestv.com/moho_stuff/scri ... m_rig1.mov
http://www.lowrestv.com/moho_stuff/scri ... im_arm.mov
http://www.lowrestv.com/moho_stuff/scri ... m_bone.mov
This bone layer script will make a bone rotate and scale to reach a target bone. The bone controlling the "shaft" in the third animation above is the "aimer" bone. There is another bone that is a child of a bone that rotates around the wheel. This child bone is the "target". The aimer bone rotates and scales to aim at the offset rotating target bone.
The script works with pairs of bones. The "aimer" bone and the "target" bone. Both bones must have the same name with an extension.
Name the aiming bone (the one that will stretch and rotate) with the extension:
Name the target bone with the extension:
Works with any number of parent bones for either bone. The aimer or target bone can be translated and the aimer bone will "stretch" to maintain its connection to the target bone.
Hey Vern Select Bone Tool - with scrolling bone selection menu
Updated: June 6, 2007
This is an alternative to the current bone selection tool. This will display the bones in a scrolling text list instead of a drop down menu. This is great for those of us with lots and lots of bones but limited screen space.
I admit there were problems with my code originally. BUT IT WORKS NOW I AM SURE OF IT!
Please give it another shot. It will be worth it.
I fixed the script so it selects bones MUCH FASTER. I took out the bonus "Crashing" feature. No one seemed to appreciate it and it would have been hard to support.
The items are named correctly now at the top of the window.
I fixed the variables so it works along with the original bone selection tool.
I fixed deleting of bones (that never worked).
I have spent a lot of time testing this with ASP on a file with nearly 300 bones so I am confident that it works. It may work with the original Moho as is but I have not tested that.
I have included new icons for the tool so it shows up differently in the tool palette. You can always change the _tool_list.txt file if you want this one to be the main select bone tool.
You can change the size of the popup box by opening the script in a text editor and look for this code near the very top:
Code: Select all
----------------------------------------------------- -- Change the size of the bone list scroll box here ----------------------------------------------------- BoneListWidth = 350 BoneListHeight = 400 ----------------------------------------------------- -----------------------------------------------------
Just unzip and drag the contents of the folder to /scripts/tool/ directory inside your AS folder and launch AS.
When you click on the Select Bone menu at the top of the document a window pops up with a scrolling list of all the bones in the current layer. You can select any of these bones and see them highlight in the view.
The current selected bone will always be highlighted in the list. With long lists it will "jump" to that spot so no need for a lot of scrolling.
You can select bones in the view and they will highlight in the list. The list remains "active" while it's open. Try that with the original bone select tool.
Scroll wheels work with the bone list.
The list will "remember" the last bone selected and highlight it in the list even if you have deselected it. Just click on the Select Bone menu again click on the highlighted bone in the list and click select.
Setting constraints is a little easier now. Leave the bone list open and then open the constraints pop up to change the settings. You still must CLOSE the constraints window to select another bone but now it is much simpler to find the bone you need.
Due to the nature of text lists ALL bones are in the scrolling list. Not just named bones. There is no workaround for this at the moment. A text list has no ID for the individual items in it. The ID is just its placement in the list from the bottom to the top.
If I skip unnamed bones... then the list is out of wack. If I use names for selecting bones... then you can't have bones with the same name, or unnamed bones. It's a lose lose situation kids. I will see what I can do.
Other than the scroll box and listing unnamed bones it should select bones just like the other one.
Keep in mind this is a specialized Select Bone tool. All other bone tools will still use the old drop down menu. If you want the other bone tools to use this style of selection then I will have to rewrite the whole bone tool set. I can if anyone wants it.
I will post updates when I make any changes. Let me know if you have problems or suggestions.
Updated: May 23, 2007
I think I fixed this now! Download again and try it out.
Currently this script will crash when using the undo. It also may crash when deleting key frames. I am working on this. It happened towards the end of development. It wasn't doing this earlier so it must be "fixable".
This is a work in progress and should not be used for any final projects.
I still have quite a few things to add to it so some of the instructions below may change.
There is a simple file included in the zip archive... and when I say "simple" I mean it is absurdly silly and very simple. Basically just some bones and layers to show functionality.
Here is an animation (this is the old one but looks the same):
Incorporated TransRotate, RotateTrans, TransScale, RotateScale, etc etc.
This is separate controls from the flipper. These are like constraints but they mix and match types of bone motion.
Name pairs of bones with the same name as shown below in the examples:
A pair of bones. Only 2 bones per set. You can't have more than one slave. If you don't have a matching set you will get errors.
The .mst bone is the "master". The .slv bone is the "slave". The 2 letters at the end of the extension determines the type of relationship;
TR = TransRotate - Translation of master rotates slave
RT = RotateTrans - Rotation of master translates slave (x only)
TS = TransScale - Translation of master scales slave
Both bone names MUST be the same except for the extension.
Instructions for the Flip by Bones section of the script
The Flip By Bones script for flipping layers is great but... I can flip any value including bones.
This script will flip a layer, a bones rotation, scale or x translation (no y translation yet)
Requires 2 MANDATORY bones with the following names:
There is a bug at the moment so I wouldn't recommend these bones have different parents. They can but if you move the parent in any of the frames it messes up the flipping. If both bones have the same parent that works fine.
On frame 0 make sure that both bones have the same x translation value and that they are rotated at 90 degrees. And make sure if these bones have a parent that the parent is oriented correctly so they translate properly. I've run into that problem.
Then name any bone you want to "flip" its value with either .flipS or .flipR on the end of the name and it will mirror the scale or rotation on either side of the flip.
When you drag the flip bone in either direction past the now bone the flip occurs.
I've also added in layer flipping.
The layer flipping is completely different from the script below. It doesn't have the option for bone "triplets" and the layers are named differently.
Set the depth sort of the bone layer to sort layers by depth.
Any layer you want to flip set its z translation on frame 0 to any value higher than 0. This value will be used for the flip.
To flip the z depth of a layer with this script just add one of the following to the front of the layer name:
So for example a layer might be named:
The name must have the hyphen after left or right to work. The script searches the layer names for "flip-left-" or "flip-right-".
Option for additional flip bone sets.
Flipping translation (x and y).
Add in flipping on the Y axis/translation using optional Y flip bones. (this should be cool!)
Flipping "range" for layer flipping so that layers can be on top if the flip bone is within a certain range of the now bone.
Let me know if you have any suggestions or comments by replying here.
Hey Vern's Flip By Bones
Updated: May 6, 2007
There is a text file with instructions and a sample Moho file included with the zip file.
I have modified the original FlipByBones script created by Rasheed. This new version creates only one key for the controlled layer or layers on frame 1. By keying the translation of a layer on frame 1 it effects the entire animation time line.
By doing it this way it reduces the complexity of the script and removes the necessity of calculating changes from key frame to key frame. It evaluates the positions of the control bones on every frame and updates the key on frame 1 only and maintains the original z translation on frame 0.
The instructions below are nearly identical to Rasheed's. The only change is that any type of interpolation for the bones translation works without problems.
This script should be embedded inside a bone type layer. The bone layer should contain pairs or triplets of root bones. Each bone in such a bone pair or triplet should have the same name as one of the child layers, with either ".now", ".flip" (for a pair), ".flip1" (for a triplet), or "flip2" (for a triplet) as suffices (without the quotes). These bones should not be attached to any layer.
The dynamically controlled layer (controlled by the bone pair or bone triplet) should be offset in the z direction by layer translation in frame zero. This layer translation is copied to frame one. In all other frames, if the bone.now is left of bone.flip, the z coordinate of the layer "bone" is inverted (negative value become positive, and vice versa). Or, in case of a triplet, if bone.now is not horizontally between bone.flip1 and bone.flip2, the z coordinate of the layer "bone" is inverted.
The script will add a key on frame 0 for layer translation with step interpolation to the dynamically controlled layers. The sample file contains two bone layers with each type of control demonstrated.
Don't forget to turn on "Depth Sorting" in the bone layer ("Depth Sort" tab of the layer properties), and, in the Project Settings, check "Enable 3D camera" and "Sort layers by depth".
Features and limitations
No features, no real limitations. The only thing to keep in mind is that as you you move a bone the layer z translation won't update imediately. You just need to click on the key frame or scrub through the time line and it will update.
Action Dat Import
Updated: April 4, 2007
Forum member Ramón López had created the same script a while ago which I never knew about. It has more features and error checking and can be downloaded from this thread:
It is the linked word "Here" in the last post.
Import dat files from Papagayo that use actions in ASP instead of switch layers for lip sync.
Uh... that's it really. Isn't that enough?
Basically I have created this so I can use Papagayo for lip syncing my new face rig characters which use bones for all facial expressions.
This script could be used for ANY character file that uses actions for mouth positions or any other type of thing.
Instructions for use:
As far as I know scripts can only be used with ASP.
Place this script in the /scripts/menu/ directory of your ASP application installation directory. Or you can put it in the "other" directory.
On any layer, create the 10 phonemes that are required by Papagayo as named actions or any custom phonemes that you have added. This works exactly the same as using dat files for switch layers so what ever worked before will work with this.
Make sure the phoneme actions are on frame 1 and are not more than one frame in length. Sometimes lip synch has the key frames right next to each other and I don't know what would happen with actions that overlap.
Select the layer with those actions and choose this menu script from the scripts menu. After the prompt select the dat file for the lip sync you created using Papagayo. It will place a copy of the action named for each phoneme on the correct frames of the time line for that layer.
Features and limitations
There are no features... yet. There is no error checking so this means you MUST have all the basic named action/phonemes required by Papagayo or you will get an error.
At this point it only places copies of the actions not a reference. I will put in a check box for choosing this when I do all the error checking for if an action isn't available.
I plan to add in a choice for placing a copy of the action or a reference. I will do this when I add in the error checking.