# ##### BEGIN GPL LICENSE BLOCK #####
#
#  This program is free software; you can redistribute it and/or
#  modify it under the terms of the GNU General Public License
#  as published by the Free Software Foundation; either version 2
#  of the License, or (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software Foundation,
#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####

import bpy


from mathutils import Color


def create(obj):
    # generated by rigify.utils.write_metarig
    bpy.ops.object.mode_set(mode='EDIT')
    arm = obj.data

    for i in range(5):
        arm.rigify_colors.add()

    arm.rigify_colors[0].name = "Left"
    arm.rigify_colors[0].active = Color((0.9686279892921448, 0.03921600058674812, 0.03921600058674812))
    arm.rigify_colors[0].normal = Color((0.6039220094680786, 0.0, 0.0))
    arm.rigify_colors[0].select = Color((0.7411760091781616, 0.06666699796915054, 0.06666699796915054))
    arm.rigify_colors[0].standard_colors_lock = True
    arm.rigify_colors[1].name = "Right"
    arm.rigify_colors[1].active = Color((0.36862701177597046, 0.756862998008728, 0.9372550249099731))
    arm.rigify_colors[1].normal = Color((0.03921600058674812, 0.21176500618457794, 0.5803920030593872))
    arm.rigify_colors[1].select = Color((0.21176500618457794, 0.4039219915866852, 0.8745099902153015))
    arm.rigify_colors[1].standard_colors_lock = True
    arm.rigify_colors[2].name = "Root"
    arm.rigify_colors[2].active = Color((0.5490196347236633, 1.0, 1.0))
    arm.rigify_colors[2].normal = Color((0.4352940022945404, 0.18431399762630463, 0.4156860113143921))
    arm.rigify_colors[2].select = Color((0.31372547149658203, 0.7843138575553894, 1.0))
    arm.rigify_colors[2].standard_colors_lock = True
    arm.rigify_colors[3].name = "Special"
    arm.rigify_colors[3].active = Color((0.5490196347236633, 1.0, 1.0))
    arm.rigify_colors[3].normal = Color((0.9568629860877991, 0.7882350087165833, 0.04705899953842163))
    arm.rigify_colors[3].select = Color((0.31372547149658203, 0.7843138575553894, 1.0))
    arm.rigify_colors[3].standard_colors_lock = True
    arm.rigify_colors[4].name = "Body"
    arm.rigify_colors[4].active = Color((0.5137255191802979, 0.9372549653053284, 0.11372549831867218))
    arm.rigify_colors[4].normal = Color((0.11764706671237946, 0.5686274766921997, 0.03529411926865578))
    arm.rigify_colors[4].select = Color((0.3490196168422699, 0.7176470756530762, 0.04313725605607033))
    arm.rigify_colors[4].standard_colors_lock = True

    for i in range(29):
        arm.rigify_layers.add()

    arm.rigify_layers[0].name = "Head"
    arm.rigify_layers[0].row = 1
    arm.rigify_layers[0].set = False
    arm.rigify_layers[0].group = 4
    arm.rigify_layers[1].name = " "
    arm.rigify_layers[1].row = 1
    arm.rigify_layers[1].set = False
    arm.rigify_layers[1].group = 0
    arm.rigify_layers[2].name = "Torso"
    arm.rigify_layers[2].row = 2
    arm.rigify_layers[2].set = False
    arm.rigify_layers[2].group = 5
    arm.rigify_layers[3].name = " "
    arm.rigify_layers[3].row = 1
    arm.rigify_layers[3].set = False
    arm.rigify_layers[3].group = 0
    arm.rigify_layers[4].name = "Left Arm (IK)"
    arm.rigify_layers[4].row = 3
    arm.rigify_layers[4].set = True
    arm.rigify_layers[4].group = 1
    arm.rigify_layers[5].name = "Left Arm (FK)"
    arm.rigify_layers[5].row = 4
    arm.rigify_layers[5].set = True
    arm.rigify_layers[5].group = 1
    arm.rigify_layers[6].name = "Left Leg (IK)"
    arm.rigify_layers[6].row = 5
    arm.rigify_layers[6].set = True
    arm.rigify_layers[6].group = 1
    arm.rigify_layers[7].name = "Left Leg (FK)"
    arm.rigify_layers[7].row = 6
    arm.rigify_layers[7].set = True
    arm.rigify_layers[7].group = 1
    arm.rigify_layers[8].name = " "
    arm.rigify_layers[8].row = 1
    arm.rigify_layers[8].set = False
    arm.rigify_layers[8].group = 0
    arm.rigify_layers[9].name = " "
    arm.rigify_layers[9].row = 1
    arm.rigify_layers[9].set = False
    arm.rigify_layers[9].group = 0
    arm.rigify_layers[10].name = " "
    arm.rigify_layers[10].row = 1
    arm.rigify_layers[10].set = False
    arm.rigify_layers[10].group = 0
    arm.rigify_layers[11].name = " "
    arm.rigify_layers[11].row = 1
    arm.rigify_layers[11].set = False
    arm.rigify_layers[11].group = 0
    arm.rigify_layers[12].name = " "
    arm.rigify_layers[12].row = 1
    arm.rigify_layers[12].set = False
    arm.rigify_layers[12].group = 0
    arm.rigify_layers[13].name = " "
    arm.rigify_layers[13].row = 1
    arm.rigify_layers[13].set = False
    arm.rigify_layers[13].group = 0
    arm.rigify_layers[14].name = " "
    arm.rigify_layers[14].row = 1
    arm.rigify_layers[14].set = False
    arm.rigify_layers[14].group = 0
    arm.rigify_layers[15].name = " "
    arm.rigify_layers[15].row = 1
    arm.rigify_layers[15].set = False
    arm.rigify_layers[15].group = 0
    arm.rigify_layers[16].name = "Face"
    arm.rigify_layers[16].row = 1
    arm.rigify_layers[16].set = False
    arm.rigify_layers[16].group = 0
    arm.rigify_layers[17].name = " "
    arm.rigify_layers[17].row = 1
    arm.rigify_layers[17].set = False
    arm.rigify_layers[17].group = 0
    arm.rigify_layers[18].name = " "
    arm.rigify_layers[18].row = 1
    arm.rigify_layers[18].set = False
    arm.rigify_layers[18].group = 0
    arm.rigify_layers[19].name = " "
    arm.rigify_layers[19].row = 1
    arm.rigify_layers[19].set = False
    arm.rigify_layers[19].group = 0
    arm.rigify_layers[20].name = "Right Arm (IK)"
    arm.rigify_layers[20].row = 3
    arm.rigify_layers[20].set = True
    arm.rigify_layers[20].group = 2
    arm.rigify_layers[21].name = "Right Arm (FK)"
    arm.rigify_layers[21].row = 4
    arm.rigify_layers[21].set = True
    arm.rigify_layers[21].group = 2
    arm.rigify_layers[22].name = "Right Leg (IK)"
    arm.rigify_layers[22].row = 5
    arm.rigify_layers[22].set = True
    arm.rigify_layers[22].group = 2
    arm.rigify_layers[23].name = "Right Leg (FK)"
    arm.rigify_layers[23].row = 6
    arm.rigify_layers[23].set = True
    arm.rigify_layers[23].group = 2
    arm.rigify_layers[24].name = " "
    arm.rigify_layers[24].row = 1
    arm.rigify_layers[24].set = False
    arm.rigify_layers[24].group = 0
    arm.rigify_layers[25].name = " "
    arm.rigify_layers[25].row = 1
    arm.rigify_layers[25].set = False
    arm.rigify_layers[25].group = 0
    arm.rigify_layers[26].name = " "
    arm.rigify_layers[26].row = 1
    arm.rigify_layers[26].set = False
    arm.rigify_layers[26].group = 0
    arm.rigify_layers[27].name = " "
    arm.rigify_layers[27].row = 1
    arm.rigify_layers[27].set = False
    arm.rigify_layers[27].group = 0
    arm.rigify_layers[28].name = "Root"
    arm.rigify_layers[28].row = 14
    arm.rigify_layers[28].set = False
    arm.rigify_layers[28].group = 3

    bones = {}

    bone = arm.edit_bones.new('Pelvis')
    bone.head[:] = 0.0094, 0.0000, 0.9156
    bone.tail[:] = 0.0112, 0.0000, 1.0197
    bone.roll = -3.1243
    bone.use_connect = False
    bones['Pelvis'] = bone.name
    bone = arm.edit_bones.new('Spine')
    bone.head[:] = 0.0112, 0.0000, 1.0197
    bone.tail[:] = 0.0131, 0.0000, 1.1238
    bone.roll = -3.1233
    bone.use_connect = True
    bone.parent = arm.edit_bones[bones['Pelvis']]
    bones['Spine'] = bone.name
    bone = arm.edit_bones.new('Thigh.L')
    bone.head[:] = 0.0431, 0.0000, 0.8865
    bone.tail[:] = 0.2010, 0.0000, 0.4891
    bone.roll = -0.3782
    bone.use_connect = False
    bone.parent = arm.edit_bones[bones['Pelvis']]
    bones['Thigh.L'] = bone.name
    bone = arm.edit_bones.new('Thigh.R')
    bone.head[:] = -0.0157, 0.0000, 0.8890
    bone.tail[:] = -0.0266, 0.0000, 0.4693
    bone.roll = 0.0260
    bone.use_connect = False
    bone.parent = arm.edit_bones[bones['Pelvis']]
    bones['Thigh.R'] = bone.name
    bone = arm.edit_bones.new('Skirt')
    bone.head[:] = 0.0137, 0.0000, 0.8878
    bone.tail[:] = 0.0851, 0.0000, 0.4719
    bone.roll = -0.1701
    bone.use_connect = False
    bone.parent = arm.edit_bones[bones['Pelvis']]
    bones['Skirt'] = bone.name
    bone = arm.edit_bones.new('Chest.1')
    bone.head[:] = 0.0131, 0.0000, 1.1238
    bone.tail[:] = 0.0215, 0.0000, 1.2723
    bone.roll = -3.0851
    bone.use_connect = True
    bone.parent = arm.edit_bones[bones['Spine']]
    bones['Chest.1'] = bone.name
    bone = arm.edit_bones.new('Shin.L')
    bone.head[:] = 0.2010, 0.0000, 0.4891
    bone.tail[:] = 0.1679, 0.0000, 0.0680
    bone.roll = 0.0784
    bone.use_connect = True
    bone.parent = arm.edit_bones[bones['Thigh.L']]
    bones['Shin.L'] = bone.name
    bone = arm.edit_bones.new('Shin.R')
    bone.head[:] = -0.0266, 0.0000, 0.4693
    bone.tail[:] = -0.0749, 0.0000, 0.0824
    bone.roll = 0.1242
    bone.use_connect = True
    bone.parent = arm.edit_bones[bones['Thigh.R']]
    bones['Shin.R'] = bone.name
    bone = arm.edit_bones.new('Chest.2')
    bone.head[:] = 0.0215, 0.0000, 1.2723
    bone.tail[:] = 0.0314, 0.0000, 1.4488
    bone.roll = -3.0856
    bone.use_connect = True
    bone.parent = arm.edit_bones[bones['Chest.1']]
    bones['Chest.2'] = bone.name
    bone = arm.edit_bones.new('Foot.L')
    bone.head[:] = 0.1679, 0.0000, 0.0680
    bone.tail[:] = 0.2555, 0.0000, 0.0195
    bone.roll = -1.0652
    bone.use_connect = True
    bone.parent = arm.edit_bones[bones['Shin.L']]
    bones['Foot.L'] = bone.name
    bone = arm.edit_bones.new('Heel.L')
    bone.head[:] = 0.1679, 0.0000, 0.0680
    bone.tail[:] = 0.1099, 0.0000, -0.0022
    bone.roll = 0.6905
    bone.use_connect = True
    bone.parent = arm.edit_bones[bones['Shin.L']]
    bones['Heel.L'] = bone.name
    bone = arm.edit_bones.new('Foot.R')
    bone.head[:] = -0.0749, 0.0000, 0.0824
    bone.tail[:] = 0.0219, 0.0000, 0.0243
    bone.roll = -1.0302
    bone.use_connect = True
    bone.parent = arm.edit_bones[bones['Shin.R']]
    bones['Foot.R'] = bone.name
    bone = arm.edit_bones.new('Heel.R')
    bone.head[:] = -0.0749, 0.0000, 0.0824
    bone.tail[:] = -0.1430, 0.0000, 0.0051
    bone.roll = 0.7222
    bone.use_connect = True
    bone.parent = arm.edit_bones[bones['Shin.R']]
    bones['Heel.R'] = bone.name
    bone = arm.edit_bones.new('Neck')
    bone.head[:] = 0.0314, 0.0000, 1.4488
    bone.tail[:] = 0.0703, 0.0000, 1.5159
    bone.roll = -2.6162
    bone.use_connect = False
    bone.parent = arm.edit_bones[bones['Chest.2']]
    bones['Neck'] = bone.name
    bone = arm.edit_bones.new('Arm.L')
    bone.head[:] = 0.0439, 0.0000, 1.3920
    bone.tail[:] = 0.0899, 0.0000, 1.1325
    bone.roll = -0.1754
    bone.use_connect = False
    bone.parent = arm.edit_bones[bones['Chest.2']]
    bones['Arm.L'] = bone.name
    bone = arm.edit_bones.new('Arm.R')
    bone.head[:] = -0.0277, 0.0000, 1.3996
    bone.tail[:] = -0.0432, 0.0000, 1.0917
    bone.roll = 0.0503
    bone.use_connect = False
    bone.parent = arm.edit_bones[bones['Chest.2']]
    bones['Arm.R'] = bone.name
    bone = arm.edit_bones.new('Toe.L')
    bone.head[:] = 0.2555, 0.0000, 0.0195
    bone.tail[:] = 0.3079, 0.0000, 0.0044
    bone.roll = -1.2902
    bone.use_connect = True
    bone.parent = arm.edit_bones[bones['Foot.L']]
    bones['Toe.L'] = bone.name
    bone = arm.edit_bones.new('Toe.R')
    bone.head[:] = 0.0219, 0.0000, 0.0243
    bone.tail[:] = 0.0887, 0.0000, 0.0000
    bone.roll = -1.2219
    bone.use_connect = True
    bone.parent = arm.edit_bones[bones['Foot.R']]
    bones['Toe.R'] = bone.name
    bone = arm.edit_bones.new('Head')
    bone.head[:] = 0.0703, 0.0000, 1.5159
    bone.tail[:] = 0.1024, 0.0000, 1.6612
    bone.roll = -2.9242
    bone.use_connect = True
    bone.parent = arm.edit_bones[bones['Neck']]
    bones['Head'] = bone.name
    bone = arm.edit_bones.new('Forearm.L')
    bone.head[:] = 0.0899, 0.0000, 1.1325
    bone.tail[:] = 0.2565, 0.0000, 0.9915
    bone.roll = -0.8684
    bone.use_connect = True
    bone.parent = arm.edit_bones[bones['Arm.L']]
    bones['Forearm.L'] = bone.name
    bone = arm.edit_bones.new('Forearm.R')
    bone.head[:] = -0.0432, 0.0000, 1.0917
    bone.tail[:] = 0.1264, 0.0000, 0.9515
    bone.roll = -0.8800
    bone.use_connect = True
    bone.parent = arm.edit_bones[bones['Arm.R']]
    bones['Forearm.R'] = bone.name
    bone = arm.edit_bones.new('Jaw')
    bone.head[:] = 0.0865, 0.0000, 1.5502
    bone.tail[:] = 0.1543, 0.0000, 1.4757
    bone.roll = -0.7383
    bone.use_connect = False
    bone.parent = arm.edit_bones[bones['Head']]
    bones['Jaw'] = bone.name
    bone = arm.edit_bones.new('Hat')
    bone.head[:] = 0.0841, 0.0000, 1.6888
    bone.tail[:] = 0.0841, 0.0000, 1.8177
    bone.roll = 3.1416
    bone.use_connect = False
    bone.parent = arm.edit_bones[bones['Head']]
    bones['Hat'] = bone.name
    bone = arm.edit_bones.new('Eyes')
    bone.head[:] = 0.0791, 0.0000, 1.6133
    bone.tail[:] = 0.1800, 0.0000, 1.6133
    bone.roll = -1.5708
    bone.use_connect = False
    bone.parent = arm.edit_bones[bones['Head']]
    bones['Eyes'] = bone.name
    bone = arm.edit_bones.new('Mouth')
    bone.head[:] = 0.1019, 0.0000, 1.5274
    bone.tail[:] = 0.1019, 0.0000, 1.5475
    bone.roll = 3.1416
    bone.use_connect = False
    bone.parent = arm.edit_bones[bones['Head']]
    bones['Mouth'] = bone.name
    bone = arm.edit_bones.new('Eyebrow.parent.L')
    bone.head[:] = 0.1625, 0.0000, 1.6725
    bone.tail[:] = 0.1217, 0.0000, 1.6362
    bone.roll = 0.8437
    bone.use_connect = False
    bone.parent = arm.edit_bones[bones['Head']]
    bones['Eyebrow.parent.L'] = bone.name
    bone = arm.edit_bones.new('Eyebrow.parent.R')
    bone.head[:] = 0.0318, 0.0000, 1.6689
    bone.tail[:] = 0.0700, 0.0000, 1.6362
    bone.roll = -0.8628
    bone.use_connect = False
    bone.parent = arm.edit_bones[bones['Head']]
    bones['Eyebrow.parent.R'] = bone.name
    bone = arm.edit_bones.new('Eyelid')
    bone.head[:] = 0.1132, -0.0000, 1.5975
    bone.tail[:] = 0.1433, -0.0000, 1.5926
    bone.roll = -1.4094
    bone.use_connect = False
    bone.parent = arm.edit_bones[bones['Head']]
    bones['Eyelid'] = bone.name
    bone = arm.edit_bones.new('Hand.L')
    bone.head[:] = 0.2565, 0.0000, 0.9915
    bone.tail[:] = 0.3366, 0.0000, 0.8363
    bone.roll = -0.4765
    bone.use_connect = True
    bone.parent = arm.edit_bones[bones['Forearm.L']]
    bones['Hand.L'] = bone.name
    bone = arm.edit_bones.new('Hand.R')
    bone.head[:] = 0.1264, 0.0000, 0.9515
    bone.tail[:] = 0.1290, 0.0000, 0.7804
    bone.roll = -0.0152
    bone.use_connect = True
    bone.parent = arm.edit_bones[bones['Forearm.R']]
    bones['Hand.R'] = bone.name
    bone = arm.edit_bones.new('Mouth_upper.R')
    bone.head[:] = 0.0807, 0.0000, 1.5336
    bone.tail[:] = 0.0929, 0.0000, 1.5374
    bone.roll = -1.8728
    bone.use_connect = False
    bone.parent = arm.edit_bones[bones['Mouth']]
    bones['Mouth_upper.R'] = bone.name
    bone = arm.edit_bones.new('Eyebrow.L')
    bone.head[:] = 0.1217, 0.0000, 1.6362
    bone.tail[:] = 0.1506, 0.0000, 1.6466
    bone.roll = -1.9162
    bone.use_connect = True
    bone.parent = arm.edit_bones[bones['Eyebrow.parent.L']]
    bones['Eyebrow.L'] = bone.name
    bone = arm.edit_bones.new('Eyebrow.R')
    bone.head[:] = 0.0700, 0.0000, 1.6362
    bone.tail[:] = 0.0412, 0.0000, 1.6466
    bone.roll = 1.9173
    bone.use_connect = True
    bone.parent = arm.edit_bones[bones['Eyebrow.parent.R']]
    bones['Eyebrow.R'] = bone.name
    bone = arm.edit_bones.new('Prop')
    bone.head[:] = 0.3599, 0.0000, 0.9073
    bone.tail[:] = 0.6984, 0.0000, 1.0624
    bone.roll = -2.0004
    bone.use_connect = False
    bone.parent = arm.edit_bones[bones['Hand.L']]
    bones['Prop'] = bone.name
    bone = arm.edit_bones.new('Mouth_upper')
    bone.head[:] = 0.0929, 0.0000, 1.5374
    bone.tail[:] = 0.1108, 0.0000, 1.5374
    bone.roll = -1.5708
    bone.use_connect = True
    bone.parent = arm.edit_bones[bones['Mouth_upper.R']]
    bones['Mouth_upper'] = bone.name
    bone = arm.edit_bones.new('Eyebrow_center.L')
    bone.head[:] = 0.1506, 0.0000, 1.6466
    bone.tail[:] = 0.1778, 0.0000, 1.6466
    bone.roll = -1.5708
    bone.use_connect = True
    bone.parent = arm.edit_bones[bones['Eyebrow.L']]
    bones['Eyebrow_center.L'] = bone.name
    bone = arm.edit_bones.new('Eyebrow_center.R')
    bone.head[:] = 0.0412, 0.0000, 1.6466
    bone.tail[:] = 0.0139, 0.0000, 1.6466
    bone.roll = 1.5708
    bone.use_connect = True
    bone.parent = arm.edit_bones[bones['Eyebrow.R']]
    bones['Eyebrow_center.R'] = bone.name
    bone = arm.edit_bones.new('Mouth_upper.L')
    bone.head[:] = 0.1108, 0.0000, 1.5374
    bone.tail[:] = 0.1231, 0.0000, 1.5336
    bone.roll = -1.2712
    bone.use_connect = True
    bone.parent = arm.edit_bones[bones['Mouth_upper']]
    bones['Mouth_upper.L'] = bone.name
    bone = arm.edit_bones.new('Eyebrow_side.L')
    bone.head[:] = 0.1778, 0.0000, 1.6466
    bone.tail[:] = 0.2051, 0.0000, 1.6287
    bone.roll = -0.9904
    bone.use_connect = True
    bone.parent = arm.edit_bones[bones['Eyebrow_center.L']]
    bones['Eyebrow_side.L'] = bone.name
    bone = arm.edit_bones.new('Eyebrow_side.R')
    bone.head[:] = 0.0139, 0.0000, 1.6466
    bone.tail[:] = -0.0134, 0.0000, 1.6287
    bone.roll = 0.9904
    bone.use_connect = True
    bone.parent = arm.edit_bones[bones['Eyebrow_center.R']]
    bones['Eyebrow_side.R'] = bone.name
    bone = arm.edit_bones.new('Mouth_lower.R')
    bone.head[:] = 0.0807, 0.0000, 1.5336
    bone.tail[:] = 0.0929, 0.0000, 1.5299
    bone.roll = -1.2763
    bone.use_connect = False
    bone.parent = arm.edit_bones[bones['Mouth_upper.L']]
    bones['Mouth_lower.R'] = bone.name
    bone = arm.edit_bones.new('Mouth_lower')
    bone.head[:] = 0.0929, 0.0000, 1.5299
    bone.tail[:] = 0.1108, 0.0000, 1.5299
    bone.roll = -1.5708
    bone.use_connect = True
    bone.parent = arm.edit_bones[bones['Mouth_lower.R']]
    bones['Mouth_lower'] = bone.name
    bone = arm.edit_bones.new('Mouth_lower.L')
    bone.head[:] = 0.1108, 0.0000, 1.5299
    bone.tail[:] = 0.1231, 0.0000, 1.5336
    bone.roll = -1.8630
    bone.use_connect = True
    bone.parent = arm.edit_bones[bones['Mouth_lower']]
    bones['Mouth_lower.L'] = bone.name

    bpy.ops.object.mode_set(mode='OBJECT')
    pbone = obj.pose.bones[bones['Pelvis']]
    pbone.rigify_type = 'pantin.torso'
    pbone.lock_location = (False, False, True)
    pbone.lock_rotation = (True, True, False)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (True, True, True)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
    try:
        pbone.rigify_parameters.Z_index = 1.0
    except AttributeError:
        pass
    try:
        pbone.rigify_parameters.flip_switch = False
    except AttributeError:
        pass
    try:
        pbone.rigify_parameters.root_name = "Root"
    except AttributeError:
        pass
    pbone = obj.pose.bones[bones['Spine']]
    pbone.rigify_type = ''
    pbone.lock_location = (False, False, False)
    pbone.lock_rotation = (True, True, False)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (False, False, False)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
    pbone = obj.pose.bones[bones['Thigh.L']]
    pbone.rigify_type = 'pantin.leg'
    pbone.lock_location = (False, False, True)
    pbone.lock_rotation = (True, True, False)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (False, False, False)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
    try:
        pbone.rigify_parameters.Z_index = 2.0
    except AttributeError:
        pass
    try:
        pbone.rigify_parameters.pelvis_name = "Pelvis"
    except AttributeError:
        pass
    try:
        pbone.rigify_parameters.duplicate_lr = False
    except AttributeError:
        pass
    try:
        pbone.rigify_parameters.side = ".L"
    except AttributeError:
        pass
    pbone = obj.pose.bones[bones['Thigh.R']]
    pbone.rigify_type = 'pantin.leg'
    pbone.lock_location = (False, False, True)
    pbone.lock_rotation = (True, True, False)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (False, False, False)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False]
    try:
        pbone.rigify_parameters.Z_index = 2.0
    except AttributeError:
        pass
    try:
        pbone.rigify_parameters.pelvis_name = "Pelvis"
    except AttributeError:
        pass
    try:
        pbone.rigify_parameters.duplicate_lr = False
    except AttributeError:
        pass
    try:
        pbone.rigify_parameters.side = ".R"
    except AttributeError:
        pass
    pbone = obj.pose.bones[bones['Skirt']]
    pbone.rigify_type = 'pantin.skirt'
    pbone.lock_location = (False, False, True)
    pbone.lock_rotation = (True, True, False)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (False, False, False)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
    try:
        pbone.rigify_parameters.Z_index = 2.5
    except AttributeError:
        pass
    pbone = obj.pose.bones[bones['Chest.1']]
    pbone.rigify_type = ''
    pbone.lock_location = (False, False, False)
    pbone.lock_rotation = (True, True, False)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (False, False, False)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
    pbone = obj.pose.bones[bones['Shin.L']]
    pbone.rigify_type = ''
    pbone.lock_location = (False, False, True)
    pbone.lock_rotation = (True, True, False)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (False, False, False)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
    pbone = obj.pose.bones[bones['Shin.R']]
    pbone.rigify_type = ''
    pbone.lock_location = (False, False, True)
    pbone.lock_rotation = (True, True, False)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (False, False, False)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False]
    pbone = obj.pose.bones[bones['Chest.2']]
    pbone.rigify_type = ''
    pbone.lock_location = (False, False, False)
    pbone.lock_rotation = (True, True, False)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (False, False, False)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
    pbone = obj.pose.bones[bones['Foot.L']]
    pbone.rigify_type = ''
    pbone.lock_location = (False, False, True)
    pbone.lock_rotation = (True, True, False)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (False, False, False)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
    pbone = obj.pose.bones[bones['Heel.L']]
    pbone.rigify_type = ''
    pbone.lock_location = (False, False, True)
    pbone.lock_rotation = (True, True, False)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (False, False, False)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
    pbone = obj.pose.bones[bones['Foot.R']]
    pbone.rigify_type = ''
    pbone.lock_location = (False, False, True)
    pbone.lock_rotation = (True, True, False)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (False, False, False)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False]
    pbone = obj.pose.bones[bones['Heel.R']]
    pbone.rigify_type = ''
    pbone.lock_location = (False, False, True)
    pbone.lock_rotation = (True, True, False)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (False, False, False)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False]
    pbone = obj.pose.bones[bones['Neck']]
    pbone.rigify_type = 'pantin.head'
    pbone.lock_location = (True, True, True)
    pbone.lock_rotation = (True, True, False)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (True, True, True)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
    try:
        pbone.rigify_parameters.Z_index = 0.0
    except AttributeError:
        pass
    try:
        pbone.rigify_parameters.flip_switch = False
    except AttributeError:
        pass
    try:
        pbone.rigify_parameters.detach = True
    except AttributeError:
        pass
    pbone = obj.pose.bones[bones['Arm.L']]
    pbone.rigify_type = 'pantin.arm'
    pbone.lock_location = (False, False, True)
    pbone.lock_rotation = (True, True, False)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (False, False, False)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
    try:
        pbone.rigify_parameters.pelvis_name = "Pelvis"
    except AttributeError:
        pass
    try:
        pbone.rigify_parameters.duplicate_lr = False
    except AttributeError:
        pass
    try:
        pbone.rigify_parameters.Z_index = 3.0
    except AttributeError:
        pass
    try:
        pbone.rigify_parameters.side = ".L"
    except AttributeError:
        pass
    pbone = obj.pose.bones[bones['Arm.R']]
    pbone.rigify_type = 'pantin.arm'
    pbone.lock_location = (False, False, True)
    pbone.lock_rotation = (True, True, False)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (False, False, False)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False]
    try:
        pbone.rigify_parameters.pelvis_name = "Pelvis"
    except AttributeError:
        pass
    try:
        pbone.rigify_parameters.duplicate_lr = False
    except AttributeError:
        pass
    try:
        pbone.rigify_parameters.Z_index = 3.0
    except AttributeError:
        pass
    try:
        pbone.rigify_parameters.side = ".R"
    except AttributeError:
        pass
    pbone = obj.pose.bones[bones['Toe.L']]
    pbone.rigify_type = ''
    pbone.lock_location = (True, True, True)
    pbone.lock_rotation = (True, True, False)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (False, False, False)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
    pbone = obj.pose.bones[bones['Toe.R']]
    pbone.rigify_type = ''
    pbone.lock_location = (True, True, True)
    pbone.lock_rotation = (True, True, False)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (False, False, False)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False]
    pbone = obj.pose.bones[bones['Head']]
    pbone.rigify_type = ''
    pbone.lock_location = (False, False, True)
    pbone.lock_rotation = (True, True, False)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (True, True, True)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
    pbone = obj.pose.bones[bones['Forearm.L']]
    pbone.rigify_type = ''
    pbone.lock_location = (False, False, True)
    pbone.lock_rotation = (True, True, False)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (False, False, False)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
    pbone = obj.pose.bones[bones['Forearm.R']]
    pbone.rigify_type = ''
    pbone.lock_location = (False, False, True)
    pbone.lock_rotation = (True, True, False)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (False, False, False)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False]
    pbone = obj.pose.bones[bones['Jaw']]
    pbone.rigify_type = 'pantin.simple'
    pbone.lock_location = (True, True, True)
    pbone.lock_rotation = (True, True, False)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (False, False, True)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
    try:
        pbone.rigify_parameters.chain_type = "Normal"
    except AttributeError:
        pass
    try:
        pbone.rigify_parameters.pelvis_name = "Pelvis"
    except AttributeError:
        pass
    try:
        pbone.rigify_parameters.use_parent_Z_index = True
    except AttributeError:
        pass
    pbone = obj.pose.bones[bones['Hat']]
    pbone.rigify_type = 'pantin.simple'
    pbone.lock_location = (False, False, True)
    pbone.lock_rotation = (True, True, False)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (False, False, False)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
    try:
        pbone.rigify_parameters.pelvis_name = "Pelvis"
    except AttributeError:
        pass
    pbone = obj.pose.bones[bones['Eyes']]
    pbone.rigify_type = 'pantin.eyes'
    pbone.lock_location = (False, False, True)
    pbone.lock_rotation = (True, True, False)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (False, False, False)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
    try:
        pbone.rigify_parameters.eye_name = "Eye"
    except AttributeError:
        pass
    try:
        pbone.rigify_parameters.pelvis_name = "Pelvis"
    except AttributeError:
        pass
    pbone = obj.pose.bones[bones['Mouth']]
    pbone.rigify_type = 'pantin.mouth'
    pbone.lock_location = (False, False, True)
    pbone.lock_rotation = (True, True, False)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (False, False, False)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
    pbone = obj.pose.bones[bones['Eyebrow.parent.L']]
    pbone.rigify_type = 'pantin.simple'
    pbone.lock_location = (False, False, False)
    pbone.lock_rotation = (True, True, False)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (False, False, False)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
    try:
        pbone.rigify_parameters.pelvis_name = "Pelvis"
    except AttributeError:
        pass
    try:
        pbone.rigify_parameters.chain_type = "Curve"
    except AttributeError:
        pass
    try:
        pbone.rigify_parameters.curve_parent_to_first = True
    except AttributeError:
        pass
    pbone = obj.pose.bones[bones['Eyebrow.parent.R']]
    pbone.rigify_type = 'pantin.simple'
    pbone.lock_location = (False, False, False)
    pbone.lock_rotation = (True, True, False)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (False, False, False)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
    try:
        pbone.rigify_parameters.pelvis_name = "Pelvis"
    except AttributeError:
        pass
    try:
        pbone.rigify_parameters.chain_type = "Curve"
    except AttributeError:
        pass
    try:
        pbone.rigify_parameters.curve_parent_to_first = True
    except AttributeError:
        pass
    pbone = obj.pose.bones[bones['Eyelid']]
    pbone.rigify_type = 'pantin.simple'
    pbone.lock_location = (True, True, True)
    pbone.lock_rotation = (True, True, False)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (False, False, False)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
    try:
        pbone.rigify_parameters.pelvis_name = "Pelvis"
    except AttributeError:
        pass
    try:
        pbone.rigify_parameters.do_flip = True
    except AttributeError:
        pass
    try:
        pbone.rigify_parameters.use_parent_Z_index = True
    except AttributeError:
        pass
    pbone = obj.pose.bones[bones['Hand.L']]
    pbone.rigify_type = ''
    pbone.lock_location = (False, False, True)
    pbone.lock_rotation = (True, True, False)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (False, False, False)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
    pbone = obj.pose.bones[bones['Hand.R']]
    pbone.rigify_type = ''
    pbone.lock_location = (False, False, True)
    pbone.lock_rotation = (True, True, False)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (False, False, False)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False]
    pbone = obj.pose.bones[bones['Mouth_upper.R']]
    pbone.rigify_type = ''
    pbone.lock_location = (False, False, True)
    pbone.lock_rotation = (True, True, True)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (False, False, False)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
    pbone = obj.pose.bones[bones['Eyebrow.L']]
    pbone.rigify_type = ''
    pbone.lock_location = (False, False, True)
    pbone.lock_rotation = (True, True, False)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (False, False, False)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
    try:
        pbone.rigify_parameters.pelvis_name = "Pelvis"
    except AttributeError:
        pass
    try:
        pbone.rigify_parameters.do_flip = True
    except AttributeError:
        pass
    try:
        pbone.rigify_parameters.chain_type = "Curve"
    except AttributeError:
        pass
    pbone = obj.pose.bones[bones['Eyebrow.R']]
    pbone.rigify_type = ''
    pbone.lock_location = (False, False, True)
    pbone.lock_rotation = (True, True, False)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (False, False, False)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
    try:
        pbone.rigify_parameters.pelvis_name = "Pelvis"
    except AttributeError:
        pass
    try:
        pbone.rigify_parameters.do_flip = True
    except AttributeError:
        pass
    try:
        pbone.rigify_parameters.chain_type = "Curve"
    except AttributeError:
        pass
    try:
        pbone.rigify_parameters.curve_parent_to_first = True
    except AttributeError:
        pass
    pbone = obj.pose.bones[bones['Prop']]
    pbone.rigify_type = 'pantin.simple'
    pbone.lock_location = (False, False, True)
    pbone.lock_rotation = (True, True, False)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (False, False, False)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
    try:
        pbone.rigify_parameters.object_side = ".L"
    except AttributeError:
        pass
    try:
        pbone.rigify_parameters.pelvis_name = "Pelvis"
    except AttributeError:
        pass
    pbone = obj.pose.bones[bones['Mouth_upper']]
    pbone.rigify_type = ''
    pbone.lock_location = (False, False, True)
    pbone.lock_rotation = (True, True, True)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (False, False, False)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
    pbone = obj.pose.bones[bones['Eyebrow_center.L']]
    pbone.rigify_type = ''
    pbone.lock_location = (False, False, True)
    pbone.lock_rotation = (True, True, False)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (False, False, False)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
    pbone = obj.pose.bones[bones['Eyebrow_center.R']]
    pbone.rigify_type = ''
    pbone.lock_location = (False, False, True)
    pbone.lock_rotation = (True, True, False)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (False, False, False)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
    pbone = obj.pose.bones[bones['Mouth_upper.L']]
    pbone.rigify_type = ''
    pbone.lock_location = (False, False, True)
    pbone.lock_rotation = (True, True, True)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (False, False, False)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
    pbone = obj.pose.bones[bones['Eyebrow_side.L']]
    pbone.rigify_type = ''
    pbone.lock_location = (False, False, True)
    pbone.lock_rotation = (True, True, False)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (False, False, False)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
    pbone = obj.pose.bones[bones['Eyebrow_side.R']]
    pbone.rigify_type = ''
    pbone.lock_location = (False, False, True)
    pbone.lock_rotation = (True, True, False)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (False, False, False)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
    pbone = obj.pose.bones[bones['Mouth_lower.R']]
    pbone.rigify_type = ''
    pbone.lock_location = (False, False, True)
    pbone.lock_rotation = (True, True, True)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (False, False, False)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
    pbone = obj.pose.bones[bones['Mouth_lower']]
    pbone.rigify_type = ''
    pbone.lock_location = (False, False, True)
    pbone.lock_rotation = (True, True, True)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (False, False, False)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
    pbone = obj.pose.bones[bones['Mouth_lower.L']]
    pbone.rigify_type = ''
    pbone.lock_location = (False, False, True)
    pbone.lock_rotation = (True, True, True)
    pbone.lock_rotation_w = False
    pbone.lock_scale = (False, False, False)
    pbone.rotation_mode = 'XZY'
    pbone.bone.layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]

    bpy.ops.object.mode_set(mode='EDIT')
    for bone in arm.edit_bones:
        bone.select = False
        bone.select_head = False
        bone.select_tail = False
    for b in bones:
        bone = arm.edit_bones[bones[b]]
        bone.select = True
        bone.select_head = True
        bone.select_tail = True
        arm.edit_bones.active = bone

    arm.layers = [(x in [0, 2, 4, 6, 16, 20, 22]) for x in range(32)]


if __name__ == "__main__":
    create(bpy.context.active_object)

