Skip to content

draw_parenting_tree.py

Tlousky edited this page Feb 28, 2013 · 1 revision

Armature Parenting Tree Generator

Creates a node tree representing the armature's bone parenting structure

This script is meant to help you examine the parenting hierarchy and structure of your armature's bones. It's mainly meant for testing and to help prepare automatic rig creating scripts, and not really for anything directly practical.

The script uses the compositor (node editor) and its math convertor nodes to draw the parenting tree, since it's probably the easiest way to represent the tree in a node view.

It's best to avoid using it on production files, as it will delete your existing compositing nodes in order to make room for the parenting tree node structure.

How to use:

  1. Open a text editor window.
  2. Create a new textfile.
  3. Copy the content of this script to the empty textfile.
  4. Open the node editor, and select the compositing nodes button.
  5. Make sure that "Use Nodes" is checked and active.
  6. In the 3D view, select your armature.
  7. Back in the text editor window, press "Run Script".
  8. View the node editor to see the generated tree.

Notes and precautions:

  • ! This script will delete all existing compositing nodes !
  • This script works only in blender 2.66 and onwards (hopefully, tested on 2.66 only). It will produce errors in earlier versions due to missing functionality.

Acknowledgements:

Thanks to Kfir from PitchiPoy Animation for helping the the development process and providing rigging related info. Thanks also to Nathan Vegdahl for some very useful insights about rigging and scripting and for providing such a great testing bed for this script (rigify) which is an awesome tool besides.