Split Layer Script - split shapes on multiple layers
Posted: Sat Jul 03, 2010 7:11 am
Some of you may have noticed in the videos for AS Physics feature that there is a sort of "magic" bit that gets skipped over when drawing a bunch of shapes on one layer and then running physics with each shape on multiple layers.
I created a custom script to make this easier.
Split Layer Script
------------
Two ways to install the script:
AS Pro and Debut installation:
Put this script in the scripts/tool/ folder and add this line to your _tool_list.txt file as shown below:
I don't have a icon for it yet. It will show up in your tool palette as a "?" in the spot you paste that line your _tool_list.txt file. You MUST add this line to the _tool_list.txt file. The script will only work as a button.
This will work with Debut. I know Debut does not have physics but this script might be useful for other purposes.
----------------------------------------
AS Pro only Menu Script installation:
Install in scripts/menu/
Select the script from the scripts menu in AS.
--------------------------------------
Instructions:
Run on a vector layer inside a group layer that has physics turned on.
This script ONLY works on vector layers with ALL CLOSED VECTOR SHAPES. Each shape must be a single closed vector to work properly. I hope to improve this later for other uses.
Once your layer is ready to "split" make sure all of the physics properties are set in this layer FIRST so that the split layers have those physics settings.
Click the tool button (or select the menu script if installed that way). The script will create one layer for each separate shape.
At the bottom of the newly created layers there will be the original layer with all the shapes which should be moved outside of the physics group layer. There is also an empty "template" layer. It will have the name of the original layer with "-Template" added on. Delete this layer. This is a blank template layer created by the script to duplicate for pasting in the shapes so all of them have the same physics settings. Unfortunately there is no way to delete or remove layers using the script interface so this has to be done by hand.
Make sure you keep the original layer after moving it out of the group layer so you can run the script again if needed.
-vern
I created a custom script to make this easier.
Split Layer Script
------------
Two ways to install the script:
AS Pro and Debut installation:
Put this script in the scripts/tool/ folder and add this line to your _tool_list.txt file as shown below:
Code: Select all
button hv_split_layer ...
This will work with Debut. I know Debut does not have physics but this script might be useful for other purposes.
----------------------------------------
AS Pro only Menu Script installation:
Install in scripts/menu/
Select the script from the scripts menu in AS.
--------------------------------------
Instructions:
Run on a vector layer inside a group layer that has physics turned on.
This script ONLY works on vector layers with ALL CLOSED VECTOR SHAPES. Each shape must be a single closed vector to work properly. I hope to improve this later for other uses.
Once your layer is ready to "split" make sure all of the physics properties are set in this layer FIRST so that the split layers have those physics settings.
Click the tool button (or select the menu script if installed that way). The script will create one layer for each separate shape.
At the bottom of the newly created layers there will be the original layer with all the shapes which should be moved outside of the physics group layer. There is also an empty "template" layer. It will have the name of the original layer with "-Template" added on. Delete this layer. This is a blank template layer created by the script to duplicate for pasting in the shapes so all of them have the same physics settings. Unfortunately there is no way to delete or remove layers using the script interface so this has to be done by hand.
Make sure you keep the original layer after moving it out of the group layer so you can run the script again if needed.
-vern