Bone Chains Tool script - create chains or grids of bones
Posted: Sun Jul 04, 2010 4:09 pm
Bone Chains Tool script
This script was created initially for use with physics but is useful for other purposes as well.
This script creates either 1 or more rows or columns of bone chains. It can also create a "grid" of bones for creating "cloth" simulations using physics.
Install this as a button (pro and debut) or menu (pro only) script.
Button Installation:
Place this script and the scriptimage in the scripts/tool/ folder.
Add this text to your "_tools_list.txt" file:
Menu Installation: (AS Pro only)
Drop the script ONLY into the /scripts/menu/ folder.
--------------
Instructions
On a bone layer click on the button tool or select the menu script.
Click one of the radio buttons to the left.
Grid Option:
The grid option is not really usable on it's own with physics. I debated whether to leave the option in at all but thought it might help when "designing" the grid first (grid spacing) then it could be deleted and the horizontal/vertical would be used on sepearate bone layers. Or possibly someone could use the grid option for other purposes.
Row and column count is based on the "space" between the rows and columns. Technically this creates 1 more row or column of bones than expected. If you type in 6 rows, you actually get 7 rows of bones.
Set the row and column counts. the "cloth density" is how many bones are placed in the grid itself. You can see from the images what the results produce. With "2" cloth density the bone count is increased to create a "2 x 2" bone grid spacing.

Rows or Columns:
Selecting horizontal or vertical will also increase the bone count based on row or column spacing. Notice that the text labels change to reflect these differences. To get exact bone count numbers just use 1 for spacing.


Gap
Gap is the space between individual bones in the chain. This is important for creating a "cloth" mesh. You need space between each bone in the chain to "hold" the crossing bones for the physics interaction. Gap spacing and the bones physics influence envelope effect the "stiffness" of the cloth simulation.
---------------
Creating Physics cloth
This requires two separate bone layers in one physics group layer. One bone layer has vertical bone chains and the other bone layer has the horizontal bone chains. These bone chains must be perfectly aligned and the spacing between bones set so that the bones that cross at the joints will "hold" the bones in the other layer. This is what creates the "mesh".
If all the bones were in one layer this wouldn't work. Individual chains of bones in one bone layer do not interact with each other. By placing rows and columns in separate layers the work together to create the "cloth".
The trick would be to "test" out a grid on one bone layer so you get the values set correctly. You want to have enough spacing or "gaps" so the crossing bones don't "bind up" too much. Plus you want enough space to set the bones physics region to "hold" the other bones that cross.
-------------
Once you have settled on a grid setup, delete the bone grid and run the script again but this time check horizontal only with the same settings and hit ok. Then on ANOTHER bone layer run the script again with vertical only selected.
Place a vector layer inside each bone layer with vertical/horizontal splines/shapes so you can see the physics simulation interaction of both bone layers.
Now press play to preview the physics. Make sure there is something for the cloth to interact with. If the physics aren't quite right you can make global adjustments to the bones physics regions by selecting all the bones on each layer and adjusting the values.
Or you can change the grid spacing by running the bone chains script again after deleting the bones. By keeping the same settings the script will create rows and columns that match.
--------------------------
Once you FINALLY have a simulation that you like and you want to use this on ONE bone layer to control a single vector layer, select all bones from one layer and paste into the other bone layer. Turn OFF physics. It won't work properly now since you have the bones all on one layer.
Now you can put a single filled vector layer in the one bone layer creating a cloth like simulation.
-vern
This script was created initially for use with physics but is useful for other purposes as well.
This script creates either 1 or more rows or columns of bone chains. It can also create a "grid" of bones for creating "cloth" simulations using physics.
Install this as a button (pro and debut) or menu (pro only) script.
Button Installation:
Place this script and the scriptimage in the scripts/tool/ folder.
Add this text to your "_tools_list.txt" file:
Code: Select all
button hv_bone_chains ...
Drop the script ONLY into the /scripts/menu/ folder.
--------------
Instructions
On a bone layer click on the button tool or select the menu script.
Click one of the radio buttons to the left.
Grid Option:
The grid option is not really usable on it's own with physics. I debated whether to leave the option in at all but thought it might help when "designing" the grid first (grid spacing) then it could be deleted and the horizontal/vertical would be used on sepearate bone layers. Or possibly someone could use the grid option for other purposes.
Row and column count is based on the "space" between the rows and columns. Technically this creates 1 more row or column of bones than expected. If you type in 6 rows, you actually get 7 rows of bones.
Set the row and column counts. the "cloth density" is how many bones are placed in the grid itself. You can see from the images what the results produce. With "2" cloth density the bone count is increased to create a "2 x 2" bone grid spacing.

Rows or Columns:
Selecting horizontal or vertical will also increase the bone count based on row or column spacing. Notice that the text labels change to reflect these differences. To get exact bone count numbers just use 1 for spacing.


Gap
Gap is the space between individual bones in the chain. This is important for creating a "cloth" mesh. You need space between each bone in the chain to "hold" the crossing bones for the physics interaction. Gap spacing and the bones physics influence envelope effect the "stiffness" of the cloth simulation.
---------------
Creating Physics cloth
This requires two separate bone layers in one physics group layer. One bone layer has vertical bone chains and the other bone layer has the horizontal bone chains. These bone chains must be perfectly aligned and the spacing between bones set so that the bones that cross at the joints will "hold" the bones in the other layer. This is what creates the "mesh".
If all the bones were in one layer this wouldn't work. Individual chains of bones in one bone layer do not interact with each other. By placing rows and columns in separate layers the work together to create the "cloth".
The trick would be to "test" out a grid on one bone layer so you get the values set correctly. You want to have enough spacing or "gaps" so the crossing bones don't "bind up" too much. Plus you want enough space to set the bones physics region to "hold" the other bones that cross.
-------------
Once you have settled on a grid setup, delete the bone grid and run the script again but this time check horizontal only with the same settings and hit ok. Then on ANOTHER bone layer run the script again with vertical only selected.
Place a vector layer inside each bone layer with vertical/horizontal splines/shapes so you can see the physics simulation interaction of both bone layers.
Now press play to preview the physics. Make sure there is something for the cloth to interact with. If the physics aren't quite right you can make global adjustments to the bones physics regions by selecting all the bones on each layer and adjusting the values.
Or you can change the grid spacing by running the bone chains script again after deleting the bones. By keeping the same settings the script will create rows and columns that match.
--------------------------
Once you FINALLY have a simulation that you like and you want to use this on ONE bone layer to control a single vector layer, select all bones from one layer and paste into the other bone layer. Turn OFF physics. It won't work properly now since you have the bones all on one layer.
Now you can put a single filled vector layer in the one bone layer creating a cloth like simulation.
-vern