def apply_ik(self, armature_object): """Add rig helpers for eyes based on the settings that were provided when constructing the class.""" _LOG.enter() self._bone_info = RigService.get_bone_orientation_info_as_dict( armature_object) self._create_eye_ik_bones(armature_object) self._apply_ik_constraint(armature_object) bpy.ops.object.mode_set(mode='POSE', toggle=False)
def apply_ik(self, armature_object): """Add rig helpers for hip, legs and feet based on the settings that were provided when constructing the class.""" _LOG.enter() self._bone_info = RigService.get_bone_orientation_info_as_dict( armature_object) if self.settings["leg_helpers_type"] == "LOWERUPPER": self._apply_lower_upper(armature_object) self._set_parent(armature_object, True, False) if self.settings["leg_helpers_type"] == "LOWERUPPERHIP": self._apply_lower_upper_hip(armature_object) self._set_parent(armature_object, True, True) bpy.ops.object.mode_set(mode='POSE', toggle=False)
def remove_ik(self, armature_object): """Remove rig helpers for arms and hands based on the settings that were provided when constructing the class, and information about the current status of the armature object.""" _LOG.enter() self._bone_info = RigService.get_bone_orientation_info_as_dict(armature_object) mode = str(RigHelpersProperties.get_value("arm_mode", entity_reference=armature_object)).strip() _LOG.debug("mode is", mode) include_shoulder = False if mode == "LOWERUPPERSHOULDER": include_shoulder = True if mode == "SHOULDERCHAIN": include_shoulder = True bpy.ops.object.mode_set(mode='POSE', toggle=False) bones_to_clear = self.get_reverse_list_of_bones_in_arm(True, True, True, include_shoulder) for bone_name in bones_to_clear: _LOG.debug("Will attempt to clear constraints from", bone_name) RigService.remove_all_constraints_from_pose_bone(bone_name, armature_object) self._show_bones(armature_object, bones_to_clear) bpy.ops.object.mode_set(mode='EDIT', toggle=False) ik_bones = [ self.which_arm + "_hand_ik", self.which_arm + "_elbow_ik", self.which_arm + "_shoulder_ik" ] for bone_name in ik_bones: bone = RigService.find_edit_bone_by_name(bone_name, armature_object) if bone: armature_object.data.edit_bones.remove(bone) bpy.ops.object.mode_set(mode='OBJECT', toggle=False) _LOG.debug("Done")
def apply_ik(self, armature_object): """Add rig helpers for fingers based on the settings that were provided when constructing the class.""" _LOG.enter() self._bone_info = RigService.get_bone_orientation_info_as_dict(armature_object) if self.settings["finger_helpers_type"] == "GRIP": self._apply_individual_grip(armature_object) if self.settings["finger_helpers_type"] == "MASTER": self._apply_master_grip(armature_object, assume_individual_grip=False) if self.settings["finger_helpers_type"] == "GRIP_AND_MASTER": self._apply_individual_grip(armature_object) self._apply_master_grip(armature_object, assume_individual_grip=True) if self.settings["finger_helpers_type"] == "POINT": self._apply_point(armature_object) bpy.ops.object.mode_set(mode='POSE', toggle=False)
def remove_ik(self, armature_object): """Remove rig helpers for fingers based on the settings that were provided when constructing the class, and information about the current status of the armature object.""" _LOG.enter() self._bone_info = RigService.get_bone_orientation_info_as_dict(armature_object) mode = str(RigHelpersProperties.get_value("finger_mode", entity_reference=armature_object)).strip() _LOG.debug("mode is", mode) if mode in ["GRIP", "MASTER", "GRIP_AND_MASTER"]: self._clear_all_finger_constraints(armature_object) self._remove_grip(armature_object) if mode in ["MASTER", "GRIP_AND_MASTER"]: self._clear_master_grip(armature_object) if mode == "POINT": self._clear_all_finger_constraints(armature_object) self._remove_point(armature_object) _LOG.debug("Done") bpy.ops.object.mode_set(mode='POSE', toggle=False)
def apply_ik(self, armature_object): """Add rig helpers for arms and hands based on the settings that were provided when constructing the class.""" _LOG.enter() self._bone_info = RigService.get_bone_orientation_info_as_dict(armature_object) if self.settings["arm_helpers_type"] == "LOWERUPPER": self._apply_lower_upper(armature_object) self._set_parent(armature_object, has_elbow_ik=True, has_shoulder_ik=False) if self.settings["arm_helpers_type"] == "LOWERUPPERSHOULDER": self._apply_lower_upper_shoulder(armature_object) self._set_parent(armature_object, has_elbow_ik=True, has_shoulder_ik=True) if self.settings["arm_helpers_type"] == "ARMCHAIN": self._apply_arm_chain(armature_object) self._set_parent(armature_object, has_elbow_ik=False, has_shoulder_ik=False) if self.settings["arm_helpers_type"] == "SHOULDERCHAIN": self._apply_shoulder_chain(armature_object) self._set_parent(armature_object, has_elbow_ik=False, has_shoulder_ik=False) bpy.ops.object.mode_set(mode='OBJECT', toggle=False)