Loolarge
12-07-2008, 05:18 PM
I am using blender for my personal projects now. Here are some helper scripts that i wrote to help my self while creating my new character rig:
Edit: I added Another script, i hope it is not redundant again http://blenderartists.org/forum/images/smilies/sago/wink.gif
Copy/Paste vertex weight
Menu: Script Window -> Copy/Paste vertex weight
Download script (http://www.ivogrigull.com/blender/scripts/Ivo_CopyPasteVertWeight.py)
http://www.ivogrigull.com/wp-content/uploads/2008/12/copypastevertexweights.jpg (http://www.ivogrigull.com/wp-content/uploads/2008/12/copypastevertexweights.jpg)
With this script you can pick a vertex to copy it’s weight and paste it
to multiple other vertices. If you selected more than one vert in the first step and
click on paste, the applied weights will be averaged. This is useful to match or repair
weights between different mesh parts. In my example i am attaching a belt buckle to
the belly of my character.
http://www.ivogrigull.com/wp-content/uploads/2008/12/copypastevertexweights2.jpg (http://www.ivogrigull.com/wp-content/uploads/2008/12/copypastevertexweights2.jpg)
There is another Button called ‘Average Vertex Weights’. It will smooth the selected vertex weights with a fallof within the selection.
Symmetry Map
symmetrize a mesh and bone weights over the x axis
http://www.ivogrigull.com/wp-content/uploads/2008/12/symmetrymap.jpg (http://www.ivogrigull.com/wp-content/uploads/2008/12/symmetrymap.jpg)
Menu: Object->Scripts->Symmetry Map
This script is useful if you want to make modifications to a symmetrical mesh after you have applied a mirror modifier.
Download Script (http://www.ivogrigull.com/blender/scripts/Ivo_SymmetryMap.py)
usage:
Your mesh needs to be totally symmetrical to start with, ideally you have just applied
a mirror modifier. Now you can run the script and choose 'Create Map'. It will take a
while (about 2 minutes for my character). The map is saved as a property of the object.
However you can save and load the map to a file for later reuse in case the info gets lost
or corrupted.
Once the map is generated, you can choose 'Symm. L->R' etc. from the menu to
mirror the mesh.
Note: it will not work on the default monkey, as he is not 100% symmetrical. You will
first have to cut one half and apply a new mirror modifier in order to make it work
properly. This caused me quite some headache before figuring it out http://blenderartists.org/forum/images/smilies/sago/wink.gif
Menu explanation:
Create Map - Generate a symmetry map (takes long time, but only needs to be done once)
Remove Map - Remove the map property from the object
Symm. L->R - Copy point positions from left to right
Symm. R->L - Copy point positions from right to left
Weight L->R - Symmetrize weights from left to right
Weight R->L - Symmetrize weights from right to left
Save Map - Save the mapping to a file
Load Map - Load the mapping from a file
Sel midpoints - Select the midpoints
Cntr. midpoints - Center the midpoints positions on the x axis
(http://www.ivogrigull.com/blender/scripts/Ivo_SymmetryMap.py)
Blend Vertices
Copy selected vertex positions from one object to another
http://www.ivogrigull.com/wp-content/uploads/2008/12/blendvertices_.jpg (http://www.ivogrigull.com/wp-content/uploads/2008/12/blendvertices_.jpg)
Menu: Mesh->Scripts->Blend Vertices
This script copies vertex positions between two objects. Both objects need to have the
same topology (i.e. created as a copy of the other).
This script is useful for modelling shapes (if you do them as seperate obejcts) to
revert changes to the original mesh.
Download Script (http://www.ivogrigull.com/blender/scripts/Ivo_blendVertices.py)
Usage:
In Object.Mode first Select the source obejct, then the target object. Enter
Edit-Mode and select some vertices on the target mesh. Execute the script.
In the popup menu you can set a blend factor if you want to blend only a little bit.
(http://www.ivogrigull.com/blender/scripts/Ivo_blendVertices.py)
Drawtypes
Set Object Display options (Hotkey O)
http://www.ivogrigull.com/wp-content/uploads/2008/12/drawtypes.jpg (http://www.ivogrigull.com/wp-content/uploads/2008/12/drawtypes.jpg)
Menu: Script Window->Misc->Drawtypes
I wrote this for convenience to be able to quickly toggle
draw wireframe over solid and x-ray etc.
Download Script (http://www.ivogrigull.com/blender/scripts/Ivo_DrawTypes.py)
Usage:
Execute the scipt and enable the spacehandler (View->Space Handler Scripts).
Now you can call the menu by pressing the O-key. Feel free to adjust this
script to another hotkey if you like. You can now save your Blender-
default settings (Ctrl+U) to make it persistent.
(http://www.ivogrigull.com/blender/scripts/Ivo_DrawTypes.py)
Merge weights to parent
Merge the selected bone’s weight to its parent
http://www.ivogrigull.com/wp-content/uploads/2008/12/mergeweightstoparent_.jpg (http://www.ivogrigull.com/wp-content/uploads/2008/12/mergeweightstoparent_.jpg)
Menu: Weightpaint->Merge to Parent
This script is supposed to be used in conjunction with the bone heating
appoach. Because the bone heating does sometimes not reach all areas i want,
(for example in the head) i usually add additional child bones and apply
bone heating again. This script can then be used to merge the weights to
the parent bone, to get rid of the extra vertex groups and remove the clutter.
Download Script (http://www.ivogrigull.com/blender/scripts/Ivo_mergeWeightsToParent.py)
This Script is to be used only in weight paint mode, and if the
mesh has an armature modifier ( i.e. you have to make the armature
modifier "real" before using the script ).
(http://www.ivogrigull.com/blender/scripts/Ivo_mergeWeightsToParent.py)
Remove from all Vertex Groups
Clears selected vertices from all vertex groups for a fresh start
Menu: Mesh->Remove verts from all vertex groups
Download Script (http://www.ivogrigull.com/blender/scripts/Ivo_removeFromAllVGroups.py)
This Script is to be used in edit mode. Select some vertices and run the script.
(http://www.ivogrigull.com/blender/scripts/Ivo_removeFromAllVGroups.py)
Toggle Armature Layers
http://www.ivogrigull.com/wp-content/uploads/2008/12/togglearmlayers_.jpg (http://www.ivogrigull.com/wp-content/uploads/2008/12/togglearmlayers_.jpg)
Toggle between the first two armature layers of the selected armature with a hotkey. Very convenient when animating, so you can hide / unhide your controls quickly.
Download Script (http://www.ivogrigull.com/blender/scripts/Ivo_toggleArmLayers.py)
usage:
load this script into the blender text editor, press alt+p. Activate the Spacehandler
(View->Space Handler Scripts->ToggleArmLayers). Press the 2 key to toggle.
(http://www.ivogrigull.com/blender/scripts/Ivo_toggleArmLayers.py)
SoftIK
http://www.ivogrigull.com/wp-content/uploads/2008/12/softik.jpg (http://www.ivogrigull.com/wp-content/uploads/2008/12/softik.jpg)
Soft IK for non stretchy chains example.
Download zipped Blend-file (http://www.ivogrigull.com/blender/scripts/SoftIK3.zip)
Copy the scripts to you blender scripts-directory to install. Have fun!
Edit: I added Another script, i hope it is not redundant again http://blenderartists.org/forum/images/smilies/sago/wink.gif
Copy/Paste vertex weight
Menu: Script Window -> Copy/Paste vertex weight
Download script (http://www.ivogrigull.com/blender/scripts/Ivo_CopyPasteVertWeight.py)
http://www.ivogrigull.com/wp-content/uploads/2008/12/copypastevertexweights.jpg (http://www.ivogrigull.com/wp-content/uploads/2008/12/copypastevertexweights.jpg)
With this script you can pick a vertex to copy it’s weight and paste it
to multiple other vertices. If you selected more than one vert in the first step and
click on paste, the applied weights will be averaged. This is useful to match or repair
weights between different mesh parts. In my example i am attaching a belt buckle to
the belly of my character.
http://www.ivogrigull.com/wp-content/uploads/2008/12/copypastevertexweights2.jpg (http://www.ivogrigull.com/wp-content/uploads/2008/12/copypastevertexweights2.jpg)
There is another Button called ‘Average Vertex Weights’. It will smooth the selected vertex weights with a fallof within the selection.
Symmetry Map
symmetrize a mesh and bone weights over the x axis
http://www.ivogrigull.com/wp-content/uploads/2008/12/symmetrymap.jpg (http://www.ivogrigull.com/wp-content/uploads/2008/12/symmetrymap.jpg)
Menu: Object->Scripts->Symmetry Map
This script is useful if you want to make modifications to a symmetrical mesh after you have applied a mirror modifier.
Download Script (http://www.ivogrigull.com/blender/scripts/Ivo_SymmetryMap.py)
usage:
Your mesh needs to be totally symmetrical to start with, ideally you have just applied
a mirror modifier. Now you can run the script and choose 'Create Map'. It will take a
while (about 2 minutes for my character). The map is saved as a property of the object.
However you can save and load the map to a file for later reuse in case the info gets lost
or corrupted.
Once the map is generated, you can choose 'Symm. L->R' etc. from the menu to
mirror the mesh.
Note: it will not work on the default monkey, as he is not 100% symmetrical. You will
first have to cut one half and apply a new mirror modifier in order to make it work
properly. This caused me quite some headache before figuring it out http://blenderartists.org/forum/images/smilies/sago/wink.gif
Menu explanation:
Create Map - Generate a symmetry map (takes long time, but only needs to be done once)
Remove Map - Remove the map property from the object
Symm. L->R - Copy point positions from left to right
Symm. R->L - Copy point positions from right to left
Weight L->R - Symmetrize weights from left to right
Weight R->L - Symmetrize weights from right to left
Save Map - Save the mapping to a file
Load Map - Load the mapping from a file
Sel midpoints - Select the midpoints
Cntr. midpoints - Center the midpoints positions on the x axis
(http://www.ivogrigull.com/blender/scripts/Ivo_SymmetryMap.py)
Blend Vertices
Copy selected vertex positions from one object to another
http://www.ivogrigull.com/wp-content/uploads/2008/12/blendvertices_.jpg (http://www.ivogrigull.com/wp-content/uploads/2008/12/blendvertices_.jpg)
Menu: Mesh->Scripts->Blend Vertices
This script copies vertex positions between two objects. Both objects need to have the
same topology (i.e. created as a copy of the other).
This script is useful for modelling shapes (if you do them as seperate obejcts) to
revert changes to the original mesh.
Download Script (http://www.ivogrigull.com/blender/scripts/Ivo_blendVertices.py)
Usage:
In Object.Mode first Select the source obejct, then the target object. Enter
Edit-Mode and select some vertices on the target mesh. Execute the script.
In the popup menu you can set a blend factor if you want to blend only a little bit.
(http://www.ivogrigull.com/blender/scripts/Ivo_blendVertices.py)
Drawtypes
Set Object Display options (Hotkey O)
http://www.ivogrigull.com/wp-content/uploads/2008/12/drawtypes.jpg (http://www.ivogrigull.com/wp-content/uploads/2008/12/drawtypes.jpg)
Menu: Script Window->Misc->Drawtypes
I wrote this for convenience to be able to quickly toggle
draw wireframe over solid and x-ray etc.
Download Script (http://www.ivogrigull.com/blender/scripts/Ivo_DrawTypes.py)
Usage:
Execute the scipt and enable the spacehandler (View->Space Handler Scripts).
Now you can call the menu by pressing the O-key. Feel free to adjust this
script to another hotkey if you like. You can now save your Blender-
default settings (Ctrl+U) to make it persistent.
(http://www.ivogrigull.com/blender/scripts/Ivo_DrawTypes.py)
Merge weights to parent
Merge the selected bone’s weight to its parent
http://www.ivogrigull.com/wp-content/uploads/2008/12/mergeweightstoparent_.jpg (http://www.ivogrigull.com/wp-content/uploads/2008/12/mergeweightstoparent_.jpg)
Menu: Weightpaint->Merge to Parent
This script is supposed to be used in conjunction with the bone heating
appoach. Because the bone heating does sometimes not reach all areas i want,
(for example in the head) i usually add additional child bones and apply
bone heating again. This script can then be used to merge the weights to
the parent bone, to get rid of the extra vertex groups and remove the clutter.
Download Script (http://www.ivogrigull.com/blender/scripts/Ivo_mergeWeightsToParent.py)
This Script is to be used only in weight paint mode, and if the
mesh has an armature modifier ( i.e. you have to make the armature
modifier "real" before using the script ).
(http://www.ivogrigull.com/blender/scripts/Ivo_mergeWeightsToParent.py)
Remove from all Vertex Groups
Clears selected vertices from all vertex groups for a fresh start
Menu: Mesh->Remove verts from all vertex groups
Download Script (http://www.ivogrigull.com/blender/scripts/Ivo_removeFromAllVGroups.py)
This Script is to be used in edit mode. Select some vertices and run the script.
(http://www.ivogrigull.com/blender/scripts/Ivo_removeFromAllVGroups.py)
Toggle Armature Layers
http://www.ivogrigull.com/wp-content/uploads/2008/12/togglearmlayers_.jpg (http://www.ivogrigull.com/wp-content/uploads/2008/12/togglearmlayers_.jpg)
Toggle between the first two armature layers of the selected armature with a hotkey. Very convenient when animating, so you can hide / unhide your controls quickly.
Download Script (http://www.ivogrigull.com/blender/scripts/Ivo_toggleArmLayers.py)
usage:
load this script into the blender text editor, press alt+p. Activate the Spacehandler
(View->Space Handler Scripts->ToggleArmLayers). Press the 2 key to toggle.
(http://www.ivogrigull.com/blender/scripts/Ivo_toggleArmLayers.py)
SoftIK
http://www.ivogrigull.com/wp-content/uploads/2008/12/softik.jpg (http://www.ivogrigull.com/wp-content/uploads/2008/12/softik.jpg)
Soft IK for non stretchy chains example.
Download zipped Blend-file (http://www.ivogrigull.com/blender/scripts/SoftIK3.zip)
Copy the scripts to you blender scripts-directory to install. Have fun!
