def make_control_bone(self, i, org, is_hip): name = self.copy_bone(org, make_derived_name(org, 'ctrl', '_fk'), parent=False) if is_hip: put_bone(self.obj, name, self.get_bone(name).tail) return name
def make_master_control(self): org = self.bones.org name = self.copy_bone(org, make_derived_name(org, 'ctrl', '_master'), parent=True) put_bone(self.obj, name, self.get_master_control_position()) self.bones.ctrl.master = name
def make_ik_pivot_bone(self, orgs): name = self.copy_bone(orgs[2], make_derived_name(orgs[2], 'ctrl', '_pivot_ik')) heel_bone = self.get_bone(self.bones.org.heel) heel_middle = (heel_bone.head + heel_bone.tail) / 2 put_bone(self.obj, name, heel_middle, matrix=self.ik_matrix, scale=0.8) return name
def make_master_control(self): super().make_master_control() # Put the main control in the middle of the hip bone base_bone = self.get_bone(self.bones.org[0]) put_bone(self.obj, self.bones.ctrl.master, (base_bone.head + base_bone.tail) / 2)
def make_last_tweak_offset_bone(self): org = self.bones.org mch = self.bones.mch mch.last_tweak_offset = self.copy_bone(org[-1], make_derived_name( org[-1], 'mch', '.end_offset'), scale=0.5) put_bone(self.obj, mch.last_tweak_offset, self.get_bone(org[-1]).tail)
def make_mch_shape_anchor_bone(self, i, org): name = self.copy_bone(org, make_derived_name(org, 'mch', '_shape' + str(i))) if i == 0 and self.use_shape_only_location: pos = self.params.jiggle_shape_anchor.matrix_world.translation put_bone(self.obj, name, self.obj.matrix_world.inverted() @ pos) return name
def make_ik_spin_bone(self, orgs): name = self.copy_bone(orgs[2], make_derived_name(orgs[2], 'ctrl', '_spin_ik')) put_bone(self.obj, name, self.get_bone(orgs[3]).head, matrix=self.ik_matrix, scale=0.5) return name
def make_mch_track_bones(self): org = self.bones.org mch = self.bones.mch mch.master = self.copy_bone(org, make_derived_name(org, 'mch')) mch.track = self.copy_bone(org, make_derived_name(org, 'mch', '_track'), scale=1 / 4) put_bone(self.obj, mch.track, self.get_bone(org).tail)
def make_ik_control_bone(self, orgs): name = self.copy_bone(orgs[2], make_derived_name(orgs[2], 'ctrl', '_ik')) if self.pivot_type == 'TOE': put_bone(self.obj, name, self.get_bone(name).tail, matrix=self.ik_matrix) else: put_bone(self.obj, name, None, matrix=self.ik_matrix) return name
def make_roll_mch_bones(self, foot, toe, heel): foot_bone = self.get_bone(foot) heel_bone = self.get_bone(heel) heel_middle = (heel_bone.head + heel_bone.tail) / 2 result = self.copy_bone(foot, make_derived_name(foot, 'mch', '_roll'), scale=0.25) roll1 = self.copy_bone(toe, make_derived_name(heel, 'mch', '_roll1'), scale=0.3) roll2 = self.copy_bone(toe, make_derived_name(heel, 'mch', '_roll2'), scale=0.3) rock1 = self.copy_bone(heel, make_derived_name(heel, 'mch', '_rock1')) rock2 = self.copy_bone(heel, make_derived_name(heel, 'mch', '_rock2')) put_bone(self.obj, roll1, None, matrix=self.roll_matrix) put_bone(self.obj, roll2, heel_middle, matrix=self.roll_matrix) put_bone(self.obj, rock1, heel_bone.tail, matrix=self.roll_matrix, scale=0.5) put_bone(self.obj, rock2, heel_bone.head, matrix=self.roll_matrix, scale=0.5) return [rock2, rock1, roll2, roll1, result]
def make_deform_bone(self): org = self.bones.org deform = self.bones.deform deform.master = self.copy_bone(org, make_derived_name( org, 'def', '_master'), scale=3 / 2) if self.params.make_deform: deform.eye = self.copy_bone(org, make_derived_name(org, 'def')) deform.iris = self.copy_bone(org, make_derived_name( org, 'def', '_iris'), scale=1 / 2) put_bone(self.obj, deform.iris, self.get_bone(org).tail)
def make_ik_end_tweak_bone(self, org): name = self.copy_bone(org, make_derived_name(org, 'ctrl', '_ik_end'), scale=0.5) put_bone(self.obj, name, self.get_bone(org).tail) return name
def make_heel_control_bone(self): org = self.bones.org.main[2] name = self.copy_bone(org, make_derived_name(org, 'ctrl', '_heel_ik')) put_bone(self.obj, name, None, matrix=self.roll_matrix, scale=0.5) self.bones.ctrl.heel = name
def make_bone_copy(self, is_front, name, **options): org = self.bones.org[0] name = self.copy_bone(org, name, **options) if is_front: put_bone(self.obj, name, self.get_bone(org).tail) return name
def make_hips_control_bone(self, orgs, name): name = self.copy_bone(orgs[0], name) put_bone(self.obj, name, self.get_bone(orgs[0]).tail) align_bone_to_axis(self.obj, name, 'z', length=self.length / 4) return name
def make_chest_control_bone(self, orgs, name): name = self.copy_bone(orgs[-1], name) put_bone(self.obj, name, self.get_end_control_pos(orgs, 2.5 / 4)) align_bone_to_axis(self.obj, name, 'z', length=self.length / 3) return name
def make_mch_ik_forward_end_bone(self, org): name = self.copy_bone(org, make_derived_name(org, 'mch', '.ik_forward_end'), scale=0.5) put_bone(self.obj, name, self.get_bone(org).tail) return name