Update for changes to Blender
[blender-addons.git] / rigify / legacy / rigs / pitchipoy / super_face.py
blobce593f55626cabd087b7a33616f88fba88cc94f0
1 import bpy, re
2 from mathutils import Vector
3 from ...utils import copy_bone, flip_bone
4 from ...utils import org, strip_org, make_deformer_name, connected_children_names, make_mechanism_name
5 from ...utils import create_circle_widget, create_sphere_widget, create_widget, create_cube_widget
6 from ...utils import MetarigError
7 from rna_prop_ui import rna_idprop_ui_prop_get
8 from .super_widgets import create_face_widget, create_eye_widget, create_eyes_widget, create_ear_widget, create_jaw_widget, create_teeth_widget
11 script = """
12 all_controls = [%s]
13 jaw_ctrl_name = '%s'
14 eyes_ctrl_name = '%s'
16 if is_selected(all_controls):
17 layout.prop(pose_bones[jaw_ctrl_name], '["%s"]', slider=True)
18 layout.prop(pose_bones[eyes_ctrl_name], '["%s"]', slider=True)
19 """
20 class Rig:
22 def __init__(self, obj, bone_name, params):
23 self.obj = obj
25 b = self.obj.data.bones
27 children = [
28 "nose", "lip.T.L", "lip.B.L", "jaw", "ear.L", "ear.R", "lip.T.R",
29 "lip.B.R", "brow.B.L", "lid.T.L", "brow.B.R", "lid.T.R",
30 "forehead.L", "forehead.R", "forehead.L.001", "forehead.R.001",
31 "forehead.L.002", "forehead.R.002", "eye.L", "eye.R", "cheek.T.L",
32 "cheek.T.R", "teeth.T", "teeth.B", "tongue", "temple.L",
33 "temple.R"
36 #create_pose_lib( self.obj )
38 children = [ org(b) for b in children ]
39 grand_children = []
41 for child in children:
42 grand_children += connected_children_names( self.obj, child )
44 self.org_bones = [bone_name] + children + grand_children
45 self.face_length = obj.data.edit_bones[ self.org_bones[0] ].length
46 self.params = params
48 if params.primary_layers_extra:
49 self.primary_layers = list(params.primary_layers)
50 else:
51 self.primary_layers = None
53 if params.secondary_layers_extra:
54 self.secondary_layers = list(params.secondary_layers)
55 else:
56 self.secondary_layers = None
58 def symmetrical_split( self, bones ):
60 # RE pattern match right or left parts
61 # match the letter "L" (or "R"), followed by an optional dot (".")
62 # and 0 or more digits at the end of the the string
63 left_pattern = 'L\.?\d*$'
64 right_pattern = 'R\.?\d*$'
66 left = sorted( [ name for name in bones if re.search( left_pattern, name ) ] )
67 right = sorted( [ name for name in bones if re.search( right_pattern, name ) ] )
69 return left, right
71 def create_deformation( self ):
72 org_bones = self.org_bones
74 bpy.ops.object.mode_set(mode ='EDIT')
75 eb = self.obj.data.edit_bones
77 def_bones = []
78 for org in org_bones:
79 if 'face' in org or 'teeth' in org or 'eye' in org:
80 continue
82 def_name = make_deformer_name( strip_org( org ) )
83 def_name = copy_bone( self.obj, org, def_name )
84 def_bones.append( def_name )
86 eb[def_name].use_connect = False
87 eb[def_name].parent = None
89 brow_top_names = [ bone for bone in def_bones if 'brow.T' in bone ]
90 forehead_names = [ bone for bone in def_bones if 'forehead' in bone ]
92 brow_left, brow_right = self.symmetrical_split( brow_top_names )
93 forehead_left, forehead_right = self.symmetrical_split( forehead_names )
95 brow_left = brow_left[1:]
96 brow_right = brow_right[1:]
97 brow_left.reverse()
98 brow_right.reverse()
100 for browL, browR, foreheadL, foreheadR in zip(
101 brow_left, brow_right, forehead_left, forehead_right ):
103 eb[foreheadL].tail = eb[browL].head
104 eb[foreheadR].tail = eb[browR].head
106 return { 'all' : def_bones }
109 def create_ctrl( self, bones ):
110 org_bones = self.org_bones
112 ## create control bones
113 bpy.ops.object.mode_set(mode ='EDIT')
114 eb = self.obj.data.edit_bones
116 # eyes ctrls
117 eyeL_e = eb[ bones['eyes'][0] ]
118 eyeR_e = eb[ bones['eyes'][1] ]
120 distance = ( eyeL_e.head - eyeR_e.head ) * 3
121 distance = distance.cross( (0, 0, 1) )
122 eye_length = eyeL_e.length
124 eyeL_ctrl_name = strip_org( bones['eyes'][0] )
125 eyeR_ctrl_name = strip_org( bones['eyes'][1] )
127 eyeL_ctrl_name = copy_bone( self.obj, bones['eyes'][0], eyeL_ctrl_name )
128 eyeR_ctrl_name = copy_bone( self.obj, bones['eyes'][1], eyeR_ctrl_name )
129 eyes_ctrl_name = copy_bone( self.obj, bones['eyes'][0], 'eyes' )
131 eyeL_ctrl_e = eb[ eyeL_ctrl_name ]
132 eyeR_ctrl_e = eb[ eyeR_ctrl_name ]
133 eyes_ctrl_e = eb[ 'eyes' ]
135 eyeL_ctrl_e.head += distance
136 eyeR_ctrl_e.head += distance
137 eyes_ctrl_e.head[:] = ( eyeL_ctrl_e.head + eyeR_ctrl_e.head ) / 2
139 for bone in [ eyeL_ctrl_e, eyeR_ctrl_e, eyes_ctrl_e ]:
140 bone.tail[:] = bone.head + Vector( [ 0, 0, eye_length * 0.75 ] )
142 ## Widget for transforming the both eyes
143 eye_master_names = []
144 for bone in bones['eyes']:
145 eye_master = copy_bone(
146 self.obj,
147 bone,
148 'master_' + strip_org(bone)
151 eye_master_names.append( eye_master )
153 ## turbo: adding a master nose for transforming the whole nose
154 master_nose = copy_bone(self.obj, 'ORG-nose.004', 'nose_master')
155 eb[master_nose].tail[:] = \
156 eb[master_nose].head + Vector([0, self.face_length / -4, 0])
158 # ears ctrls
159 earL_name = strip_org( bones['ears'][0] )
160 earR_name = strip_org( bones['ears'][1] )
162 earL_ctrl_name = copy_bone( self.obj, org( bones['ears'][0] ), earL_name )
163 earR_ctrl_name = copy_bone( self.obj, org( bones['ears'][1] ), earR_name )
165 # jaw ctrl
166 jaw_ctrl_name = strip_org( bones['jaw'][2] ) + '_master'
167 jaw_ctrl_name = copy_bone( self.obj, bones['jaw'][2], jaw_ctrl_name )
169 jawL_org_e = eb[ bones['jaw'][0] ]
170 jawR_org_e = eb[ bones['jaw'][1] ]
171 jaw_org_e = eb[ bones['jaw'][2] ]
173 eb[ jaw_ctrl_name ].head[:] = ( jawL_org_e.head + jawR_org_e.head ) / 2
175 # teeth ctrls
176 teethT_name = strip_org( bones['teeth'][0] )
177 teethB_name = strip_org( bones['teeth'][1] )
179 teethT_ctrl_name = copy_bone( self.obj, org( bones['teeth'][0] ), teethT_name )
180 teethB_ctrl_name = copy_bone( self.obj, org( bones['teeth'][1] ), teethB_name )
182 # tongue ctrl
183 tongue_org = bones['tongue'].pop()
184 tongue_name = strip_org( tongue_org ) + '_master'
186 tongue_ctrl_name = copy_bone( self.obj, tongue_org, tongue_name )
188 flip_bone( self.obj, tongue_ctrl_name )
190 ## Assign widgets
191 bpy.ops.object.mode_set(mode ='OBJECT')
193 # Assign each eye widgets
194 create_eye_widget( self.obj, eyeL_ctrl_name )
195 create_eye_widget( self.obj, eyeR_ctrl_name )
197 # Assign eyes widgets
198 create_eyes_widget( self.obj, eyes_ctrl_name )
200 # Assign each eye_master widgets
201 for master in eye_master_names:
202 create_square_widget(self.obj, master)
204 # Assign nose_master widget
205 create_square_widget( self.obj, master_nose, size = 1 )
207 # Assign ears widget
208 create_ear_widget( self.obj, earL_ctrl_name )
209 create_ear_widget( self.obj, earR_ctrl_name )
211 # Assign jaw widget
212 create_jaw_widget( self.obj, jaw_ctrl_name )
214 # Assign teeth widget
215 create_teeth_widget( self.obj, teethT_ctrl_name )
216 create_teeth_widget( self.obj, teethB_ctrl_name )
218 # Assign tongue widget ( using the jaw widget )
219 create_jaw_widget( self.obj, tongue_ctrl_name )
221 return {
222 'eyes' : [
223 eyeL_ctrl_name,
224 eyeR_ctrl_name,
225 eyes_ctrl_name,
226 ] + eye_master_names,
227 'ears' : [ earL_ctrl_name, earR_ctrl_name ],
228 'jaw' : [ jaw_ctrl_name ],
229 'teeth' : [ teethT_ctrl_name, teethB_ctrl_name ],
230 'tongue' : [ tongue_ctrl_name ],
231 'nose' : [ master_nose ]
235 def create_tweak( self, bones, uniques, tails ):
236 org_bones = self.org_bones
238 ## create tweak bones
239 bpy.ops.object.mode_set(mode ='EDIT')
240 eb = self.obj.data.edit_bones
242 tweaks = []
244 for bone in bones + list( uniques.keys() ):
246 tweak_name = strip_org( bone )
248 # pick name for unique bone from the uniques dictionary
249 if bone in list( uniques.keys() ):
250 tweak_name = uniques[bone]
252 tweak_name = copy_bone( self.obj, bone, tweak_name )
253 eb[ tweak_name ].use_connect = False
254 eb[ tweak_name ].parent = None
256 tweaks.append( tweak_name )
258 eb[ tweak_name ].tail[:] = \
259 eb[ tweak_name ].head + Vector(( 0, 0, self.face_length / 7 ))
261 # create tail bone
262 if bone in tails:
263 if 'lip.T.L.001' in bone:
264 tweak_name = copy_bone( self.obj, bone, 'lips.L' )
265 elif 'lip.T.R.001' in bone:
266 tweak_name = copy_bone( self.obj, bone, 'lips.R' )
267 else:
268 tweak_name = copy_bone( self.obj, bone, tweak_name )
270 eb[ tweak_name ].use_connect = False
271 eb[ tweak_name ].parent = None
273 eb[ tweak_name ].head = eb[ bone ].tail
274 eb[ tweak_name ].tail[:] = \
275 eb[ tweak_name ].head + Vector(( 0, 0, self.face_length / 7 ))
277 tweaks.append( tweak_name )
279 bpy.ops.object.mode_set(mode ='OBJECT')
280 pb = self.obj.pose.bones
282 primary_tweaks = [
283 "lid.B.L.002", "lid.T.L.002", "lid.B.R.002", "lid.T.R.002",
284 "chin", "brow.T.L.001", "brow.T.L.002", "brow.T.L.003",
285 "brow.T.R.001", "brow.T.R.002", "brow.T.R.003", "lip.B",
286 "lip.B.L.001", "lip.B.R.001", "cheek.B.L.001", "cheek.B.R.001",
287 "lips.L", "lips.R", "lip.T.L.001", "lip.T.R.001", "lip.T",
288 "nose.002", "nose.L.001", "nose.R.001"
291 for bone in tweaks:
292 if bone in primary_tweaks:
293 if self.primary_layers:
294 pb[bone].bone.layers = self.primary_layers
295 create_face_widget( self.obj, bone, size = 1.5 )
296 else:
297 if self.secondary_layers:
298 pb[bone].bone.layers = self.secondary_layers
299 create_face_widget( self.obj, bone )
301 return { 'all' : tweaks }
304 def all_controls( self ):
305 org_bones = self.org_bones
307 org_tongue_bones = sorted([ bone for bone in org_bones if 'tongue' in bone ])
309 org_to_ctrls = {
310 'eyes' : [ 'eye.L', 'eye.R' ],
311 'ears' : [ 'ear.L', 'ear.R' ],
312 'jaw' : [ 'jaw.L', 'jaw.R', 'jaw' ],
313 'teeth' : [ 'teeth.T', 'teeth.B' ],
314 'tongue' : [ org_tongue_bones[0] ]
317 tweak_unique = { 'lip.T.L' : 'lip.T',
318 'lip.B.L' : 'lip.B' }
320 org_to_ctrls = { key : [ org( bone ) for bone in org_to_ctrls[key] ] for key in org_to_ctrls.keys() }
321 tweak_unique = { org( key ) : tweak_unique[key] for key in tweak_unique.keys() }
323 tweak_exceptions = [] # bones not used to create tweaks
324 tweak_exceptions += [ bone for bone in org_bones if 'forehead' in bone or 'temple' in bone ]
326 tweak_tail = [ 'brow.B.L.003', 'brow.B.R.003', 'nose.004', 'chin.001' ]
327 tweak_tail += [ 'lip.T.L.001', 'lip.T.R.001', 'tongue.002' ]
329 tweak_exceptions += [ 'lip.T.R', 'lip.B.R', 'ear.L.001', 'ear.R.001' ] + list(tweak_unique.keys())
330 tweak_exceptions += [ 'face', 'cheek.T.L', 'cheek.T.R', 'cheek.B.L', 'cheek.B.R' ]
331 tweak_exceptions += [ 'ear.L', 'ear.R', 'eye.L', 'eye.R' ]
333 tweak_exceptions += org_to_ctrls.keys()
334 tweak_exceptions += org_to_ctrls['teeth']
336 tweak_exceptions.pop( tweak_exceptions.index('tongue') )
337 tweak_exceptions.pop( tweak_exceptions.index('jaw') )
339 tweak_exceptions = [ org( bone ) for bone in tweak_exceptions ]
340 tweak_tail = [ org( bone ) for bone in tweak_tail ]
342 org_to_tweak = sorted( [ bone for bone in org_bones if bone not in tweak_exceptions ] )
344 ctrls = self.create_ctrl( org_to_ctrls )
345 tweaks = self.create_tweak( org_to_tweak, tweak_unique, tweak_tail )
347 return { 'ctrls' : ctrls, 'tweaks' : tweaks }, tweak_unique
349 def create_mch( self, jaw_ctrl, tongue_ctrl ):
350 org_bones = self.org_bones
351 bpy.ops.object.mode_set(mode ='EDIT')
352 eb = self.obj.data.edit_bones
354 # Create eyes mch bones
355 eyes = [ bone for bone in org_bones if 'eye' in bone ]
357 mch_bones = { strip_org( eye ) : [] for eye in eyes }
359 for eye in eyes:
360 mch_name = make_mechanism_name( strip_org( eye ) )
361 mch_name = copy_bone( self.obj, eye, mch_name )
362 eb[ mch_name ].use_connect = False
363 eb[ mch_name ].parent = None
365 mch_bones[ strip_org( eye ) ].append( mch_name )
367 mch_name = copy_bone( self.obj, eye, mch_name )
368 eb[ mch_name ].use_connect = False
369 eb[ mch_name ].parent = None
371 mch_bones[ strip_org( eye ) ].append( mch_name )
373 eb[ mch_name ].head[:] = eb[ mch_name ].tail
374 eb[ mch_name ].tail[:] = eb[ mch_name ].head + Vector( ( 0, 0, 0.005 ) )
376 # Create the eyes' parent mch
377 face = [ bone for bone in org_bones if 'face' in bone ].pop()
379 mch_name = 'eyes_parent'
380 mch_name = make_mechanism_name( mch_name )
381 mch_name = copy_bone( self.obj, face, mch_name )
382 eb[ mch_name ].use_connect = False
383 eb[ mch_name ].parent = None
385 eb[ mch_name ].length /= 4
387 mch_bones['eyes_parent'] = [ mch_name ]
389 # Create the lids' mch bones
390 all_lids = [ bone for bone in org_bones if 'lid' in bone ]
391 lids_L, lids_R = self.symmetrical_split( all_lids )
393 all_lids = [ lids_L, lids_R ]
395 mch_bones['lids'] = []
397 for i in range( 2 ):
398 for bone in all_lids[i]:
399 mch_name = make_mechanism_name( strip_org( bone ) )
400 mch_name = copy_bone( self.obj, eyes[i], mch_name )
402 eb[ mch_name ].use_connect = False
403 eb[ mch_name ].parent = None
405 eb[ mch_name ].tail[:] = eb[ bone ].head
407 mch_bones['lids'].append( mch_name )
409 mch_bones['jaw'] = []
411 length_subtractor = eb[ jaw_ctrl ].length / 6
412 # Create the jaw mch bones
413 for i in range( 6 ):
414 if i == 0:
415 mch_name = make_mechanism_name( 'mouth_lock' )
416 else:
417 mch_name = make_mechanism_name( jaw_ctrl )
419 mch_name = copy_bone( self.obj, jaw_ctrl, mch_name )
421 eb[ mch_name ].use_connect = False
422 eb[ mch_name ].parent = None
424 eb[ mch_name ].length = eb[ jaw_ctrl ].length - length_subtractor * i
426 mch_bones['jaw'].append( mch_name )
428 # Tongue mch bones
430 mch_bones['tongue'] = []
432 # create mch bones for all tongue org_bones except the first one
433 for bone in sorted([ org for org in org_bones if 'tongue' in org ])[1:]:
434 mch_name = make_mechanism_name( strip_org( bone ) )
435 mch_name = copy_bone( self.obj, tongue_ctrl, mch_name )
437 eb[ mch_name ].use_connect = False
438 eb[ mch_name ].parent = None
440 mch_bones['tongue'].append( mch_name )
442 return mch_bones
444 def parent_bones( self, all_bones, tweak_unique ):
445 org_bones = self.org_bones
446 bpy.ops.object.mode_set(mode ='EDIT')
447 eb = self.obj.data.edit_bones
449 face_name = [ bone for bone in org_bones if 'face' in bone ].pop()
451 # Initially parenting all bones to the face org bone.
452 for category in list( all_bones.keys() ):
453 for area in list( all_bones[category] ):
454 for bone in all_bones[category][area]:
455 eb[ bone ].parent = eb[ face_name ]
457 ## Parenting all deformation bones and org bones
459 # Parent all the deformation bones that have respective tweaks
460 def_tweaks = [ bone for bone in all_bones['deform']['all'] if bone[4:] in all_bones['tweaks']['all'] ]
462 # Parent all org bones to the ORG-face
463 for bone in [ bone for bone in org_bones if 'face' not in bone ]:
464 eb[ bone ].parent = eb[ org('face') ]
466 for bone in def_tweaks:
467 # the def and the matching org bone are parented to their corresponding tweak,
468 # whose name is the same as that of the def bone, without the "DEF-" (first 4 chars)
469 eb[ bone ].parent = eb[ bone[4:] ]
470 eb[ org( bone[4:] ) ].parent = eb[ bone[4:] ]
472 # Parent ORG eyes to corresponding mch bones
473 for bone in [ bone for bone in org_bones if 'eye' in bone ]:
474 eb[ bone ].parent = eb[ make_mechanism_name( strip_org( bone ) ) ]
476 for lip_tweak in list( tweak_unique.values() ):
477 # find the def bones that match unique lip_tweaks by slicing [4:-2]
478 # example: 'lip.B' matches 'DEF-lip.B.R' and 'DEF-lip.B.L' if
479 # you cut off the "DEF-" [4:] and the ".L" or ".R" [:-2]
480 lip_defs = [ bone for bone in all_bones['deform']['all'] if bone[4:-2] == lip_tweak ]
482 for bone in lip_defs:
483 eb[bone].parent = eb[ lip_tweak ]
485 # parent cheek bones top respetive tweaks
486 lips = [ 'lips.L', 'lips.R' ]
487 brows = [ 'brow.T.L', 'brow.T.R' ]
488 cheekB_defs = [ 'DEF-cheek.B.L', 'DEF-cheek.B.R' ]
489 cheekT_defs = [ 'DEF-cheek.T.L', 'DEF-cheek.T.R' ]
491 for lip, brow, cheekB, cheekT in zip( lips, brows, cheekB_defs, cheekT_defs ):
492 eb[ cheekB ].parent = eb[ lip ]
493 eb[ cheekT ].parent = eb[ brow ]
495 # parent ear deform bones to their controls
496 ear_defs = [ 'DEF-ear.L', 'DEF-ear.L.001', 'DEF-ear.R', 'DEF-ear.R.001' ]
497 ear_ctrls = [ 'ear.L', 'ear.R' ]
499 eb[ 'DEF-jaw' ].parent = eb[ 'jaw' ] # Parent jaw def bone to jaw tweak
501 for ear_ctrl in ear_ctrls:
502 for ear_def in ear_defs:
503 if ear_ctrl in ear_def:
504 eb[ ear_def ].parent = eb[ ear_ctrl ]
506 # Parent eyelid deform bones (each lid def bone is parented to its respective MCH bone)
507 def_lids = [ bone for bone in all_bones['deform']['all'] if 'lid' in bone ]
509 for bone in def_lids:
510 mch = make_mechanism_name( bone[4:] )
511 eb[ bone ].parent = eb[ mch ]
513 ## Parenting all mch bones
515 eb[ 'MCH-eyes_parent' ].parent = None # eyes_parent will be parented to root
517 # parent all mch tongue bones to the jaw master control bone
518 for bone in all_bones['mch']['tongue']:
519 eb[ bone ].parent = eb[ all_bones['ctrls']['jaw'][0] ]
521 ## Parenting the control bones
523 # parent teeth.B and tongue master controls to the jaw master control bone
524 for bone in [ 'teeth.B', 'tongue_master' ]:
525 eb[ bone ].parent = eb[ all_bones['ctrls']['jaw'][0] ]
527 # eyes
528 eb[ 'eyes' ].parent = eb[ 'MCH-eyes_parent' ]
530 eyes = [
531 bone for bone in all_bones['ctrls']['eyes'] if 'eyes' not in bone
532 ][0:2]
534 for eye in eyes:
535 eb[ eye ].parent = eb[ 'eyes' ]
537 ## turbo: parent eye master bones to face
538 for eye_master in eyes[2:]:
539 eb[ eye_master ].parent = eb[ 'ORG-face' ]
541 # Parent brow.b, eyes mch and lid tweaks and mch bones to masters
542 tweaks = [
543 b for b in all_bones['tweaks']['all'] if 'lid' in b or 'brow.B' in b
545 mch = all_bones['mch']['lids'] + \
546 all_bones['mch']['eye.R'] + \
547 all_bones['mch']['eye.L']
549 everyone = tweaks + mch
551 left, right = self.symmetrical_split( everyone )
553 for l in left:
554 eb[ l ].parent = eb[ 'master_eye.L' ]
556 for r in right:
557 eb[ r ].parent = eb[ 'master_eye.R' ]
559 ## turbo: nose to mch jaw.004
560 eb[ all_bones['ctrls']['nose'].pop() ].parent = eb['MCH-jaw_master.004']
562 ## Parenting the tweak bones
564 # Jaw children (values) groups and their parents (keys)
565 groups = {
566 'jaw_master' : [
567 'jaw',
568 'jaw.R.001',
569 'jaw.L.001',
570 'chin.L',
571 'chin.R',
572 'chin',
573 'tongue.003'
575 'MCH-jaw_master' : [
576 'lip.B'
578 'MCH-jaw_master.001' : [
579 'lip.B.L.001',
580 'lip.B.R.001'
582 'MCH-jaw_master.002' : [
583 'lips.L',
584 'lips.R',
585 'cheek.B.L.001',
586 'cheek.B.R.001'
588 'MCH-jaw_master.003' : [
589 'lip.T',
590 'lip.T.L.001',
591 'lip.T.R.001'
593 'MCH-jaw_master.004' : [
594 'cheek.T.L.001',
595 'cheek.T.R.001'
597 'nose_master' : [
598 'nose.002',
599 'nose.004',
600 'nose.L.001',
601 'nose.R.001'
605 for parent in list( groups.keys() ):
606 for bone in groups[parent]:
607 eb[ bone ].parent = eb[ parent ]
609 # Remaining arbitrary relatioships for tweak bone parenting
610 eb[ 'chin.001' ].parent = eb[ 'chin' ]
611 eb[ 'chin.002' ].parent = eb[ 'lip.B' ]
612 eb[ 'nose.001' ].parent = eb[ 'nose.002' ]
613 eb[ 'nose.003' ].parent = eb[ 'nose.002' ]
614 eb[ 'nose.005' ].parent = eb[ 'lip.T' ]
615 eb[ 'tongue' ].parent = eb[ 'tongue_master' ]
616 eb[ 'tongue.001' ].parent = eb[ 'MCH-tongue.001' ]
617 eb[ 'tongue.002' ].parent = eb[ 'MCH-tongue.002' ]
619 for bone in [ 'ear.L.002', 'ear.L.003', 'ear.L.004' ]:
620 eb[ bone ].parent = eb[ 'ear.L' ]
621 eb[ bone.replace( '.L', '.R' ) ].parent = eb[ 'ear.R' ]
624 def make_constraits( self, constraint_type, bone, subtarget, influence = 1 ):
625 org_bones = self.org_bones
626 bpy.ops.object.mode_set(mode ='OBJECT')
627 pb = self.obj.pose.bones
629 owner_pb = pb[bone]
631 if constraint_type == 'def_tweak':
633 const = owner_pb.constraints.new( 'DAMPED_TRACK' )
634 const.target = self.obj
635 const.subtarget = subtarget
637 const = owner_pb.constraints.new( 'STRETCH_TO' )
638 const.target = self.obj
639 const.subtarget = subtarget
641 elif constraint_type == 'def_lids':
643 const = owner_pb.constraints.new( 'DAMPED_TRACK' )
644 const.target = self.obj
645 const.subtarget = subtarget
646 const.head_tail = 1.0
648 const = owner_pb.constraints.new( 'STRETCH_TO' )
649 const.target = self.obj
650 const.subtarget = subtarget
651 const.head_tail = 1.0
653 elif constraint_type == 'mch_eyes':
655 const = owner_pb.constraints.new( 'DAMPED_TRACK' )
656 const.target = self.obj
657 const.subtarget = subtarget
659 elif constraint_type == 'mch_eyes_lids_follow':
661 const = owner_pb.constraints.new( 'COPY_LOCATION' )
662 const.target = self.obj
663 const.subtarget = subtarget
664 const.head_tail = 1.0
666 elif constraint_type == 'mch_eyes_parent':
668 const = owner_pb.constraints.new( 'COPY_TRANSFORMS' )
669 const.target = self.obj
670 const.subtarget = subtarget
672 elif constraint_type == 'mch_jaw_master':
674 const = owner_pb.constraints.new( 'COPY_TRANSFORMS' )
675 const.target = self.obj
676 const.subtarget = subtarget
677 const.influence = influence
679 elif constraint_type == 'teeth':
681 const = owner_pb.constraints.new( 'COPY_TRANSFORMS' )
682 const.target = self.obj
683 const.subtarget = subtarget
684 const.influence = influence
686 elif constraint_type == 'tweak_copyloc':
688 const = owner_pb.constraints.new( 'COPY_LOCATION' )
689 const.target = self.obj
690 const.subtarget = subtarget
691 const.influence = influence
692 const.use_offset = True
693 const.target_space = 'LOCAL'
694 const.owner_space = 'LOCAL'
696 elif constraint_type == 'tweak_copy_rot_scl':
698 const = owner_pb.constraints.new( 'COPY_ROTATION' )
699 const.target = self.obj
700 const.subtarget = subtarget
701 const.use_offset = True
702 const.target_space = 'LOCAL'
703 const.owner_space = 'LOCAL'
705 const = owner_pb.constraints.new( 'COPY_SCALE' )
706 const.target = self.obj
707 const.subtarget = subtarget
708 const.use_offset = True
709 const.target_space = 'LOCAL'
710 const.owner_space = 'LOCAL'
712 elif constraint_type == 'tweak_copyloc_inv':
714 const = owner_pb.constraints.new( 'COPY_LOCATION' )
715 const.target = self.obj
716 const.subtarget = subtarget
717 const.influence = influence
718 const.target_space = 'LOCAL'
719 const.owner_space = 'LOCAL'
720 const.use_offset = True
721 const.invert_x = True
722 const.invert_y = True
723 const.invert_z = True
725 elif constraint_type == 'mch_tongue_copy_trans':
727 const = owner_pb.constraints.new( 'COPY_TRANSFORMS' )
728 const.target = self.obj
729 const.subtarget = subtarget
730 const.influence = influence
733 def constraints( self, all_bones ):
734 ## Def bone constraints
736 def_context_menu = {
737 # 'bone' : 'target'
738 'DEF-jaw' : 'chin',
739 'DEF-chin.L' : 'lips.L',
740 'DEF-jaw.L.001' : 'chin.L',
741 'DEF-chin.R' : 'lips.R',
742 'DEF-jaw.R.001' : 'chin.R',
743 'DEF-brow.T.L.003' : 'nose',
744 'DEF-ear.L' : None,
745 'DEF-ear.L.003' : 'ear.L.004',
746 'DEF-ear.L.004' : 'ear.L',
747 'DEF-ear.R' : None,
748 'DEF-ear.R.003' : 'ear.R.004',
749 'DEF-ear.R.004' : 'ear.R',
750 'DEF-lip.B.L.001' : 'lips.L',
751 'DEF-lip.B.R.001' : 'lips.R',
752 'DEF-cheek.B.L.001' : 'brow.T.L',
753 'DEF-cheek.B.R.001' : 'brow.T.R',
754 'DEF-lip.T.L.001' : 'lips.L',
755 'DEF-lip.T.R.001' : 'lips.R',
756 'DEF-cheek.T.L.001' : 'nose.L',
757 'DEF-nose.L.001' : 'nose.002',
758 'DEF-cheek.T.R.001' : 'nose.R',
759 'DEF-nose.R.001' : 'nose.002',
760 'DEF-forehead.L' : 'brow.T.L.003',
761 'DEF-forehead.L.001' : 'brow.T.L.002',
762 'DEF-forehead.L.002' : 'brow.T.L.001',
763 'DEF-temple.L' : 'jaw.L',
764 'DEF-brow.T.R.003' : 'nose',
765 'DEF-forehead.R' : 'brow.T.R.003',
766 'DEF-forehead.R.001' : 'brow.T.R.002',
767 'DEF-forehead.R.002' : 'brow.T.R.001',
768 'DEF-temple.R' : 'jaw.R'
771 pattern = r'^DEF-(\w+\.?\w?\.?\w?)(\.?)(\d*?)(\d?)$'
773 for bone in [ bone for bone in all_bones['deform']['all'] if 'lid' not in bone ]:
774 if bone in def_context_menu:
775 if def_context_menu[bone] is not None:
776 self.make_constraits('def_tweak', bone, def_context_menu[bone] )
777 else:
778 matches = re.match( pattern, bone ).groups()
779 if len( matches ) > 1 and matches[-1]:
780 num = int( matches[-1] ) + 1
781 str_list = list( matches )[:-1] + [ str( num ) ]
782 tweak = "".join( str_list )
783 else:
784 tweak = "".join( matches ) + ".001"
785 self.make_constraits('def_tweak', bone, tweak )
787 def_lids = sorted( [ bone for bone in all_bones['deform']['all'] if 'lid' in bone ] )
788 mch_lids = sorted( [ bone for bone in all_bones['mch']['lids'] ] )
790 def_lidsL, def_lidsR = self.symmetrical_split( def_lids )
791 mch_lidsL, mch_lidsR = self.symmetrical_split( mch_lids )
793 # Take the last mch_lid bone and place it at the end
794 mch_lidsL = mch_lidsL[1:] + [ mch_lidsL[0] ]
795 mch_lidsR = mch_lidsR[1:] + [ mch_lidsR[0] ]
797 for boneL, boneR, mchL, mchR in zip( def_lidsL, def_lidsR, mch_lidsL, mch_lidsR ):
798 self.make_constraits('def_lids', boneL, mchL )
799 self.make_constraits('def_lids', boneR, mchR )
801 ## MCH constraints
803 # mch lids constraints
804 for bone in all_bones['mch']['lids']:
805 tweak = bone[4:] # remove "MCH-" from bone name
806 self.make_constraits('mch_eyes', bone, tweak )
808 # mch eyes constraints
809 for bone in [ 'MCH-eye.L', 'MCH-eye.R' ]:
810 ctrl = bone[4:] # remove "MCH-" from bone name
811 self.make_constraits('mch_eyes', bone, ctrl )
813 for bone in [ 'MCH-eye.L.001', 'MCH-eye.R.001' ]:
814 target = bone[:-4] # remove number from the end of the name
815 self.make_constraits('mch_eyes_lids_follow', bone, target )
817 # mch eyes parent constraints
818 self.make_constraits('mch_eyes_parent', 'MCH-eyes_parent', 'ORG-face' )
820 ## Jaw constraints
822 # jaw master mch bones
823 self.make_constraits( 'mch_jaw_master', 'MCH-mouth_lock', 'jaw_master', 0.20 )
824 self.make_constraits( 'mch_jaw_master', 'MCH-jaw_master', 'jaw_master', 1.00 )
825 self.make_constraits( 'mch_jaw_master', 'MCH-jaw_master.001', 'jaw_master', 0.75 )
826 self.make_constraits( 'mch_jaw_master', 'MCH-jaw_master.002', 'jaw_master', 0.35 )
827 self.make_constraits( 'mch_jaw_master', 'MCH-jaw_master.003', 'jaw_master', 0.10 )
828 self.make_constraits( 'mch_jaw_master', 'MCH-jaw_master.004', 'jaw_master', 0.025 )
830 self.make_constraits( 'teeth', 'ORG-teeth.T', 'teeth.T', 1.00 )
831 self.make_constraits( 'teeth', 'ORG-teeth.B', 'teeth.B', 1.00 )
833 for bone in all_bones['mch']['jaw'][1:-1]:
834 self.make_constraits( 'mch_jaw_master', bone, 'MCH-mouth_lock' )
836 ## Tweak bones constraints
838 # copy location constraints for tweak bones of both sides
839 tweak_copyloc_L = {
840 'brow.T.L.002' : [ [ 'brow.T.L.001', 'brow.T.L.003' ], [ 0.5, 0.5 ] ],
841 'ear.L.003' : [ [ 'ear.L.004', 'ear.L.002' ], [ 0.5, 0.5 ] ],
842 'brow.B.L.001' : [ [ 'brow.B.L.002' ], [ 0.6 ] ],
843 'brow.B.L.003' : [ [ 'brow.B.L.002' ], [ 0.6 ] ],
844 'brow.B.L.002' : [ [ 'lid.T.L.001', ], [ 0.25 ] ],
845 'brow.B.L.002' : [ [ 'brow.T.L.002', ], [ 0.25 ] ],
846 'lid.T.L.001' : [ [ 'lid.T.L.002' ], [ 0.6 ] ],
847 'lid.T.L.003' : [ [ 'lid.T.L.002', ], [ 0.6 ] ],
848 'lid.T.L.002' : [ [ 'MCH-eye.L.001', ], [ 0.5 ] ],
849 'lid.B.L.001' : [ [ 'lid.B.L.002', ], [ 0.6 ] ],
850 'lid.B.L.003' : [ [ 'lid.B.L.002', ], [ 0.6 ] ],
851 'lid.B.L.002' : [ [ 'MCH-eye.L.001', 'cheek.T.L.001' ], [ 0.5, 0.1 ] ],
852 'cheek.T.L.001' : [ [ 'cheek.B.L.001', ], [ 0.5 ] ],
853 'nose.L' : [ [ 'nose.L.001', ], [ 0.25 ] ],
854 'nose.L.001' : [ [ 'lip.T.L.001', ], [ 0.2 ] ],
855 'cheek.B.L.001' : [ [ 'lips.L', ], [ 0.5 ] ],
856 'lip.T.L.001' : [ [ 'lips.L', 'lip.T' ], [ 0.25, 0.5 ] ],
857 'lip.B.L.001' : [ [ 'lips.L', 'lip.B' ], [ 0.25, 0.5 ] ]
860 for owner in list( tweak_copyloc_L.keys() ):
862 targets, influences = tweak_copyloc_L[owner]
863 for target, influence in zip( targets, influences ):
865 # Left side constraints
866 self.make_constraits( 'tweak_copyloc', owner, target, influence )
868 # create constraints for the right side too
869 ownerR = owner.replace( '.L', '.R' )
870 targetR = target.replace( '.L', '.R' )
871 self.make_constraits( 'tweak_copyloc', ownerR, targetR, influence )
873 # copy rotation & scale constraints for tweak bones of both sides
874 tweak_copy_rot_scl_L = {
875 'lip.T.L.001' : 'lip.T',
876 'lip.B.L.001' : 'lip.B'
879 for owner in list( tweak_copy_rot_scl_L.keys() ):
880 target = tweak_copy_rot_scl_L[owner]
881 influence = tweak_copy_rot_scl_L[owner]
882 self.make_constraits( 'tweak_copy_rot_scl', owner, target )
884 # create constraints for the right side too
885 owner = owner.replace( '.L', '.R' )
886 self.make_constraits( 'tweak_copy_rot_scl', owner, target )
888 # inverted tweak bones constraints
889 tweak_nose = {
890 'nose.001' : [ 'nose.002', 0.35 ],
891 'nose.003' : [ 'nose.002', 0.5 ],
892 'nose.005' : [ 'lip.T', 0.5 ],
893 'chin.002' : [ 'lip.B', 0.5 ]
896 for owner in list( tweak_nose.keys() ):
897 target = tweak_nose[owner][0]
898 influence = tweak_nose[owner][1]
899 self.make_constraits( 'tweak_copyloc_inv', owner, target, influence )
901 # MCH tongue constraints
902 divider = len( all_bones['mch']['tongue'] ) + 1
903 factor = len( all_bones['mch']['tongue'] )
905 for owner in all_bones['mch']['tongue']:
906 self.make_constraits( 'mch_tongue_copy_trans', owner, 'tongue_master', ( 1 / divider ) * factor )
907 factor -= 1
910 def drivers_and_props( self, all_bones ):
912 bpy.ops.object.mode_set(mode ='OBJECT')
913 pb = self.obj.pose.bones
915 jaw_ctrl = all_bones['ctrls']['jaw'][0]
916 eyes_ctrl = all_bones['ctrls']['eyes'][2]
918 jaw_prop = 'mouth_lock'
919 eyes_prop = 'eyes_follow'
921 for bone, prop_name in zip( [ jaw_ctrl, eyes_ctrl ], [ jaw_prop, eyes_prop ] ):
922 if bone == jaw_ctrl:
923 pb[ bone ][ prop_name ] = 0.0
924 else:
925 pb[ bone ][ prop_name ] = 1.0
927 prop = rna_idprop_ui_prop_get( pb[ bone ], prop_name )
928 prop["min"] = 0.0
929 prop["max"] = 1.0
930 prop["soft_min"] = 0.0
931 prop["soft_max"] = 1.0
932 prop["description"] = prop_name
934 # Jaw drivers
935 mch_jaws = all_bones['mch']['jaw'][1:-1]
937 for bone in mch_jaws:
938 drv = pb[ bone ].constraints[1].driver_add("influence").driver
939 drv.type='SUM'
941 var = drv.variables.new()
942 var.name = jaw_prop
943 var.type = "SINGLE_PROP"
944 var.targets[0].id = self.obj
945 var.targets[0].data_path = pb[ jaw_ctrl ].path_from_id() + '['+ '"' + jaw_prop + '"' + ']'
948 # Eyes driver
949 mch_eyes_parent = all_bones['mch']['eyes_parent'][0]
951 drv = pb[ mch_eyes_parent ].constraints[0].driver_add("influence").driver
952 drv.type='SUM'
954 var = drv.variables.new()
955 var.name = eyes_prop
956 var.type = "SINGLE_PROP"
957 var.targets[0].id = self.obj
958 var.targets[0].data_path = pb[ eyes_ctrl ].path_from_id() + '['+ '"' + eyes_prop + '"' + ']'
960 return jaw_prop, eyes_prop
962 def create_bones(self):
963 org_bones = self.org_bones
964 bpy.ops.object.mode_set(mode ='EDIT')
965 eb = self.obj.data.edit_bones
967 # Clear parents for org bones
968 for bone in [ bone for bone in org_bones if 'face' not in bone ]:
969 eb[bone].use_connect = False
970 eb[bone].parent = None
972 all_bones = {}
974 def_names = self.create_deformation()
975 ctrls, tweak_unique = self.all_controls()
976 mchs = self.create_mch(
977 ctrls['ctrls']['jaw'][0],
978 ctrls['ctrls']['tongue'][0]
980 return {
981 'deform' : def_names,
982 'ctrls' : ctrls['ctrls'],
983 'tweaks' : ctrls['tweaks'],
984 'mch' : mchs
985 }, tweak_unique
988 def generate(self):
990 all_bones, tweak_unique = self.create_bones()
991 self.parent_bones( all_bones, tweak_unique )
992 self.constraints( all_bones )
993 jaw_prop, eyes_prop = self.drivers_and_props( all_bones )
996 # Create UI
997 all_controls = []
998 all_controls += [ bone for bone in [ bgroup for bgroup in [ all_bones['ctrls'][group] for group in list( all_bones['ctrls'].keys() ) ] ] ]
999 all_controls += [ bone for bone in [ bgroup for bgroup in [ all_bones['tweaks'][group] for group in list( all_bones['tweaks'].keys() ) ] ] ]
1001 all_ctrls = []
1002 for group in all_controls:
1003 for bone in group:
1004 all_ctrls.append( bone )
1006 controls_string = ", ".join(["'" + x + "'" for x in all_ctrls])
1007 return [ script % (
1008 controls_string,
1009 all_bones['ctrls']['jaw'][0],
1010 all_bones['ctrls']['eyes'][2],
1011 jaw_prop,
1012 eyes_prop )
1016 def add_parameters(params):
1017 """ Add the parameters of this rig type to the
1018 RigifyParameters PropertyGroup
1021 #Setting up extra layers for the tweak bones
1022 params.primary_layers_extra = bpy.props.BoolProperty(
1023 name = "primary_layers_extra",
1024 default = True,
1025 description = ""
1027 params.primary_layers = bpy.props.BoolVectorProperty(
1028 size = 32,
1029 description = "Layers for the 1st tweak controls to be on",
1030 default = tuple( [ i == 1 for i in range(0, 32) ] )
1032 params.secondary_layers_extra = bpy.props.BoolProperty(
1033 name = "secondary_layers_extra",
1034 default = True,
1035 description = ""
1037 params.secondary_layers = bpy.props.BoolVectorProperty(
1038 size = 32,
1039 description = "Layers for the 2nd tweak controls to be on",
1040 default = tuple( [ i == 1 for i in range(0, 32) ] )
1044 def parameters_ui(layout, params):
1045 """ Create the ui for the rig parameters."""
1046 layers = ["primary_layers", "secondary_layers"]
1048 for layer in layers:
1049 r = layout.row()
1050 r.prop( params, layer + "_extra" )
1051 r.active = getattr( params, layer + "_extra" )
1053 col = r.column(align=True)
1054 row = col.row(align=True)
1055 for i in range(8):
1056 row.prop(params, layer, index=i, toggle=True, text="")
1058 row = col.row(align=True)
1059 for i in range(16,24):
1060 row.prop(params, layer, index=i, toggle=True, text="")
1062 col = r.column(align=True)
1063 row = col.row(align=True)
1065 for i in range(8,16):
1066 row.prop(params, layer, index=i, toggle=True, text="")
1068 row = col.row(align=True)
1069 for i in range(24,32):
1070 row.prop(params, layer, index=i, toggle=True, text="")
1073 def create_sample(obj):
1074 # generated by rigify.utils.write_metarig
1075 bpy.ops.object.mode_set(mode='EDIT')
1076 arm = obj.data
1078 bones = {}
1080 bone = arm.edit_bones.new('face')
1081 bone.head[:] = -0.0000, -0.0013, 0.0437
1082 bone.tail[:] = -0.0000, -0.0013, 0.1048
1083 bone.roll = 0.0000
1084 bone.use_connect = False
1085 bones['face'] = bone.name
1086 bone = arm.edit_bones.new('nose')
1087 bone.head[:] = 0.0000, -0.0905, 0.1125
1088 bone.tail[:] = 0.0000, -0.1105, 0.0864
1089 bone.roll = 0.0000
1090 bone.use_connect = False
1091 bone.parent = arm.edit_bones[bones['face']]
1092 bones['nose'] = bone.name
1093 bone = arm.edit_bones.new('lip.T.L')
1094 bone.head[:] = 0.0000, -0.1022, 0.0563
1095 bone.tail[:] = 0.0131, -0.0986, 0.0567
1096 bone.roll = 0.0000
1097 bone.use_connect = False
1098 bone.parent = arm.edit_bones[bones['face']]
1099 bones['lip.T.L'] = bone.name
1100 bone = arm.edit_bones.new('lip.B.L')
1101 bone.head[:] = 0.0000, -0.0993, 0.0455
1102 bone.tail[:] = 0.0124, -0.0938, 0.0488
1103 bone.roll = -0.0789
1104 bone.use_connect = False
1105 bone.parent = arm.edit_bones[bones['face']]
1106 bones['lip.B.L'] = bone.name
1107 bone = arm.edit_bones.new('jaw')
1108 bone.head[:] = 0.0000, -0.0389, 0.0222
1109 bone.tail[:] = 0.0000, -0.0923, 0.0044
1110 bone.roll = 0.0000
1111 bone.use_connect = False
1112 bone.parent = arm.edit_bones[bones['face']]
1113 bones['jaw'] = bone.name
1114 bone = arm.edit_bones.new('ear.L')
1115 bone.head[:] = 0.0616, -0.0083, 0.0886
1116 bone.tail[:] = 0.0663, -0.0101, 0.1151
1117 bone.roll = -0.0324
1118 bone.use_connect = False
1119 bone.parent = arm.edit_bones[bones['face']]
1120 bones['ear.L'] = bone.name
1121 bone = arm.edit_bones.new('ear.R')
1122 bone.head[:] = -0.0616, -0.0083, 0.0886
1123 bone.tail[:] = -0.0663, -0.0101, 0.1151
1124 bone.roll = 0.0324
1125 bone.use_connect = False
1126 bone.parent = arm.edit_bones[bones['face']]
1127 bones['ear.R'] = bone.name
1128 bone = arm.edit_bones.new('lip.T.R')
1129 bone.head[:] = -0.0000, -0.1022, 0.0563
1130 bone.tail[:] = -0.0131, -0.0986, 0.0567
1131 bone.roll = -0.0000
1132 bone.use_connect = False
1133 bone.parent = arm.edit_bones[bones['face']]
1134 bones['lip.T.R'] = bone.name
1135 bone = arm.edit_bones.new('lip.B.R')
1136 bone.head[:] = -0.0000, -0.0993, 0.0455
1137 bone.tail[:] = -0.0124, -0.0938, 0.0488
1138 bone.roll = 0.0789
1139 bone.use_connect = False
1140 bone.parent = arm.edit_bones[bones['face']]
1141 bones['lip.B.R'] = bone.name
1142 bone = arm.edit_bones.new('brow.B.L')
1143 bone.head[:] = 0.0530, -0.0705, 0.1153
1144 bone.tail[:] = 0.0472, -0.0780, 0.1192
1145 bone.roll = 0.0412
1146 bone.use_connect = False
1147 bone.parent = arm.edit_bones[bones['face']]
1148 bones['brow.B.L'] = bone.name
1149 bone = arm.edit_bones.new('lid.T.L')
1150 bone.head[:] = 0.0515, -0.0692, 0.1104
1151 bone.tail[:] = 0.0474, -0.0785, 0.1136
1152 bone.roll = 0.1166
1153 bone.use_connect = False
1154 bone.parent = arm.edit_bones[bones['face']]
1155 bones['lid.T.L'] = bone.name
1156 bone = arm.edit_bones.new('brow.B.R')
1157 bone.head[:] = -0.0530, -0.0705, 0.1153
1158 bone.tail[:] = -0.0472, -0.0780, 0.1192
1159 bone.roll = -0.0412
1160 bone.use_connect = False
1161 bone.parent = arm.edit_bones[bones['face']]
1162 bones['brow.B.R'] = bone.name
1163 bone = arm.edit_bones.new('lid.T.R')
1164 bone.head[:] = -0.0515, -0.0692, 0.1104
1165 bone.tail[:] = -0.0474, -0.0785, 0.1136
1166 bone.roll = -0.1166
1167 bone.use_connect = False
1168 bone.parent = arm.edit_bones[bones['face']]
1169 bones['lid.T.R'] = bone.name
1170 bone = arm.edit_bones.new('forehead.L')
1171 bone.head[:] = 0.0113, -0.0764, 0.1611
1172 bone.tail[:] = 0.0144, -0.0912, 0.1236
1173 bone.roll = 1.4313
1174 bone.use_connect = False
1175 bone.parent = arm.edit_bones[bones['face']]
1176 bones['forehead.L'] = bone.name
1177 bone = arm.edit_bones.new('forehead.R')
1178 bone.head[:] = -0.0113, -0.0764, 0.1611
1179 bone.tail[:] = -0.0144, -0.0912, 0.1236
1180 bone.roll = -1.4313
1181 bone.use_connect = False
1182 bone.parent = arm.edit_bones[bones['face']]
1183 bones['forehead.R'] = bone.name
1184 bone = arm.edit_bones.new('eye.L')
1185 bone.head[:] = 0.0360, -0.0686, 0.1107
1186 bone.tail[:] = 0.0360, -0.0848, 0.1107
1187 bone.roll = 0.0000
1188 bone.use_connect = False
1189 bone.parent = arm.edit_bones[bones['face']]
1190 bones['eye.L'] = bone.name
1191 bone = arm.edit_bones.new('eye.R')
1192 bone.head[:] = -0.0360, -0.0686, 0.1107
1193 bone.tail[:] = -0.0360, -0.0848, 0.1107
1194 bone.roll = -0.0000
1195 bone.use_connect = False
1196 bone.parent = arm.edit_bones[bones['face']]
1197 bones['eye.R'] = bone.name
1198 bone = arm.edit_bones.new('cheek.T.L')
1199 bone.head[:] = 0.0568, -0.0506, 0.1052
1200 bone.tail[:] = 0.0379, -0.0834, 0.0816
1201 bone.roll = -0.0096
1202 bone.use_connect = False
1203 bone.parent = arm.edit_bones[bones['face']]
1204 bones['cheek.T.L'] = bone.name
1205 bone = arm.edit_bones.new('cheek.T.R')
1206 bone.head[:] = -0.0568, -0.0506, 0.1052
1207 bone.tail[:] = -0.0379, -0.0834, 0.0816
1208 bone.roll = 0.0096
1209 bone.use_connect = False
1210 bone.parent = arm.edit_bones[bones['face']]
1211 bones['cheek.T.R'] = bone.name
1212 bone = arm.edit_bones.new('teeth.T')
1213 bone.head[:] = 0.0000, -0.0927, 0.0613
1214 bone.tail[:] = 0.0000, -0.0621, 0.0613
1215 bone.roll = 0.0000
1216 bone.use_connect = False
1217 bone.parent = arm.edit_bones[bones['face']]
1218 bones['teeth.T'] = bone.name
1219 bone = arm.edit_bones.new('teeth.B')
1220 bone.head[:] = 0.0000, -0.0881, 0.0397
1221 bone.tail[:] = 0.0000, -0.0575, 0.0397
1222 bone.roll = 0.0000
1223 bone.use_connect = False
1224 bone.parent = arm.edit_bones[bones['face']]
1225 bones['teeth.B'] = bone.name
1226 bone = arm.edit_bones.new('tongue')
1227 bone.head[:] = 0.0000, -0.0781, 0.0493
1228 bone.tail[:] = 0.0000, -0.0620, 0.0567
1229 bone.roll = 0.0000
1230 bone.use_connect = False
1231 bone.parent = arm.edit_bones[bones['face']]
1232 bones['tongue'] = bone.name
1233 bone = arm.edit_bones.new('nose.001')
1234 bone.head[:] = 0.0000, -0.1105, 0.0864
1235 bone.tail[:] = 0.0000, -0.1193, 0.0771
1236 bone.roll = 0.0000
1237 bone.use_connect = True
1238 bone.parent = arm.edit_bones[bones['nose']]
1239 bones['nose.001'] = bone.name
1240 bone = arm.edit_bones.new('lip.T.L.001')
1241 bone.head[:] = 0.0131, -0.0986, 0.0567
1242 bone.tail[:] = 0.0236, -0.0877, 0.0519
1243 bone.roll = 0.0236
1244 bone.use_connect = True
1245 bone.parent = arm.edit_bones[bones['lip.T.L']]
1246 bones['lip.T.L.001'] = bone.name
1247 bone = arm.edit_bones.new('lip.B.L.001')
1248 bone.head[:] = 0.0124, -0.0938, 0.0488
1249 bone.tail[:] = 0.0236, -0.0877, 0.0519
1250 bone.roll = 0.0731
1251 bone.use_connect = True
1252 bone.parent = arm.edit_bones[bones['lip.B.L']]
1253 bones['lip.B.L.001'] = bone.name
1254 bone = arm.edit_bones.new('chin')
1255 bone.head[:] = 0.0000, -0.0923, 0.0044
1256 bone.tail[:] = 0.0000, -0.0921, 0.0158
1257 bone.roll = 0.0000
1258 bone.use_connect = True
1259 bone.parent = arm.edit_bones[bones['jaw']]
1260 bones['chin'] = bone.name
1261 bone = arm.edit_bones.new('ear.L.001')
1262 bone.head[:] = 0.0663, -0.0101, 0.1151
1263 bone.tail[:] = 0.0804, 0.0065, 0.1189
1264 bone.roll = 0.0656
1265 bone.use_connect = True
1266 bone.parent = arm.edit_bones[bones['ear.L']]
1267 bones['ear.L.001'] = bone.name
1268 bone = arm.edit_bones.new('ear.R.001')
1269 bone.head[:] = -0.0663, -0.0101, 0.1151
1270 bone.tail[:] = -0.0804, 0.0065, 0.1189
1271 bone.roll = -0.0656
1272 bone.use_connect = True
1273 bone.parent = arm.edit_bones[bones['ear.R']]
1274 bones['ear.R.001'] = bone.name
1275 bone = arm.edit_bones.new('lip.T.R.001')
1276 bone.head[:] = -0.0131, -0.0986, 0.0567
1277 bone.tail[:] = -0.0236, -0.0877, 0.0519
1278 bone.roll = -0.0236
1279 bone.use_connect = True
1280 bone.parent = arm.edit_bones[bones['lip.T.R']]
1281 bones['lip.T.R.001'] = bone.name
1282 bone = arm.edit_bones.new('lip.B.R.001')
1283 bone.head[:] = -0.0124, -0.0938, 0.0488
1284 bone.tail[:] = -0.0236, -0.0877, 0.0519
1285 bone.roll = -0.0731
1286 bone.use_connect = True
1287 bone.parent = arm.edit_bones[bones['lip.B.R']]
1288 bones['lip.B.R.001'] = bone.name
1289 bone = arm.edit_bones.new('brow.B.L.001')
1290 bone.head[:] = 0.0472, -0.0780, 0.1192
1291 bone.tail[:] = 0.0387, -0.0832, 0.1202
1292 bone.roll = 0.0192
1293 bone.use_connect = True
1294 bone.parent = arm.edit_bones[bones['brow.B.L']]
1295 bones['brow.B.L.001'] = bone.name
1296 bone = arm.edit_bones.new('lid.T.L.001')
1297 bone.head[:] = 0.0474, -0.0785, 0.1136
1298 bone.tail[:] = 0.0394, -0.0838, 0.1147
1299 bone.roll = 0.0791
1300 bone.use_connect = True
1301 bone.parent = arm.edit_bones[bones['lid.T.L']]
1302 bones['lid.T.L.001'] = bone.name
1303 bone = arm.edit_bones.new('brow.B.R.001')
1304 bone.head[:] = -0.0472, -0.0780, 0.1192
1305 bone.tail[:] = -0.0387, -0.0832, 0.1202
1306 bone.roll = -0.0192
1307 bone.use_connect = True
1308 bone.parent = arm.edit_bones[bones['brow.B.R']]
1309 bones['brow.B.R.001'] = bone.name
1310 bone = arm.edit_bones.new('lid.T.R.001')
1311 bone.head[:] = -0.0474, -0.0785, 0.1136
1312 bone.tail[:] = -0.0394, -0.0838, 0.1147
1313 bone.roll = -0.0791
1314 bone.use_connect = True
1315 bone.parent = arm.edit_bones[bones['lid.T.R']]
1316 bones['lid.T.R.001'] = bone.name
1317 bone = arm.edit_bones.new('forehead.L.001')
1318 bone.head[:] = 0.0321, -0.0663, 0.1646
1319 bone.tail[:] = 0.0394, -0.0828, 0.1310
1320 bone.roll = 0.9928
1321 bone.use_connect = False
1322 bone.parent = arm.edit_bones[bones['forehead.L']]
1323 bones['forehead.L.001'] = bone.name
1324 bone = arm.edit_bones.new('forehead.R.001')
1325 bone.head[:] = -0.0321, -0.0663, 0.1646
1326 bone.tail[:] = -0.0394, -0.0828, 0.1310
1327 bone.roll = -0.9928
1328 bone.use_connect = False
1329 bone.parent = arm.edit_bones[bones['forehead.R']]
1330 bones['forehead.R.001'] = bone.name
1331 bone = arm.edit_bones.new('cheek.T.L.001')
1332 bone.head[:] = 0.0379, -0.0834, 0.0816
1333 bone.tail[:] = 0.0093, -0.0846, 0.1002
1334 bone.roll = 0.0320
1335 bone.use_connect = True
1336 bone.parent = arm.edit_bones[bones['cheek.T.L']]
1337 bones['cheek.T.L.001'] = bone.name
1338 bone = arm.edit_bones.new('cheek.T.R.001')
1339 bone.head[:] = -0.0379, -0.0834, 0.0816
1340 bone.tail[:] = -0.0093, -0.0846, 0.1002
1341 bone.roll = -0.0320
1342 bone.use_connect = True
1343 bone.parent = arm.edit_bones[bones['cheek.T.R']]
1344 bones['cheek.T.R.001'] = bone.name
1345 bone = arm.edit_bones.new('tongue.001')
1346 bone.head[:] = 0.0000, -0.0620, 0.0567
1347 bone.tail[:] = 0.0000, -0.0406, 0.0584
1348 bone.roll = 0.0000
1349 bone.use_connect = True
1350 bone.parent = arm.edit_bones[bones['tongue']]
1351 bones['tongue.001'] = bone.name
1352 bone = arm.edit_bones.new('nose.002')
1353 bone.head[:] = 0.0000, -0.1193, 0.0771
1354 bone.tail[:] = 0.0000, -0.1118, 0.0739
1355 bone.roll = 0.0000
1356 bone.use_connect = True
1357 bone.parent = arm.edit_bones[bones['nose.001']]
1358 bones['nose.002'] = bone.name
1359 bone = arm.edit_bones.new('chin.001')
1360 bone.head[:] = 0.0000, -0.0921, 0.0158
1361 bone.tail[:] = 0.0000, -0.0914, 0.0404
1362 bone.roll = 0.0000
1363 bone.use_connect = True
1364 bone.parent = arm.edit_bones[bones['chin']]
1365 bones['chin.001'] = bone.name
1366 bone = arm.edit_bones.new('ear.L.002')
1367 bone.head[:] = 0.0804, 0.0065, 0.1189
1368 bone.tail[:] = 0.0808, 0.0056, 0.0935
1369 bone.roll = -0.0265
1370 bone.use_connect = True
1371 bone.parent = arm.edit_bones[bones['ear.L.001']]
1372 bones['ear.L.002'] = bone.name
1373 bone = arm.edit_bones.new('ear.R.002')
1374 bone.head[:] = -0.0804, 0.0065, 0.1189
1375 bone.tail[:] = -0.0808, 0.0056, 0.0935
1376 bone.roll = 0.0265
1377 bone.use_connect = True
1378 bone.parent = arm.edit_bones[bones['ear.R.001']]
1379 bones['ear.R.002'] = bone.name
1380 bone = arm.edit_bones.new('brow.B.L.002')
1381 bone.head[:] = 0.0387, -0.0832, 0.1202
1382 bone.tail[:] = 0.0295, -0.0826, 0.1179
1383 bone.roll = -0.0278
1384 bone.use_connect = True
1385 bone.parent = arm.edit_bones[bones['brow.B.L.001']]
1386 bones['brow.B.L.002'] = bone.name
1387 bone = arm.edit_bones.new('lid.T.L.002')
1388 bone.head[:] = 0.0394, -0.0838, 0.1147
1389 bone.tail[:] = 0.0317, -0.0832, 0.1131
1390 bone.roll = -0.0356
1391 bone.use_connect = True
1392 bone.parent = arm.edit_bones[bones['lid.T.L.001']]
1393 bones['lid.T.L.002'] = bone.name
1394 bone = arm.edit_bones.new('brow.B.R.002')
1395 bone.head[:] = -0.0387, -0.0832, 0.1202
1396 bone.tail[:] = -0.0295, -0.0826, 0.1179
1397 bone.roll = 0.0278
1398 bone.use_connect = True
1399 bone.parent = arm.edit_bones[bones['brow.B.R.001']]
1400 bones['brow.B.R.002'] = bone.name
1401 bone = arm.edit_bones.new('lid.T.R.002')
1402 bone.head[:] = -0.0394, -0.0838, 0.1147
1403 bone.tail[:] = -0.0317, -0.0832, 0.1131
1404 bone.roll = 0.0356
1405 bone.use_connect = True
1406 bone.parent = arm.edit_bones[bones['lid.T.R.001']]
1407 bones['lid.T.R.002'] = bone.name
1408 bone = arm.edit_bones.new('forehead.L.002')
1409 bone.head[:] = 0.0482, -0.0506, 0.1620
1410 bone.tail[:] = 0.0556, -0.0689, 0.1249
1411 bone.roll = 0.4509
1412 bone.use_connect = False
1413 bone.parent = arm.edit_bones[bones['forehead.L.001']]
1414 bones['forehead.L.002'] = bone.name
1415 bone = arm.edit_bones.new('forehead.R.002')
1416 bone.head[:] = -0.0482, -0.0506, 0.1620
1417 bone.tail[:] = -0.0556, -0.0689, 0.1249
1418 bone.roll = -0.4509
1419 bone.use_connect = False
1420 bone.parent = arm.edit_bones[bones['forehead.R.001']]
1421 bones['forehead.R.002'] = bone.name
1422 bone = arm.edit_bones.new('nose.L')
1423 bone.head[:] = 0.0093, -0.0846, 0.1002
1424 bone.tail[:] = 0.0118, -0.0966, 0.0757
1425 bone.roll = -0.0909
1426 bone.use_connect = True
1427 bone.parent = arm.edit_bones[bones['cheek.T.L.001']]
1428 bones['nose.L'] = bone.name
1429 bone = arm.edit_bones.new('nose.R')
1430 bone.head[:] = -0.0093, -0.0846, 0.1002
1431 bone.tail[:] = -0.0118, -0.0966, 0.0757
1432 bone.roll = 0.0909
1433 bone.use_connect = True
1434 bone.parent = arm.edit_bones[bones['cheek.T.R.001']]
1435 bones['nose.R'] = bone.name
1436 bone = arm.edit_bones.new('tongue.002')
1437 bone.head[:] = 0.0000, -0.0406, 0.0584
1438 bone.tail[:] = 0.0000, -0.0178, 0.0464
1439 bone.roll = 0.0000
1440 bone.use_connect = True
1441 bone.parent = arm.edit_bones[bones['tongue.001']]
1442 bones['tongue.002'] = bone.name
1443 bone = arm.edit_bones.new('nose.003')
1444 bone.head[:] = 0.0000, -0.1118, 0.0739
1445 bone.tail[:] = 0.0000, -0.1019, 0.0733
1446 bone.roll = 0.0000
1447 bone.use_connect = True
1448 bone.parent = arm.edit_bones[bones['nose.002']]
1449 bones['nose.003'] = bone.name
1450 bone = arm.edit_bones.new('ear.L.003')
1451 bone.head[:] = 0.0808, 0.0056, 0.0935
1452 bone.tail[:] = 0.0677, -0.0109, 0.0752
1453 bone.roll = 0.3033
1454 bone.use_connect = True
1455 bone.parent = arm.edit_bones[bones['ear.L.002']]
1456 bones['ear.L.003'] = bone.name
1457 bone = arm.edit_bones.new('ear.R.003')
1458 bone.head[:] = -0.0808, 0.0056, 0.0935
1459 bone.tail[:] = -0.0677, -0.0109, 0.0752
1460 bone.roll = -0.3033
1461 bone.use_connect = True
1462 bone.parent = arm.edit_bones[bones['ear.R.002']]
1463 bones['ear.R.003'] = bone.name
1464 bone = arm.edit_bones.new('brow.B.L.003')
1465 bone.head[:] = 0.0295, -0.0826, 0.1179
1466 bone.tail[:] = 0.0201, -0.0812, 0.1095
1467 bone.roll = 0.0417
1468 bone.use_connect = True
1469 bone.parent = arm.edit_bones[bones['brow.B.L.002']]
1470 bones['brow.B.L.003'] = bone.name
1471 bone = arm.edit_bones.new('lid.T.L.003')
1472 bone.head[:] = 0.0317, -0.0832, 0.1131
1473 bone.tail[:] = 0.0237, -0.0826, 0.1058
1474 bone.roll = 0.0245
1475 bone.use_connect = True
1476 bone.parent = arm.edit_bones[bones['lid.T.L.002']]
1477 bones['lid.T.L.003'] = bone.name
1478 bone = arm.edit_bones.new('brow.B.R.003')
1479 bone.head[:] = -0.0295, -0.0826, 0.1179
1480 bone.tail[:] = -0.0201, -0.0812, 0.1095
1481 bone.roll = -0.0417
1482 bone.use_connect = True
1483 bone.parent = arm.edit_bones[bones['brow.B.R.002']]
1484 bones['brow.B.R.003'] = bone.name
1485 bone = arm.edit_bones.new('lid.T.R.003')
1486 bone.head[:] = -0.0317, -0.0832, 0.1131
1487 bone.tail[:] = -0.0237, -0.0826, 0.1058
1488 bone.roll = -0.0245
1489 bone.use_connect = True
1490 bone.parent = arm.edit_bones[bones['lid.T.R.002']]
1491 bones['lid.T.R.003'] = bone.name
1492 bone = arm.edit_bones.new('temple.L')
1493 bone.head[:] = 0.0585, -0.0276, 0.1490
1494 bone.tail[:] = 0.0607, -0.0295, 0.0962
1495 bone.roll = -0.0650
1496 bone.use_connect = False
1497 bone.parent = arm.edit_bones[bones['forehead.L.002']]
1498 bones['temple.L'] = bone.name
1499 bone = arm.edit_bones.new('temple.R')
1500 bone.head[:] = -0.0585, -0.0276, 0.1490
1501 bone.tail[:] = -0.0607, -0.0295, 0.0962
1502 bone.roll = 0.0650
1503 bone.use_connect = False
1504 bone.parent = arm.edit_bones[bones['forehead.R.002']]
1505 bones['temple.R'] = bone.name
1506 bone = arm.edit_bones.new('nose.L.001')
1507 bone.head[:] = 0.0118, -0.0966, 0.0757
1508 bone.tail[:] = 0.0000, -0.1193, 0.0771
1509 bone.roll = 0.1070
1510 bone.use_connect = True
1511 bone.parent = arm.edit_bones[bones['nose.L']]
1512 bones['nose.L.001'] = bone.name
1513 bone = arm.edit_bones.new('nose.R.001')
1514 bone.head[:] = -0.0118, -0.0966, 0.0757
1515 bone.tail[:] = -0.0000, -0.1193, 0.0771
1516 bone.roll = -0.1070
1517 bone.use_connect = True
1518 bone.parent = arm.edit_bones[bones['nose.R']]
1519 bones['nose.R.001'] = bone.name
1520 bone = arm.edit_bones.new('nose.004')
1521 bone.head[:] = 0.0000, -0.1019, 0.0733
1522 bone.tail[:] = 0.0000, -0.1014, 0.0633
1523 bone.roll = 0.0000
1524 bone.use_connect = True
1525 bone.parent = arm.edit_bones[bones['nose.003']]
1526 bones['nose.004'] = bone.name
1527 bone = arm.edit_bones.new('ear.L.004')
1528 bone.head[:] = 0.0677, -0.0109, 0.0752
1529 bone.tail[:] = 0.0616, -0.0083, 0.0886
1530 bone.roll = 0.1518
1531 bone.use_connect = True
1532 bone.parent = arm.edit_bones[bones['ear.L.003']]
1533 bones['ear.L.004'] = bone.name
1534 bone = arm.edit_bones.new('ear.R.004')
1535 bone.head[:] = -0.0677, -0.0109, 0.0752
1536 bone.tail[:] = -0.0616, -0.0083, 0.0886
1537 bone.roll = -0.1518
1538 bone.use_connect = True
1539 bone.parent = arm.edit_bones[bones['ear.R.003']]
1540 bones['ear.R.004'] = bone.name
1541 bone = arm.edit_bones.new('lid.B.L')
1542 bone.head[:] = 0.0237, -0.0826, 0.1058
1543 bone.tail[:] = 0.0319, -0.0831, 0.1050
1544 bone.roll = -0.1108
1545 bone.use_connect = True
1546 bone.parent = arm.edit_bones[bones['lid.T.L.003']]
1547 bones['lid.B.L'] = bone.name
1548 bone = arm.edit_bones.new('lid.B.R')
1549 bone.head[:] = -0.0237, -0.0826, 0.1058
1550 bone.tail[:] = -0.0319, -0.0831, 0.1050
1551 bone.roll = 0.1108
1552 bone.use_connect = True
1553 bone.parent = arm.edit_bones[bones['lid.T.R.003']]
1554 bones['lid.B.R'] = bone.name
1555 bone = arm.edit_bones.new('jaw.L')
1556 bone.head[:] = 0.0607, -0.0295, 0.0962
1557 bone.tail[:] = 0.0451, -0.0338, 0.0533
1558 bone.roll = 0.0871
1559 bone.use_connect = True
1560 bone.parent = arm.edit_bones[bones['temple.L']]
1561 bones['jaw.L'] = bone.name
1562 bone = arm.edit_bones.new('jaw.R')
1563 bone.head[:] = -0.0607, -0.0295, 0.0962
1564 bone.tail[:] = -0.0451, -0.0338, 0.0533
1565 bone.roll = -0.0871
1566 bone.use_connect = True
1567 bone.parent = arm.edit_bones[bones['temple.R']]
1568 bones['jaw.R'] = bone.name
1569 bone = arm.edit_bones.new('lid.B.L.001')
1570 bone.head[:] = 0.0319, -0.0831, 0.1050
1571 bone.tail[:] = 0.0389, -0.0826, 0.1050
1572 bone.roll = -0.0207
1573 bone.use_connect = True
1574 bone.parent = arm.edit_bones[bones['lid.B.L']]
1575 bones['lid.B.L.001'] = bone.name
1576 bone = arm.edit_bones.new('lid.B.R.001')
1577 bone.head[:] = -0.0319, -0.0831, 0.1050
1578 bone.tail[:] = -0.0389, -0.0826, 0.1050
1579 bone.roll = 0.0207
1580 bone.use_connect = True
1581 bone.parent = arm.edit_bones[bones['lid.B.R']]
1582 bones['lid.B.R.001'] = bone.name
1583 bone = arm.edit_bones.new('jaw.L.001')
1584 bone.head[:] = 0.0451, -0.0338, 0.0533
1585 bone.tail[:] = 0.0166, -0.0758, 0.0187
1586 bone.roll = 0.0458
1587 bone.use_connect = True
1588 bone.parent = arm.edit_bones[bones['jaw.L']]
1589 bones['jaw.L.001'] = bone.name
1590 bone = arm.edit_bones.new('jaw.R.001')
1591 bone.head[:] = -0.0451, -0.0338, 0.0533
1592 bone.tail[:] = -0.0166, -0.0758, 0.0187
1593 bone.roll = -0.0458
1594 bone.use_connect = True
1595 bone.parent = arm.edit_bones[bones['jaw.R']]
1596 bones['jaw.R.001'] = bone.name
1597 bone = arm.edit_bones.new('lid.B.L.002')
1598 bone.head[:] = 0.0389, -0.0826, 0.1050
1599 bone.tail[:] = 0.0472, -0.0781, 0.1068
1600 bone.roll = 0.0229
1601 bone.use_connect = True
1602 bone.parent = arm.edit_bones[bones['lid.B.L.001']]
1603 bones['lid.B.L.002'] = bone.name
1604 bone = arm.edit_bones.new('lid.B.R.002')
1605 bone.head[:] = -0.0389, -0.0826, 0.1050
1606 bone.tail[:] = -0.0472, -0.0781, 0.1068
1607 bone.roll = -0.0229
1608 bone.use_connect = True
1609 bone.parent = arm.edit_bones[bones['lid.B.R.001']]
1610 bones['lid.B.R.002'] = bone.name
1611 bone = arm.edit_bones.new('chin.L')
1612 bone.head[:] = 0.0166, -0.0758, 0.0187
1613 bone.tail[:] = 0.0236, -0.0877, 0.0519
1614 bone.roll = 0.1513
1615 bone.use_connect = True
1616 bone.parent = arm.edit_bones[bones['jaw.L.001']]
1617 bones['chin.L'] = bone.name
1618 bone = arm.edit_bones.new('chin.R')
1619 bone.head[:] = -0.0166, -0.0758, 0.0187
1620 bone.tail[:] = -0.0236, -0.0877, 0.0519
1621 bone.roll = -0.1513
1622 bone.use_connect = True
1623 bone.parent = arm.edit_bones[bones['jaw.R.001']]
1624 bones['chin.R'] = bone.name
1625 bone = arm.edit_bones.new('lid.B.L.003')
1626 bone.head[:] = 0.0472, -0.0781, 0.1068
1627 bone.tail[:] = 0.0515, -0.0692, 0.1104
1628 bone.roll = -0.0147
1629 bone.use_connect = True
1630 bone.parent = arm.edit_bones[bones['lid.B.L.002']]
1631 bones['lid.B.L.003'] = bone.name
1632 bone = arm.edit_bones.new('lid.B.R.003')
1633 bone.head[:] = -0.0472, -0.0781, 0.1068
1634 bone.tail[:] = -0.0515, -0.0692, 0.1104
1635 bone.roll = 0.0147
1636 bone.use_connect = True
1637 bone.parent = arm.edit_bones[bones['lid.B.R.002']]
1638 bones['lid.B.R.003'] = bone.name
1639 bone = arm.edit_bones.new('cheek.B.L')
1640 bone.head[:] = 0.0236, -0.0877, 0.0519
1641 bone.tail[:] = 0.0493, -0.0691, 0.0632
1642 bone.roll = 0.0015
1643 bone.use_connect = True
1644 bone.parent = arm.edit_bones[bones['chin.L']]
1645 bones['cheek.B.L'] = bone.name
1646 bone = arm.edit_bones.new('cheek.B.R')
1647 bone.head[:] = -0.0236, -0.0877, 0.0519
1648 bone.tail[:] = -0.0493, -0.0691, 0.0632
1649 bone.roll = -0.0015
1650 bone.use_connect = True
1651 bone.parent = arm.edit_bones[bones['chin.R']]
1652 bones['cheek.B.R'] = bone.name
1653 bone = arm.edit_bones.new('cheek.B.L.001')
1654 bone.head[:] = 0.0493, -0.0691, 0.0632
1655 bone.tail[:] = 0.0568, -0.0506, 0.1052
1656 bone.roll = -0.0000
1657 bone.use_connect = True
1658 bone.parent = arm.edit_bones[bones['cheek.B.L']]
1659 bones['cheek.B.L.001'] = bone.name
1660 bone = arm.edit_bones.new('cheek.B.R.001')
1661 bone.head[:] = -0.0493, -0.0691, 0.0632
1662 bone.tail[:] = -0.0568, -0.0506, 0.1052
1663 bone.roll = 0.0000
1664 bone.use_connect = True
1665 bone.parent = arm.edit_bones[bones['cheek.B.R']]
1666 bones['cheek.B.R.001'] = bone.name
1667 bone = arm.edit_bones.new('brow.T.L')
1668 bone.head[:] = 0.0568, -0.0506, 0.1052
1669 bone.tail[:] = 0.0556, -0.0689, 0.1249
1670 bone.roll = 0.1990
1671 bone.use_connect = True
1672 bone.parent = arm.edit_bones[bones['cheek.B.L.001']]
1673 bones['brow.T.L'] = bone.name
1674 bone = arm.edit_bones.new('brow.T.R')
1675 bone.head[:] = -0.0568, -0.0506, 0.1052
1676 bone.tail[:] = -0.0556, -0.0689, 0.1249
1677 bone.roll = -0.1990
1678 bone.use_connect = True
1679 bone.parent = arm.edit_bones[bones['cheek.B.R.001']]
1680 bones['brow.T.R'] = bone.name
1681 bone = arm.edit_bones.new('brow.T.L.001')
1682 bone.head[:] = 0.0556, -0.0689, 0.1249
1683 bone.tail[:] = 0.0394, -0.0828, 0.1310
1684 bone.roll = 0.2372
1685 bone.use_connect = True
1686 bone.parent = arm.edit_bones[bones['brow.T.L']]
1687 bones['brow.T.L.001'] = bone.name
1688 bone = arm.edit_bones.new('brow.T.R.001')
1689 bone.head[:] = -0.0556, -0.0689, 0.1249
1690 bone.tail[:] = -0.0394, -0.0828, 0.1310
1691 bone.roll = -0.2372
1692 bone.use_connect = True
1693 bone.parent = arm.edit_bones[bones['brow.T.R']]
1694 bones['brow.T.R.001'] = bone.name
1695 bone = arm.edit_bones.new('brow.T.L.002')
1696 bone.head[:] = 0.0394, -0.0828, 0.1310
1697 bone.tail[:] = 0.0144, -0.0912, 0.1236
1698 bone.roll = 0.0724
1699 bone.use_connect = True
1700 bone.parent = arm.edit_bones[bones['brow.T.L.001']]
1701 bones['brow.T.L.002'] = bone.name
1702 bone = arm.edit_bones.new('brow.T.R.002')
1703 bone.head[:] = -0.0394, -0.0828, 0.1310
1704 bone.tail[:] = -0.0144, -0.0912, 0.1236
1705 bone.roll = -0.0724
1706 bone.use_connect = True
1707 bone.parent = arm.edit_bones[bones['brow.T.R.001']]
1708 bones['brow.T.R.002'] = bone.name
1709 bone = arm.edit_bones.new('brow.T.L.003')
1710 bone.head[:] = 0.0144, -0.0912, 0.1236
1711 bone.tail[:] = 0.0003, -0.0905, 0.1125
1712 bone.roll = -0.0423
1713 bone.use_connect = True
1714 bone.parent = arm.edit_bones[bones['brow.T.L.002']]
1715 bones['brow.T.L.003'] = bone.name
1716 bone = arm.edit_bones.new('brow.T.R.003')
1717 bone.head[:] = -0.0144, -0.0912, 0.1236
1718 bone.tail[:] = -0.0003, -0.0905, 0.1125
1719 bone.roll = 0.0423
1720 bone.use_connect = True
1721 bone.parent = arm.edit_bones[bones['brow.T.R.002']]
1722 bones['brow.T.R.003'] = bone.name
1724 bpy.ops.object.mode_set(mode='OBJECT')
1725 pbone = obj.pose.bones[bones['face']]
1726 pbone.rigify_type = 'pitchipoy.super_face'
1727 pbone.lock_location = (False, False, False)
1728 pbone.lock_rotation = (False, False, False)
1729 pbone.lock_rotation_w = False
1730 pbone.lock_scale = (False, False, False)
1731 pbone.rotation_mode = 'QUATERNION'
1732 pbone = obj.pose.bones[bones['nose']]
1733 pbone.rigify_type = ''
1734 pbone.lock_location = (False, False, False)
1735 pbone.lock_rotation = (False, False, False)
1736 pbone.lock_rotation_w = False
1737 pbone.lock_scale = (False, False, False)
1738 pbone.rotation_mode = 'QUATERNION'
1739 pbone = obj.pose.bones[bones['lip.T.L']]
1740 pbone.rigify_type = ''
1741 pbone.lock_location = (False, False, False)
1742 pbone.lock_rotation = (False, False, False)
1743 pbone.lock_rotation_w = False
1744 pbone.lock_scale = (False, False, False)
1745 pbone.rotation_mode = 'QUATERNION'
1746 pbone = obj.pose.bones[bones['lip.B.L']]
1747 pbone.rigify_type = ''
1748 pbone.lock_location = (False, False, False)
1749 pbone.lock_rotation = (False, False, False)
1750 pbone.lock_rotation_w = False
1751 pbone.lock_scale = (False, False, False)
1752 pbone.rotation_mode = 'QUATERNION'
1753 pbone = obj.pose.bones[bones['jaw']]
1754 pbone.rigify_type = ''
1755 pbone.lock_location = (False, False, False)
1756 pbone.lock_rotation = (False, False, False)
1757 pbone.lock_rotation_w = False
1758 pbone.lock_scale = (False, False, False)
1759 pbone.rotation_mode = 'QUATERNION'
1760 pbone = obj.pose.bones[bones['ear.L']]
1761 pbone.rigify_type = ''
1762 pbone.lock_location = (False, False, False)
1763 pbone.lock_rotation = (False, False, False)
1764 pbone.lock_rotation_w = False
1765 pbone.lock_scale = (False, False, False)
1766 pbone.rotation_mode = 'QUATERNION'
1767 pbone = obj.pose.bones[bones['ear.R']]
1768 pbone.rigify_type = ''
1769 pbone.lock_location = (False, False, False)
1770 pbone.lock_rotation = (False, False, False)
1771 pbone.lock_rotation_w = False
1772 pbone.lock_scale = (False, False, False)
1773 pbone.rotation_mode = 'QUATERNION'
1774 pbone = obj.pose.bones[bones['lip.T.R']]
1775 pbone.rigify_type = ''
1776 pbone.lock_location = (False, False, False)
1777 pbone.lock_rotation = (False, False, False)
1778 pbone.lock_rotation_w = False
1779 pbone.lock_scale = (False, False, False)
1780 pbone.rotation_mode = 'QUATERNION'
1781 pbone = obj.pose.bones[bones['lip.B.R']]
1782 pbone.rigify_type = ''
1783 pbone.lock_location = (False, False, False)
1784 pbone.lock_rotation = (False, False, False)
1785 pbone.lock_rotation_w = False
1786 pbone.lock_scale = (False, False, False)
1787 pbone.rotation_mode = 'QUATERNION'
1788 pbone = obj.pose.bones[bones['brow.B.L']]
1789 pbone.rigify_type = ''
1790 pbone.lock_location = (False, False, False)
1791 pbone.lock_rotation = (False, False, False)
1792 pbone.lock_rotation_w = False
1793 pbone.lock_scale = (False, False, False)
1794 pbone.rotation_mode = 'QUATERNION'
1795 pbone = obj.pose.bones[bones['lid.T.L']]
1796 pbone.rigify_type = ''
1797 pbone.lock_location = (False, False, False)
1798 pbone.lock_rotation = (False, False, False)
1799 pbone.lock_rotation_w = False
1800 pbone.lock_scale = (False, False, False)
1801 pbone.rotation_mode = 'QUATERNION'
1802 pbone = obj.pose.bones[bones['brow.B.R']]
1803 pbone.rigify_type = ''
1804 pbone.lock_location = (False, False, False)
1805 pbone.lock_rotation = (False, False, False)
1806 pbone.lock_rotation_w = False
1807 pbone.lock_scale = (False, False, False)
1808 pbone.rotation_mode = 'QUATERNION'
1809 pbone = obj.pose.bones[bones['lid.T.R']]
1810 pbone.rigify_type = ''
1811 pbone.lock_location = (False, False, False)
1812 pbone.lock_rotation = (False, False, False)
1813 pbone.lock_rotation_w = False
1814 pbone.lock_scale = (False, False, False)
1815 pbone.rotation_mode = 'QUATERNION'
1816 pbone = obj.pose.bones[bones['forehead.L']]
1817 pbone.rigify_type = ''
1818 pbone.lock_location = (False, False, False)
1819 pbone.lock_rotation = (False, False, False)
1820 pbone.lock_rotation_w = False
1821 pbone.lock_scale = (False, False, False)
1822 pbone.rotation_mode = 'QUATERNION'
1823 pbone = obj.pose.bones[bones['forehead.R']]
1824 pbone.rigify_type = ''
1825 pbone.lock_location = (False, False, False)
1826 pbone.lock_rotation = (False, False, False)
1827 pbone.lock_rotation_w = False
1828 pbone.lock_scale = (False, False, False)
1829 pbone.rotation_mode = 'QUATERNION'
1830 pbone = obj.pose.bones[bones['eye.L']]
1831 pbone.rigify_type = ''
1832 pbone.lock_location = (False, False, False)
1833 pbone.lock_rotation = (False, False, False)
1834 pbone.lock_rotation_w = False
1835 pbone.lock_scale = (False, False, False)
1836 pbone.rotation_mode = 'QUATERNION'
1837 pbone = obj.pose.bones[bones['eye.R']]
1838 pbone.rigify_type = ''
1839 pbone.lock_location = (False, False, False)
1840 pbone.lock_rotation = (False, False, False)
1841 pbone.lock_rotation_w = False
1842 pbone.lock_scale = (False, False, False)
1843 pbone.rotation_mode = 'QUATERNION'
1844 pbone = obj.pose.bones[bones['cheek.T.L']]
1845 pbone.rigify_type = ''
1846 pbone.lock_location = (False, False, False)
1847 pbone.lock_rotation = (False, False, False)
1848 pbone.lock_rotation_w = False
1849 pbone.lock_scale = (False, False, False)
1850 pbone.rotation_mode = 'QUATERNION'
1851 pbone = obj.pose.bones[bones['cheek.T.R']]
1852 pbone.rigify_type = ''
1853 pbone.lock_location = (False, False, False)
1854 pbone.lock_rotation = (False, False, False)
1855 pbone.lock_rotation_w = False
1856 pbone.lock_scale = (False, False, False)
1857 pbone.rotation_mode = 'QUATERNION'
1858 pbone = obj.pose.bones[bones['teeth.T']]
1859 pbone.rigify_type = ''
1860 pbone.lock_location = (False, False, False)
1861 pbone.lock_rotation = (False, False, False)
1862 pbone.lock_rotation_w = False
1863 pbone.lock_scale = (False, False, False)
1864 pbone.rotation_mode = 'QUATERNION'
1865 pbone = obj.pose.bones[bones['teeth.B']]
1866 pbone.rigify_type = ''
1867 pbone.lock_location = (False, False, False)
1868 pbone.lock_rotation = (False, False, False)
1869 pbone.lock_rotation_w = False
1870 pbone.lock_scale = (False, False, False)
1871 pbone.rotation_mode = 'QUATERNION'
1872 pbone = obj.pose.bones[bones['tongue']]
1873 pbone.rigify_type = ''
1874 pbone.lock_location = (False, False, False)
1875 pbone.lock_rotation = (False, False, False)
1876 pbone.lock_rotation_w = False
1877 pbone.lock_scale = (False, False, False)
1878 pbone.rotation_mode = 'QUATERNION'
1879 pbone = obj.pose.bones[bones['nose.001']]
1880 pbone.rigify_type = ''
1881 pbone.lock_location = (False, False, False)
1882 pbone.lock_rotation = (False, False, False)
1883 pbone.lock_rotation_w = False
1884 pbone.lock_scale = (False, False, False)
1885 pbone.rotation_mode = 'QUATERNION'
1886 pbone = obj.pose.bones[bones['lip.T.L.001']]
1887 pbone.rigify_type = ''
1888 pbone.lock_location = (False, False, False)
1889 pbone.lock_rotation = (False, False, False)
1890 pbone.lock_rotation_w = False
1891 pbone.lock_scale = (False, False, False)
1892 pbone.rotation_mode = 'QUATERNION'
1893 pbone = obj.pose.bones[bones['lip.B.L.001']]
1894 pbone.rigify_type = ''
1895 pbone.lock_location = (False, False, False)
1896 pbone.lock_rotation = (False, False, False)
1897 pbone.lock_rotation_w = False
1898 pbone.lock_scale = (False, False, False)
1899 pbone.rotation_mode = 'QUATERNION'
1900 pbone = obj.pose.bones[bones['chin']]
1901 pbone.rigify_type = ''
1902 pbone.lock_location = (False, False, False)
1903 pbone.lock_rotation = (False, False, False)
1904 pbone.lock_rotation_w = False
1905 pbone.lock_scale = (False, False, False)
1906 pbone.rotation_mode = 'QUATERNION'
1907 pbone = obj.pose.bones[bones['ear.L.001']]
1908 pbone.rigify_type = ''
1909 pbone.lock_location = (False, False, False)
1910 pbone.lock_rotation = (False, False, False)
1911 pbone.lock_rotation_w = False
1912 pbone.lock_scale = (False, False, False)
1913 pbone.rotation_mode = 'QUATERNION'
1914 pbone = obj.pose.bones[bones['ear.R.001']]
1915 pbone.rigify_type = ''
1916 pbone.lock_location = (False, False, False)
1917 pbone.lock_rotation = (False, False, False)
1918 pbone.lock_rotation_w = False
1919 pbone.lock_scale = (False, False, False)
1920 pbone.rotation_mode = 'QUATERNION'
1921 pbone = obj.pose.bones[bones['lip.T.R.001']]
1922 pbone.rigify_type = ''
1923 pbone.lock_location = (False, False, False)
1924 pbone.lock_rotation = (False, False, False)
1925 pbone.lock_rotation_w = False
1926 pbone.lock_scale = (False, False, False)
1927 pbone.rotation_mode = 'QUATERNION'
1928 pbone = obj.pose.bones[bones['lip.B.R.001']]
1929 pbone.rigify_type = ''
1930 pbone.lock_location = (False, False, False)
1931 pbone.lock_rotation = (False, False, False)
1932 pbone.lock_rotation_w = False
1933 pbone.lock_scale = (False, False, False)
1934 pbone.rotation_mode = 'QUATERNION'
1935 pbone = obj.pose.bones[bones['brow.B.L.001']]
1936 pbone.rigify_type = ''
1937 pbone.lock_location = (False, False, False)
1938 pbone.lock_rotation = (False, False, False)
1939 pbone.lock_rotation_w = False
1940 pbone.lock_scale = (False, False, False)
1941 pbone.rotation_mode = 'QUATERNION'
1942 pbone = obj.pose.bones[bones['lid.T.L.001']]
1943 pbone.rigify_type = ''
1944 pbone.lock_location = (False, False, False)
1945 pbone.lock_rotation = (False, False, False)
1946 pbone.lock_rotation_w = False
1947 pbone.lock_scale = (False, False, False)
1948 pbone.rotation_mode = 'QUATERNION'
1949 pbone = obj.pose.bones[bones['brow.B.R.001']]
1950 pbone.rigify_type = ''
1951 pbone.lock_location = (False, False, False)
1952 pbone.lock_rotation = (False, False, False)
1953 pbone.lock_rotation_w = False
1954 pbone.lock_scale = (False, False, False)
1955 pbone.rotation_mode = 'QUATERNION'
1956 pbone = obj.pose.bones[bones['lid.T.R.001']]
1957 pbone.rigify_type = ''
1958 pbone.lock_location = (False, False, False)
1959 pbone.lock_rotation = (False, False, False)
1960 pbone.lock_rotation_w = False
1961 pbone.lock_scale = (False, False, False)
1962 pbone.rotation_mode = 'QUATERNION'
1963 pbone = obj.pose.bones[bones['forehead.L.001']]
1964 pbone.rigify_type = ''
1965 pbone.lock_location = (False, False, False)
1966 pbone.lock_rotation = (False, False, False)
1967 pbone.lock_rotation_w = False
1968 pbone.lock_scale = (False, False, False)
1969 pbone.rotation_mode = 'QUATERNION'
1970 pbone = obj.pose.bones[bones['forehead.R.001']]
1971 pbone.rigify_type = ''
1972 pbone.lock_location = (False, False, False)
1973 pbone.lock_rotation = (False, False, False)
1974 pbone.lock_rotation_w = False
1975 pbone.lock_scale = (False, False, False)
1976 pbone.rotation_mode = 'QUATERNION'
1977 pbone = obj.pose.bones[bones['cheek.T.L.001']]
1978 pbone.rigify_type = ''
1979 pbone.lock_location = (False, False, False)
1980 pbone.lock_rotation = (False, False, False)
1981 pbone.lock_rotation_w = False
1982 pbone.lock_scale = (False, False, False)
1983 pbone.rotation_mode = 'QUATERNION'
1984 pbone = obj.pose.bones[bones['cheek.T.R.001']]
1985 pbone.rigify_type = ''
1986 pbone.lock_location = (False, False, False)
1987 pbone.lock_rotation = (False, False, False)
1988 pbone.lock_rotation_w = False
1989 pbone.lock_scale = (False, False, False)
1990 pbone.rotation_mode = 'QUATERNION'
1991 pbone = obj.pose.bones[bones['tongue.001']]
1992 pbone.rigify_type = ''
1993 pbone.lock_location = (False, False, False)
1994 pbone.lock_rotation = (False, False, False)
1995 pbone.lock_rotation_w = False
1996 pbone.lock_scale = (False, False, False)
1997 pbone.rotation_mode = 'QUATERNION'
1998 pbone = obj.pose.bones[bones['nose.002']]
1999 pbone.rigify_type = ''
2000 pbone.lock_location = (False, False, False)
2001 pbone.lock_rotation = (False, False, False)
2002 pbone.lock_rotation_w = False
2003 pbone.lock_scale = (False, False, False)
2004 pbone.rotation_mode = 'QUATERNION'
2005 pbone = obj.pose.bones[bones['chin.001']]
2006 pbone.rigify_type = ''
2007 pbone.lock_location = (False, False, False)
2008 pbone.lock_rotation = (False, False, False)
2009 pbone.lock_rotation_w = False
2010 pbone.lock_scale = (False, False, False)
2011 pbone.rotation_mode = 'QUATERNION'
2012 pbone = obj.pose.bones[bones['ear.L.002']]
2013 pbone.rigify_type = ''
2014 pbone.lock_location = (False, False, False)
2015 pbone.lock_rotation = (False, False, False)
2016 pbone.lock_rotation_w = False
2017 pbone.lock_scale = (False, False, False)
2018 pbone.rotation_mode = 'QUATERNION'
2019 pbone = obj.pose.bones[bones['ear.R.002']]
2020 pbone.rigify_type = ''
2021 pbone.lock_location = (False, False, False)
2022 pbone.lock_rotation = (False, False, False)
2023 pbone.lock_rotation_w = False
2024 pbone.lock_scale = (False, False, False)
2025 pbone.rotation_mode = 'QUATERNION'
2026 pbone = obj.pose.bones[bones['brow.B.L.002']]
2027 pbone.rigify_type = ''
2028 pbone.lock_location = (False, False, False)
2029 pbone.lock_rotation = (False, False, False)
2030 pbone.lock_rotation_w = False
2031 pbone.lock_scale = (False, False, False)
2032 pbone.rotation_mode = 'QUATERNION'
2033 pbone = obj.pose.bones[bones['lid.T.L.002']]
2034 pbone.rigify_type = ''
2035 pbone.lock_location = (False, False, False)
2036 pbone.lock_rotation = (False, False, False)
2037 pbone.lock_rotation_w = False
2038 pbone.lock_scale = (False, False, False)
2039 pbone.rotation_mode = 'QUATERNION'
2040 pbone = obj.pose.bones[bones['brow.B.R.002']]
2041 pbone.rigify_type = ''
2042 pbone.lock_location = (False, False, False)
2043 pbone.lock_rotation = (False, False, False)
2044 pbone.lock_rotation_w = False
2045 pbone.lock_scale = (False, False, False)
2046 pbone.rotation_mode = 'QUATERNION'
2047 pbone = obj.pose.bones[bones['lid.T.R.002']]
2048 pbone.rigify_type = ''
2049 pbone.lock_location = (False, False, False)
2050 pbone.lock_rotation = (False, False, False)
2051 pbone.lock_rotation_w = False
2052 pbone.lock_scale = (False, False, False)
2053 pbone.rotation_mode = 'QUATERNION'
2054 pbone = obj.pose.bones[bones['forehead.L.002']]
2055 pbone.rigify_type = ''
2056 pbone.lock_location = (False, False, False)
2057 pbone.lock_rotation = (False, False, False)
2058 pbone.lock_rotation_w = False
2059 pbone.lock_scale = (False, False, False)
2060 pbone.rotation_mode = 'QUATERNION'
2061 pbone = obj.pose.bones[bones['forehead.R.002']]
2062 pbone.rigify_type = ''
2063 pbone.lock_location = (False, False, False)
2064 pbone.lock_rotation = (False, False, False)
2065 pbone.lock_rotation_w = False
2066 pbone.lock_scale = (False, False, False)
2067 pbone.rotation_mode = 'QUATERNION'
2068 pbone = obj.pose.bones[bones['nose.L']]
2069 pbone.rigify_type = ''
2070 pbone.lock_location = (False, False, False)
2071 pbone.lock_rotation = (False, False, False)
2072 pbone.lock_rotation_w = False
2073 pbone.lock_scale = (False, False, False)
2074 pbone.rotation_mode = 'QUATERNION'
2075 pbone = obj.pose.bones[bones['nose.R']]
2076 pbone.rigify_type = ''
2077 pbone.lock_location = (False, False, False)
2078 pbone.lock_rotation = (False, False, False)
2079 pbone.lock_rotation_w = False
2080 pbone.lock_scale = (False, False, False)
2081 pbone.rotation_mode = 'QUATERNION'
2082 pbone = obj.pose.bones[bones['tongue.002']]
2083 pbone.rigify_type = ''
2084 pbone.lock_location = (False, False, False)
2085 pbone.lock_rotation = (False, False, False)
2086 pbone.lock_rotation_w = False
2087 pbone.lock_scale = (False, False, False)
2088 pbone.rotation_mode = 'QUATERNION'
2089 pbone = obj.pose.bones[bones['nose.003']]
2090 pbone.rigify_type = ''
2091 pbone.lock_location = (False, False, False)
2092 pbone.lock_rotation = (False, False, False)
2093 pbone.lock_rotation_w = False
2094 pbone.lock_scale = (False, False, False)
2095 pbone.rotation_mode = 'QUATERNION'
2096 pbone = obj.pose.bones[bones['ear.L.003']]
2097 pbone.rigify_type = ''
2098 pbone.lock_location = (False, False, False)
2099 pbone.lock_rotation = (False, False, False)
2100 pbone.lock_rotation_w = False
2101 pbone.lock_scale = (False, False, False)
2102 pbone.rotation_mode = 'QUATERNION'
2103 pbone = obj.pose.bones[bones['ear.R.003']]
2104 pbone.rigify_type = ''
2105 pbone.lock_location = (False, False, False)
2106 pbone.lock_rotation = (False, False, False)
2107 pbone.lock_rotation_w = False
2108 pbone.lock_scale = (False, False, False)
2109 pbone.rotation_mode = 'QUATERNION'
2110 pbone = obj.pose.bones[bones['brow.B.L.003']]
2111 pbone.rigify_type = ''
2112 pbone.lock_location = (False, False, False)
2113 pbone.lock_rotation = (False, False, False)
2114 pbone.lock_rotation_w = False
2115 pbone.lock_scale = (False, False, False)
2116 pbone.rotation_mode = 'QUATERNION'
2117 pbone = obj.pose.bones[bones['lid.T.L.003']]
2118 pbone.rigify_type = ''
2119 pbone.lock_location = (False, False, False)
2120 pbone.lock_rotation = (False, False, False)
2121 pbone.lock_rotation_w = False
2122 pbone.lock_scale = (False, False, False)
2123 pbone.rotation_mode = 'QUATERNION'
2124 pbone = obj.pose.bones[bones['brow.B.R.003']]
2125 pbone.rigify_type = ''
2126 pbone.lock_location = (False, False, False)
2127 pbone.lock_rotation = (False, False, False)
2128 pbone.lock_rotation_w = False
2129 pbone.lock_scale = (False, False, False)
2130 pbone.rotation_mode = 'QUATERNION'
2131 pbone = obj.pose.bones[bones['lid.T.R.003']]
2132 pbone.rigify_type = ''
2133 pbone.lock_location = (False, False, False)
2134 pbone.lock_rotation = (False, False, False)
2135 pbone.lock_rotation_w = False
2136 pbone.lock_scale = (False, False, False)
2137 pbone.rotation_mode = 'QUATERNION'
2138 pbone = obj.pose.bones[bones['temple.L']]
2139 pbone.rigify_type = ''
2140 pbone.lock_location = (False, False, False)
2141 pbone.lock_rotation = (False, False, False)
2142 pbone.lock_rotation_w = False
2143 pbone.lock_scale = (False, False, False)
2144 pbone.rotation_mode = 'QUATERNION'
2145 pbone = obj.pose.bones[bones['temple.R']]
2146 pbone.rigify_type = ''
2147 pbone.lock_location = (False, False, False)
2148 pbone.lock_rotation = (False, False, False)
2149 pbone.lock_rotation_w = False
2150 pbone.lock_scale = (False, False, False)
2151 pbone.rotation_mode = 'QUATERNION'
2152 pbone = obj.pose.bones[bones['nose.L.001']]
2153 pbone.rigify_type = ''
2154 pbone.lock_location = (False, False, False)
2155 pbone.lock_rotation = (False, False, False)
2156 pbone.lock_rotation_w = False
2157 pbone.lock_scale = (False, False, False)
2158 pbone.rotation_mode = 'QUATERNION'
2159 pbone = obj.pose.bones[bones['nose.R.001']]
2160 pbone.rigify_type = ''
2161 pbone.lock_location = (False, False, False)
2162 pbone.lock_rotation = (False, False, False)
2163 pbone.lock_rotation_w = False
2164 pbone.lock_scale = (False, False, False)
2165 pbone.rotation_mode = 'QUATERNION'
2166 pbone = obj.pose.bones[bones['nose.004']]
2167 pbone.rigify_type = ''
2168 pbone.lock_location = (False, False, False)
2169 pbone.lock_rotation = (False, False, False)
2170 pbone.lock_rotation_w = False
2171 pbone.lock_scale = (False, False, False)
2172 pbone.rotation_mode = 'QUATERNION'
2173 pbone = obj.pose.bones[bones['ear.L.004']]
2174 pbone.rigify_type = ''
2175 pbone.lock_location = (False, False, False)
2176 pbone.lock_rotation = (False, False, False)
2177 pbone.lock_rotation_w = False
2178 pbone.lock_scale = (False, False, False)
2179 pbone.rotation_mode = 'QUATERNION'
2180 pbone = obj.pose.bones[bones['ear.R.004']]
2181 pbone.rigify_type = ''
2182 pbone.lock_location = (False, False, False)
2183 pbone.lock_rotation = (False, False, False)
2184 pbone.lock_rotation_w = False
2185 pbone.lock_scale = (False, False, False)
2186 pbone.rotation_mode = 'QUATERNION'
2187 pbone = obj.pose.bones[bones['lid.B.L']]
2188 pbone.rigify_type = ''
2189 pbone.lock_location = (False, False, False)
2190 pbone.lock_rotation = (False, False, False)
2191 pbone.lock_rotation_w = False
2192 pbone.lock_scale = (False, False, False)
2193 pbone.rotation_mode = 'QUATERNION'
2194 pbone = obj.pose.bones[bones['lid.B.R']]
2195 pbone.rigify_type = ''
2196 pbone.lock_location = (False, False, False)
2197 pbone.lock_rotation = (False, False, False)
2198 pbone.lock_rotation_w = False
2199 pbone.lock_scale = (False, False, False)
2200 pbone.rotation_mode = 'QUATERNION'
2201 pbone = obj.pose.bones[bones['jaw.L']]
2202 pbone.rigify_type = ''
2203 pbone.lock_location = (False, False, False)
2204 pbone.lock_rotation = (False, False, False)
2205 pbone.lock_rotation_w = False
2206 pbone.lock_scale = (False, False, False)
2207 pbone.rotation_mode = 'QUATERNION'
2208 pbone = obj.pose.bones[bones['jaw.R']]
2209 pbone.rigify_type = ''
2210 pbone.lock_location = (False, False, False)
2211 pbone.lock_rotation = (False, False, False)
2212 pbone.lock_rotation_w = False
2213 pbone.lock_scale = (False, False, False)
2214 pbone.rotation_mode = 'QUATERNION'
2215 pbone = obj.pose.bones[bones['lid.B.L.001']]
2216 pbone.rigify_type = ''
2217 pbone.lock_location = (False, False, False)
2218 pbone.lock_rotation = (False, False, False)
2219 pbone.lock_rotation_w = False
2220 pbone.lock_scale = (False, False, False)
2221 pbone.rotation_mode = 'QUATERNION'
2222 pbone = obj.pose.bones[bones['lid.B.R.001']]
2223 pbone.rigify_type = ''
2224 pbone.lock_location = (False, False, False)
2225 pbone.lock_rotation = (False, False, False)
2226 pbone.lock_rotation_w = False
2227 pbone.lock_scale = (False, False, False)
2228 pbone.rotation_mode = 'QUATERNION'
2229 pbone = obj.pose.bones[bones['jaw.L.001']]
2230 pbone.rigify_type = ''
2231 pbone.lock_location = (False, False, False)
2232 pbone.lock_rotation = (False, False, False)
2233 pbone.lock_rotation_w = False
2234 pbone.lock_scale = (False, False, False)
2235 pbone.rotation_mode = 'QUATERNION'
2236 pbone = obj.pose.bones[bones['jaw.R.001']]
2237 pbone.rigify_type = ''
2238 pbone.lock_location = (False, False, False)
2239 pbone.lock_rotation = (False, False, False)
2240 pbone.lock_rotation_w = False
2241 pbone.lock_scale = (False, False, False)
2242 pbone.rotation_mode = 'QUATERNION'
2243 pbone = obj.pose.bones[bones['lid.B.L.002']]
2244 pbone.rigify_type = ''
2245 pbone.lock_location = (False, False, False)
2246 pbone.lock_rotation = (False, False, False)
2247 pbone.lock_rotation_w = False
2248 pbone.lock_scale = (False, False, False)
2249 pbone.rotation_mode = 'QUATERNION'
2250 pbone = obj.pose.bones[bones['lid.B.R.002']]
2251 pbone.rigify_type = ''
2252 pbone.lock_location = (False, False, False)
2253 pbone.lock_rotation = (False, False, False)
2254 pbone.lock_rotation_w = False
2255 pbone.lock_scale = (False, False, False)
2256 pbone.rotation_mode = 'QUATERNION'
2257 pbone = obj.pose.bones[bones['chin.L']]
2258 pbone.rigify_type = ''
2259 pbone.lock_location = (False, False, False)
2260 pbone.lock_rotation = (False, False, False)
2261 pbone.lock_rotation_w = False
2262 pbone.lock_scale = (False, False, False)
2263 pbone.rotation_mode = 'QUATERNION'
2264 pbone = obj.pose.bones[bones['chin.R']]
2265 pbone.rigify_type = ''
2266 pbone.lock_location = (False, False, False)
2267 pbone.lock_rotation = (False, False, False)
2268 pbone.lock_rotation_w = False
2269 pbone.lock_scale = (False, False, False)
2270 pbone.rotation_mode = 'QUATERNION'
2271 pbone = obj.pose.bones[bones['lid.B.L.003']]
2272 pbone.rigify_type = ''
2273 pbone.lock_location = (False, False, False)
2274 pbone.lock_rotation = (False, False, False)
2275 pbone.lock_rotation_w = False
2276 pbone.lock_scale = (False, False, False)
2277 pbone.rotation_mode = 'QUATERNION'
2278 pbone = obj.pose.bones[bones['lid.B.R.003']]
2279 pbone.rigify_type = ''
2280 pbone.lock_location = (False, False, False)
2281 pbone.lock_rotation = (False, False, False)
2282 pbone.lock_rotation_w = False
2283 pbone.lock_scale = (False, False, False)
2284 pbone.rotation_mode = 'QUATERNION'
2285 pbone = obj.pose.bones[bones['cheek.B.L']]
2286 pbone.rigify_type = ''
2287 pbone.lock_location = (False, False, False)
2288 pbone.lock_rotation = (False, False, False)
2289 pbone.lock_rotation_w = False
2290 pbone.lock_scale = (False, False, False)
2291 pbone.rotation_mode = 'QUATERNION'
2292 pbone = obj.pose.bones[bones['cheek.B.R']]
2293 pbone.rigify_type = ''
2294 pbone.lock_location = (False, False, False)
2295 pbone.lock_rotation = (False, False, False)
2296 pbone.lock_rotation_w = False
2297 pbone.lock_scale = (False, False, False)
2298 pbone.rotation_mode = 'QUATERNION'
2299 pbone = obj.pose.bones[bones['cheek.B.L.001']]
2300 pbone.rigify_type = ''
2301 pbone.lock_location = (False, False, False)
2302 pbone.lock_rotation = (False, False, False)
2303 pbone.lock_rotation_w = False
2304 pbone.lock_scale = (False, False, False)
2305 pbone.rotation_mode = 'QUATERNION'
2306 pbone = obj.pose.bones[bones['cheek.B.R.001']]
2307 pbone.rigify_type = ''
2308 pbone.lock_location = (False, False, False)
2309 pbone.lock_rotation = (False, False, False)
2310 pbone.lock_rotation_w = False
2311 pbone.lock_scale = (False, False, False)
2312 pbone.rotation_mode = 'QUATERNION'
2313 pbone = obj.pose.bones[bones['brow.T.L']]
2314 pbone.rigify_type = ''
2315 pbone.lock_location = (False, False, False)
2316 pbone.lock_rotation = (False, False, False)
2317 pbone.lock_rotation_w = False
2318 pbone.lock_scale = (False, False, False)
2319 pbone.rotation_mode = 'QUATERNION'
2320 pbone = obj.pose.bones[bones['brow.T.R']]
2321 pbone.rigify_type = ''
2322 pbone.lock_location = (False, False, False)
2323 pbone.lock_rotation = (False, False, False)
2324 pbone.lock_rotation_w = False
2325 pbone.lock_scale = (False, False, False)
2326 pbone.rotation_mode = 'QUATERNION'
2327 pbone = obj.pose.bones[bones['brow.T.L.001']]
2328 pbone.rigify_type = ''
2329 pbone.lock_location = (False, False, False)
2330 pbone.lock_rotation = (False, False, False)
2331 pbone.lock_rotation_w = False
2332 pbone.lock_scale = (False, False, False)
2333 pbone.rotation_mode = 'QUATERNION'
2334 pbone = obj.pose.bones[bones['brow.T.R.001']]
2335 pbone.rigify_type = ''
2336 pbone.lock_location = (False, False, False)
2337 pbone.lock_rotation = (False, False, False)
2338 pbone.lock_rotation_w = False
2339 pbone.lock_scale = (False, False, False)
2340 pbone.rotation_mode = 'QUATERNION'
2341 pbone = obj.pose.bones[bones['brow.T.L.002']]
2342 pbone.rigify_type = ''
2343 pbone.lock_location = (False, False, False)
2344 pbone.lock_rotation = (False, False, False)
2345 pbone.lock_rotation_w = False
2346 pbone.lock_scale = (False, False, False)
2347 pbone.rotation_mode = 'QUATERNION'
2348 pbone = obj.pose.bones[bones['brow.T.R.002']]
2349 pbone.rigify_type = ''
2350 pbone.lock_location = (False, False, False)
2351 pbone.lock_rotation = (False, False, False)
2352 pbone.lock_rotation_w = False
2353 pbone.lock_scale = (False, False, False)
2354 pbone.rotation_mode = 'QUATERNION'
2355 pbone = obj.pose.bones[bones['brow.T.L.003']]
2356 pbone.rigify_type = ''
2357 pbone.lock_location = (False, False, False)
2358 pbone.lock_rotation = (False, False, False)
2359 pbone.lock_rotation_w = False
2360 pbone.lock_scale = (False, False, False)
2361 pbone.rotation_mode = 'QUATERNION'
2362 pbone = obj.pose.bones[bones['brow.T.R.003']]
2363 pbone.rigify_type = ''
2364 pbone.lock_location = (False, False, False)
2365 pbone.lock_rotation = (False, False, False)
2366 pbone.lock_rotation_w = False
2367 pbone.lock_scale = (False, False, False)
2368 pbone.rotation_mode = 'QUATERNION'
2370 bpy.ops.object.mode_set(mode='EDIT')
2371 for bone in arm.edit_bones:
2372 bone.select = False
2373 bone.select_head = False
2374 bone.select_tail = False
2375 for b in bones:
2376 bone = arm.edit_bones[bones[b]]
2377 bone.select = True
2378 bone.select_head = True
2379 bone.select_tail = True
2380 arm.edit_bones.active = bone
2383 def create_square_widget(rig, bone_name, size=1.0, bone_transform_name=None):
2384 obj = create_widget(rig, bone_name, bone_transform_name)
2385 if obj is not None:
2386 verts = [
2387 ( 0.5 * size, -2.9802322387695312e-08 * size, 0.5 * size ),
2388 ( -0.5 * size, -2.9802322387695312e-08 * size, 0.5 * size ),
2389 ( 0.5 * size, 2.9802322387695312e-08 * size, -0.5 * size ),
2390 ( -0.5 * size, 2.9802322387695312e-08 * size, -0.5 * size ),
2393 edges = [(0, 1), (2, 3), (0, 2), (3, 1) ]
2394 faces = []
2396 mesh = obj.data
2397 mesh.from_pydata(verts, edges, faces)
2398 mesh.update()
2399 mesh.update()
2400 return obj
2401 else:
2402 return None