Here is a script that moves each of your bones into a layer based on your naming convention… eg 0.jaw.foo foo will move that bone to layer 0. Not sure how helpful that is after another look at screen shot.
import bpy
import re
context = bpy.context
scene = context.scene
arm = context.object
rig = arm.data
for bone in arm.pose.bones:
for prop, value in bone.items():
#print(prop, value, type(value))
m = re.match(r"^(\d)",prop)
if m is not None:
print(m.group())
print("Match %s" % prop)
i = int(m.group())
layers = [False] * 32
rig.bones[bone.name].layers[i] = True
Here is the part of the rigify UI that concerns bone layers
import bpy
class RigLayers(bpy.types.Panel):
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
bl_label = "Rig Layers"
bl_idname = "SOME RIG ID"
@classmethod
def poll(self, context):
object = context.object
if object is not None:
return object.type == 'ARMATURE' and object.mode == 'POSE'
return False
def draw(self, context):
layout = self.layout
col = layout.column()
row = col.row()
row.prop(context.active_object.data, 'layers', index=2, toggle=True, text='Head')
row = col.row()
row.prop(context.active_object.data, 'layers', index=0, toggle=True, text='JAW')
row = col.row()
row.prop(context.active_object.data, 'layers', index=4, toggle=True, text='Fingers')
row.prop(context.active_object.data, 'layers', index=5, toggle=True, text='(Tweak)')
row = col.row()
row.prop(context.active_object.data, 'layers', index=6, toggle=True, text='Arm.L (FK)')
row.prop(context.active_object.data, 'layers', index=8, toggle=True, text='Arm.R (FK)')
row = col.row()
row.prop(context.active_object.data, 'layers', index=7, toggle=True, text='Arm.L (IK)')
row.prop(context.active_object.data, 'layers', index=9, toggle=True, text='Arm.R (IK)')
row = col.row()
row.prop(context.active_object.data, 'layers', index=10, toggle=True, text='Leg.L (FK)')
row.prop(context.active_object.data, 'layers', index=12, toggle=True, text='Leg.R (FK)')
row = col.row()
row.prop(context.active_object.data, 'layers', index=11, toggle=True, text='Leg.L (IK)')
row.prop(context.active_object.data, 'layers', index=13, toggle=True, text='Leg.R (IK)')
row = col.row()
row.separator()
row = col.row()
row.separator()
row = col.row()
row.prop(context.active_object.data, 'layers', index=28, toggle=True, text='Root')
def register():
bpy.utils.register_class(RigLayers)
def unregister():
bpy.utils.unregister_class(RigLayers)
register()
notice the prop i changed to “JAW” has index 0… you will need to change the others appropriately. You can do this manually by selecting the bones you want on different layers and selecting that bone layer/s