Animate Shape Stack Order
Posted: Sat Dec 09, 2006 11:41 pm
The script:
http://www.poetbeware.org/stack.lua
An example file:
http://www.poetbeware.org/000.anme
How to use it:
You must set up a switch layer with the same name as your vector layer and a " Stack" suffix. So, in the example file, I have a "Humanoid" layer whose shape order I want to animate, so I created a "Humanoid Stack" switch layer for the script to find.
The sublayers in the switch layer have names that are actually list of shape names. So if you select the "Humanoid" layer and pull down its Shapes button, you'll see: L_Arm, R_Arm, Body, L_Leg and R_Leg.
Note that the switch sublayers are named:
L_Arm,R_Leg,Body,R_Arm,L_Leg,
R_Arm,L_Leg,Body,L_Arm,R_Leg,
Those names indicate the order you want the shapes to go in, from bottom to top. You don't have to list every shape; shapes that are not listed will not have their ordering changed.
Then, to animate the order, just set keyframes on the switch layer to set the order you want. Next, attach the stack.lua script to the original layer (the Humanoid layer in the example).
And done!
How it works:
It parses the currently open .anme file to find the names of the shapes. It then associates those names with the actual Shape objects in memory. From there it's easy: The script just finds the currently active switch sublayer, parses that sublayer's name, and moves those shapes into the correct order.
IMPORTANT CAVEATS:
This will only work if you do not rename your original layer, the switch Stack layer, or any of the shapes!
If you add or delete a shape, that should be fine, but you will have to save, close and re-open your file so that my script can re-load the shape names.
The switch sublayer names must not contain any spaces in them; each shape name must be separated by a comma; and there MUST be a comma at the very end of the name.
I only tested with Anime Studio Pro 5.5 on OS X. Please let me know if it works for you...
http://www.poetbeware.org/stack.lua
An example file:
http://www.poetbeware.org/000.anme
How to use it:
You must set up a switch layer with the same name as your vector layer and a " Stack" suffix. So, in the example file, I have a "Humanoid" layer whose shape order I want to animate, so I created a "Humanoid Stack" switch layer for the script to find.
The sublayers in the switch layer have names that are actually list of shape names. So if you select the "Humanoid" layer and pull down its Shapes button, you'll see: L_Arm, R_Arm, Body, L_Leg and R_Leg.
Note that the switch sublayers are named:
L_Arm,R_Leg,Body,R_Arm,L_Leg,
R_Arm,L_Leg,Body,L_Arm,R_Leg,
Those names indicate the order you want the shapes to go in, from bottom to top. You don't have to list every shape; shapes that are not listed will not have their ordering changed.
Then, to animate the order, just set keyframes on the switch layer to set the order you want. Next, attach the stack.lua script to the original layer (the Humanoid layer in the example).
And done!
How it works:
It parses the currently open .anme file to find the names of the shapes. It then associates those names with the actual Shape objects in memory. From there it's easy: The script just finds the currently active switch sublayer, parses that sublayer's name, and moves those shapes into the correct order.
IMPORTANT CAVEATS:
This will only work if you do not rename your original layer, the switch Stack layer, or any of the shapes!
If you add or delete a shape, that should be fine, but you will have to save, close and re-open your file so that my script can re-load the shape names.
The switch sublayer names must not contain any spaces in them; each shape name must be separated by a comma; and there MUST be a comma at the very end of the name.
I only tested with Anime Studio Pro 5.5 on OS X. Please let me know if it works for you...