def parameters_ui(layout, params):
    """ Create the ui for the rig parameters."""
    layers = ['primary_layers', 'secondary_layers']
    for layer in layers:
        r = layout.row()
        r.prop(params, layer + '_extra')
        r.active = getattr(params, layer + '_extra')
        col = r.column(align=True)
        row = col.row(align=True)
        for i in range(8):
            row.prop(params, layer, index=i, toggle=True, text='')
        row = col.row(align=True)
        for i in range(16, 24):
            row.prop(params, layer, index=i, toggle=True, text='')
        col = r.column(align=True)
        row = col.row(align=True)
        for i in range(8, 16):
            row.prop(params, layer, index=i, toggle=True, text='')
        row = col.row(align=True)
        for i in range(24, 32):
            row.prop(params, layer, index=i, toggle=True, text='')
