Rig layer menu

Rigify automate rig creates a rig layer manu in the right tool shelf (N) with orginized bottons with the name of the layer.
How do I create this thing manuly? (without using rigify)

The rig layers menu in the transforms panel of the 3d view is placed there by a python script. Basically, all the script does is expose the rig layers in that panel and add names to the buttons. It’s really easy to create one manually if you know python, but if you don’t, it’s still not that hard to do.

I’m on a temporary computer, so I don’t have my normal files with me, so I can’t show you the code, but here’s how to start learning this yourself:

Generate the rigify rig. Now open a text editor in blender and select the rig_ui.py text. The text editor has 3 buttons in the header grouped together that control the display of text, enable all 3 of them. You will know them because one will change colors of the text and one will add line numbers to the left of the text. Now look at the first line of code, it should be ‘import bpy’, that line you will need. Start a new text file and make your first line of code be ‘import bpy’, and skip a couple of lines.

Now look at rig_ui.py close to the bottom of the script there will be a line ‘class RigLayers(bpy.types.Panel):’ that is the start of defining the rig layers panel. Copy all code from that line to the end of the text into your new text file. Look to the bottom of your new text file for the statement: ‘def register():’, delete all line following that statement except for the one that has ‘RigLayers’ in ( ). Repeat this for the ‘def unregister():’ function as well, removing all line but that one that has ‘RigLayers’ in ( ).

Now look for the line that says ‘@classmethod:’ and move your cursor to the line above and position it as indented as the @. Add in 3 single quote marks. Spacing is critical, so the first single quote should be directly above the @ sign. At the next blank line in the code, at the same column where you started the single quotes, add in 3 more single quotes. Those single quotes disable the code between them from running. Now if you run the script, you should get a rig layers panel in the 3d view transforms panel just like rigify gives you.

Post back with the error message from blender’s console if you have problems,

Randy