Tuesday, April 16, 2013

Blender Addon : Automatic Rig Layer Panel


Here's a simple addon I just wrote for Blender. It automatically generates a panel in the Properties shelf for toggling visibility for the layers of a rig. Previously this required a custom python script for each character, but by using this addon you can have a panel simply by adding some extra properties to your rig.

Firstly, download and install it from here:
http://www.pasteall.org/41442
(copy and paste it into a new text file, save it as "autoRigLayers.py", then install and enable it in Blender via the user prefs)

Now all you have to do is prepare your rig...

  1. Make a property called "autoRigLayers" and set its value to "1"
  2. Make a property called "layer.1" and set its value to the appropriate layer name.
  3. Repeat step 2 for all the rig layers that you want to appear on the panel

Optionally you can set the number of columns in the panel. This is done by adding property called "layer.cols" and setting its value to a whole number.

Hope this is useful to you. Let me know in the comments below if you find any major bugs.

6 comments:

  1. Thank Boern for this so useful rig layer panel, I was wondering how I could achieve this on my rigs... thank you

    ReplyDelete
  2. This was extremely helpful, thanks for the script! works like magic :D

    ReplyDelete
  3. Great stuff!
    How to add one button for visible/hide All layers?
    It would be helpful :)

    ReplyDelete
  4. Thanks how do you set them in two rows.

    ReplyDelete
  5. layer.cols property value keeps changing back to 1

    ReplyDelete
  6. Hi Beorn,

    I've encountered a bug where it won't display layer.32. I added a print statement for debugging and the for loop only exits after layer.31.

    I believe this is a side effect of the range statement where the last value (in this case 32) is not executed as part of the loop. To fix I just changed the second range value to 33 (line 66) and now it is displaying layer.32... see section 4.3 of http://docs.python.org/2/tutorial/controlflow.html

    Have updated the code - Hope this helps!

    - Andrew Buttery (axb2035)

    ReplyDelete