Ejemplo n.º 1
0
    def _apply_individual_grip(self, armature_object):
        _LOG.enter()

        for finger_number in [1, 2, 3, 4, 5]:
            self._create_grip_bone(finger_number, armature_object)
            grip_name = self._get_grip_bone_name_for_finger(finger_number)

            bpy.ops.object.mode_set(mode='EDIT', toggle=False)

            parent_name = self.get_immediate_parent_name_of_finger(finger_number)
            parent_bone = RigService.find_edit_bone_by_name(parent_name, armature_object)

            grip_bone = RigService.find_edit_bone_by_name(grip_name, armature_object)
            grip_bone.parent = parent_bone

            bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
            bpy.ops.object.mode_set(mode='POSE', toggle=False)

            finger_segments = self.get_reverse_list_of_bones_in_finger(finger_number)

            for bone_name in finger_segments:
                constraint = RigService.add_copy_rotation_constraint_to_pose_bone(bone_name, grip_name, armature_object, copy_y=False, copy_z=False)
                constraint.influence = 1.0 / len(finger_segments)

            bone_name = finger_segments[-1]

            constraint = RigService.add_copy_rotation_constraint_to_pose_bone(bone_name, grip_name, armature_object, copy_x=False)

            if self.settings["hide_fk"]:
                self._hide_bones(armature_object, finger_segments)
Ejemplo n.º 2
0
    def _set_parent(self, armature_object, has_elbow_ik=False, has_shoulder_ik=False):
        _LOG.enter()
        bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
        bpy.ops.object.mode_set(mode='EDIT', toggle=False)

        if not "arm_parenting_strategy" in self.settings:
            return

        strategy = self.settings["arm_parenting_strategy"]

        if not strategy or strategy == "NONE":
            return

        hand_ik = RigService.find_edit_bone_by_name(self.which_arm + "_hand_ik", armature_object)
        elbow_ik = None
        shoulder_ik = None

        if has_elbow_ik:
            elbow_ik = RigService.find_edit_bone_by_name(self.which_arm + "_elbow_ik", armature_object)

        if has_shoulder_ik:
            shoulder_ik = RigService.find_edit_bone_by_name(self.which_arm + "_shoulder_ik", armature_object)

        if strategy == "ROOT":
            root_bone = RigService.find_edit_bone_by_name(self.get_root(), armature_object)
            hand_ik.parent = root_bone
            if elbow_ik:
                elbow_ik.parent = root_bone
            if shoulder_ik:
                shoulder_ik.parent = root_bone

        if strategy == "SPINE":
            spine_bone = RigService.find_edit_bone_by_name(self.get_shoulders_immediate_parent(), armature_object)
            hand_ik.parent = spine_bone
            if elbow_ik:
                elbow_ik.parent = spine_bone
            if shoulder_ik:
                shoulder_ik.parent = spine_bone

        if strategy == "OUTER":
            if elbow_ik:
                elbow_ik.parent = hand_ik
                if shoulder_ik:
                    shoulder_ik.parent = elbow_ik

        if strategy == "INNER":
            if elbow_ik:
                hand_ik.parent = elbow_ik
                if shoulder_ik:
                    elbow_ik.parent = shoulder_ik

        bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
Ejemplo n.º 3
0
    def _set_parent(self,
                    armature_object,
                    has_knee_ik=False,
                    has_hip_ik=False):

        bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
        bpy.ops.object.mode_set(mode='EDIT', toggle=False)

        if not "leg_parenting_strategy" in self.settings:
            return

        strategy = self.settings["leg_parenting_strategy"]

        if not strategy or strategy == "NONE":
            return

        foot_ik = RigService.find_edit_bone_by_name(
            self.which_leg + "_foot_ik", armature_object)
        knee_ik = None
        hip_ik = None

        if has_knee_ik:
            knee_ik = RigService.find_edit_bone_by_name(
                self.which_leg + "_knee_ik", armature_object)

        if has_hip_ik:
            hip_ik = RigService.find_edit_bone_by_name(
                self.which_leg + "_hip_ik", armature_object)

        if strategy == "ROOT":
            root_bone = RigService.find_edit_bone_by_name(
                self.get_root(), armature_object)
            foot_ik.parent = root_bone
            if knee_ik:
                knee_ik.parent = root_bone
            if hip_ik:
                hip_ik.parent = root_bone

        if strategy == "OUTER":
            if knee_ik:
                knee_ik.parent = foot_ik
                if hip_ik:
                    hip_ik.parent = knee_ik

        if strategy == "INNER":
            if knee_ik:
                foot_ik.parent = knee_ik
                if hip_ik:
                    knee_ik.parent = hip_ik

        bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
Ejemplo n.º 4
0
    def execute(self, context):
        _LOG.enter()
        _LOG.debug("click")

        blender_object = context.active_object

        bpy.ops.object.mode_set(mode='EDIT', toggle=False)
        ball_r = RigService.find_edit_bone_by_name("ball_r", blender_object)
        bpy.ops.object.mode_set(mode='OBJECT', toggle=False)

        if not ball_r:
            self.report(
                {'ERROR'},
                "Only the \"Game engine\" skeleton is supported so far")
            return {'FINISHED'}

        bpy.ops.object.transform_apply(location=True,
                                       scale=False,
                                       rotation=False)

        from mpfb.ui.rigify.rigifypanel import RIGIFY_PROPERTIES
        settings = RIGIFY_PROPERTIES.as_dict(entity_reference=context.scene)

        helpers = RigifyHelpers.get_instance(settings)
        helpers.convert_to_rigify(blender_object)

        self.report({'INFO'}, "Converted to rigify")
        return {'FINISHED'}
Ejemplo n.º 5
0
 def _clear_finger_ik(self, finger_number, armature_object):
     _LOG.enter()
     bpy.ops.object.mode_set(mode='EDIT', toggle=False)
     bone_name = self._get_point_ik_bone_name_for_finger(finger_number)
     bone = RigService.find_edit_bone_by_name(bone_name, armature_object)
     _LOG.debug("Point bone to remove, if any", bone)
     if bone:
         armature_object.data.edit_bones.remove(bone)
Ejemplo n.º 6
0
 def _clear_master_grip(self, armature_object):
     bone_name = self._get_master_grip_bone_name()
     bpy.ops.object.mode_set(mode='EDIT', toggle=False)
     bone = RigService.find_edit_bone_by_name(bone_name, armature_object)
     _LOG.debug("Master grip bone to remove, if any", bone)
     if bone:
         armature_object.data.edit_bones.remove(bone)
     bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
Ejemplo n.º 7
0
 def reposition_edit_bone(self):
     """Reposition bones to fit the current state of the basemesh."""
     bpy.ops.object.mode_set(mode='EDIT', toggle=False)
     for bone_name in self.rig_definition.keys():
         bone_info = self.rig_definition[bone_name]
         bone = RigService.find_edit_bone_by_name(bone_name, self.armature_object)
         bone.head = self._get_best_location_from_strategy(bone_info["head"])
         bone.tail = self._get_best_location_from_strategy(bone_info["tail"])
     bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
Ejemplo n.º 8
0
    def _apply_point(self, armature_object):
        _LOG.enter()
        for finger_number in [1, 2, 3, 4, 5]:
            self._create_point_ik_bone(finger_number, armature_object)
            ik_name = self._get_point_ik_bone_name_for_finger(finger_number)

            bpy.ops.object.mode_set(mode='EDIT', toggle=False)

            parent_name = self.get_immediate_parent_name_of_finger(finger_number)
            parent_bone = RigService.find_edit_bone_by_name(parent_name, armature_object)

            ik_bone = RigService.find_edit_bone_by_name(ik_name, armature_object)
            ik_bone.parent = parent_bone

            chain_length = self.get_finger_segment_count(finger_number)
            self._set_finger_ik_target(finger_number, armature_object, chain_length)
            if self.settings["hide_fk"]:
                bones_to_hide = self.get_reverse_list_of_bones_in_finger(finger_number)
                self._hide_bones(armature_object, bones_to_hide)
Ejemplo n.º 9
0
    def update_edit_bone_metadata(self):
        """Assign metadata fitting for the edit bones."""
        bpy.ops.object.mode_set(mode='EDIT', toggle=False)
        for bone_name in self.rig_definition.keys():
            bone_info = self.rig_definition[bone_name]
            bone = RigService.find_edit_bone_by_name(bone_name, self.armature_object)
            if bone_info["parent"]:
                bone.parent = RigService.find_edit_bone_by_name(bone_info["parent"], self.armature_object)
            bone.use_connect = bone_info["use_connect"]
            bone.use_local_location = bone_info["use_local_location"]
            bone.use_inherit_rotation = bone_info["use_inherit_rotation"]
            bone.inherit_scale = bone_info["inherit_scale"]
            if "layers" in bone_info:
                i = 0
                for layer in bone_info["layers"]:
                    bone.layers[i] = layer
                    i = i + 1

        bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
Ejemplo n.º 10
0
    def _create_master_grip_bone(self, armature_object):
        _LOG.enter()

        bpy.ops.object.mode_set(mode='EDIT', toggle=False)

        finger3_tip_name = self.get_last_segment_name_of_finger(3)
        finger4_tip_name = self.get_last_segment_name_of_finger(4)

        finger3_root_name = self.get_first_segment_name_of_finger(3)
        finger4_root_name = self.get_first_segment_name_of_finger(4)

        roll = self._bone_info["edit_bones"][finger3_root_name]["roll"]

        finger3_head = self._bone_info["edit_bones"][finger3_root_name]["head"]
        finger3_tail = self._bone_info["edit_bones"][finger3_tip_name]["tail"]

        finger4_head = self._bone_info["edit_bones"][finger4_root_name]["head"]
        finger4_tail = self._bone_info["edit_bones"][finger4_tip_name]["tail"]

        head = (finger3_head + finger4_head) / 2
        tail = (finger3_tail + finger4_tail) / 2

        bone_name = self._get_master_grip_bone_name()
        bones = armature_object.data.edit_bones
        bone = bones.new(bone_name)
        bone.head = head
        bone.tail = tail
        bone.roll = roll

        parent_name = self.get_immediate_parent_name_of_finger(3)
        parent_bone = RigService.find_edit_bone_by_name(parent_name, armature_object)

        bone.parent = parent_bone

        # Needed to save bone
        bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
        bpy.ops.object.mode_set(mode='POSE', toggle=False)

        pose_bone = RigService.find_pose_bone_by_name(bone_name, armature_object)

        root_bone3 = RigService.find_pose_bone_by_name(finger3_root_name, armature_object)
        root_bone4 = RigService.find_pose_bone_by_name(finger4_root_name, armature_object)

        pose_bone.location = (root_bone3.location + root_bone4.location) / 2

        RigService.display_pose_bone_as_empty(armature_object, bone_name, 'CIRCLE')
        pose_bone.custom_shape_scale = 0.6

        for i in range(3):
            pose_bone.lock_location[i] = True
            pose_bone.lock_scale[i] = True
Ejemplo n.º 11
0
    def execute(self, context):
        _LOG.enter()
        armature_object = context.object

        bpy.ops.object.mode_set(mode='EDIT', toggle=False)
        levator = RigService.find_edit_bone_by_name("levator03.L",
                                                    armature_object)
        bpy.ops.object.mode_set(mode='OBJECT', toggle=False)

        if not levator:
            self.report({
                'ERROR'
            }, "Only the \"Default\" and \"Default no toes\" skeletons are supported so far"
                        )
            return {'FINISHED'}

        from mpfb.ui.righelpers.righelperspanel import SETUP_HELPERS_PROPERTIES  # pylint: disable=C0415
        settings = SETUP_HELPERS_PROPERTIES.as_dict(
            entity_reference=context.scene)

        if "arm_helpers_type" in settings and settings[
                "arm_helpers_type"] and settings["arm_helpers_type"] != "NONE":
            _LOG.debug("Adding arm helpers:", settings["arm_helpers_type"])
            self._arm_helpers(armature_object, settings)
        else:
            _LOG.debug("Not adding arm helpers")

        if "leg_helpers_type" in settings and settings[
                "leg_helpers_type"] and settings["leg_helpers_type"] != "NONE":
            _LOG.debug("Adding leg helpers:", settings["leg_helpers_type"])
            self._leg_helpers(armature_object, settings)
        else:
            _LOG.debug("Not adding leg helpers")

        if "finger_helpers_type" in settings and settings[
                "finger_helpers_type"] and settings[
                    "finger_helpers_type"] != "NONE":
            _LOG.debug("Adding finger helpers:",
                       settings["finger_helpers_type"])
            self._finger_helpers(armature_object, settings)
        else:
            _LOG.debug("Not adding finger helpers")

        if "eye_ik" in settings and settings["eye_ik"]:
            _LOG.debug("Adding eye ik")
            self._eye_helpers(armature_object, settings)
        else:
            _LOG.debug("Not adding eye ik")

        self.report({'INFO'}, "Helpers were added")
        return {'FINISHED'}
Ejemplo n.º 12
0
    def execute(self, context):
        scene = context.scene

        if not ObjectService.object_is_skeleton(context.active_object):
            self.report({'ERROR'}, "Must have armature object selected")
            return {'FINISHED'}

        from mpfb.ui.addrig.addrigpanel import ADD_RIG_PROPERTIES  # pylint: disable=C0415

        armature_object = context.active_object
        delete_after_generate = ADD_RIG_PROPERTIES.get_value(
            "delete_after_generate", entity_reference=scene)

        bpy.ops.pose.rigify_generate()
        rigify_object = context.active_object
        rigify_object.show_in_front = True

        _LOG.debug("rigify", rigify_object)

        for child in ObjectService.get_list_of_children(armature_object):

            child.parent = rigify_object

            for bone in armature_object.data.bones:
                name = bone.name
                if name in child.vertex_groups and not "teeth" in name:
                    vertex_group = child.vertex_groups.get(name)
                    vertex_group.name = "DEF-" + name

            for modifier in child.modifiers:
                if modifier.type == 'ARMATURE':
                    modifier.object = rigify_object

        if delete_after_generate:
            objs = bpy.data.objects
            objs.remove(objs[armature_object.name], do_unlink=True)

        bpy.ops.object.mode_set(mode='EDIT', toggle=False)

        teethb = RigService.find_edit_bone_by_name("teeth.B", rigify_object)
        teethb.use_deform = True

        bpy.ops.object.mode_set(mode='OBJECT', toggle=False)

        self.report({'INFO'}, "A rig was generated")
        return {'FINISHED'}
Ejemplo n.º 13
0
    def _set_use_connect_on_bones(self,
                                  armature_object,
                                  bone_names,
                                  exclude_first=True):
        _LOG.enter()
        bpy.ops.object.mode_set(mode='EDIT', toggle=False)

        if exclude_first:
            bone_names = list(
                bone_names)  # to modify a copy rather than the source list
            bone_names.pop(0)

        for bone_name in bone_names:
            _LOG.debug("About to set use_connect on", bone_name)
            edit_bone = RigService.find_edit_bone_by_name(
                bone_name, armature_object)
            edit_bone.use_connect = True
        bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
Ejemplo n.º 14
0
    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")
Ejemplo n.º 15
0
    def remove_ik(self, armature_object):
        """Remove rig helpers for hips, legs and feet based on the settings that were provided
        when constructing the class, and information about the current status of the
        armature object."""

        _LOG.enter()
        mode = str(
            RigHelpersProperties.get_value(
                "leg_mode", entity_reference=armature_object)).strip()

        _LOG.debug("mode is", mode)

        include_hip = mode == "LOWERUPPERHIP"

        bpy.ops.object.mode_set(mode='POSE', toggle=False)
        bones_to_clear = self.get_reverse_list_of_bones_in_leg(
            True, True, True, include_hip)

        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_leg + "_foot_ik", self.which_leg + "_knee_ik",
            self.which_leg + "_hip_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")
Ejemplo n.º 16
0
    def remove_ik(self, armature_object):
        """Remove rig helpers for eyes based on the settings that were provided
        when constructing the class, and information about the current status of the
        armature object."""

        _LOG.enter()

        bpy.ops.object.mode_set(mode='POSE', toggle=False)

        for bone_name in [self.get_eye_name(True), self.get_eye_name(False)]:
            RigService.remove_all_constraints_from_pose_bone(
                bone_name, armature_object)

        bpy.ops.object.mode_set(mode='EDIT', toggle=False)

        for bone_name in ["left_eye_ik", "right_eye_ik", "eye_ik"]:
            bone = RigService.find_edit_bone_by_name(bone_name,
                                                     armature_object)
            armature_object.data.edit_bones.remove(bone)

        bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
        _LOG.debug("Done")
Ejemplo n.º 17
0
    def execute(self, context):
        scene = context.scene

        if not ObjectService.object_is_basemesh(context.active_object):
            self.report({'ERROR'}, "Rigs can only be added to the base mesh")
            return {'FINISHED'}

        basemesh = context.active_object

        from mpfb.ui.addrig.addrigpanel import ADD_RIG_PROPERTIES  # pylint: disable=C0415

        import_weights = ADD_RIG_PROPERTIES.get_value("import_weights_rigify",
                                                      entity_reference=scene)
        generate = ADD_RIG_PROPERTIES.get_value("generate",
                                                entity_reference=scene)
        delete_after_generate = ADD_RIG_PROPERTIES.get_value(
            "delete_after_generate", entity_reference=scene)

        rigs_dir = LocationService.get_mpfb_data("rigs")
        rigify_dir = os.path.join(rigs_dir, "rigify")

        rig_file = os.path.join(rigify_dir, "rig.human.json")

        rig = Rig.from_json_file_and_basemesh(rig_file, basemesh)
        armature_object = rig.create_armature_and_fit_to_basemesh()
        armature_object.data.rigify_rig_basename = "Human.rigify"

        rigify_ui = dict()
        layer_file = os.path.join(rigify_dir, "rigify_layers.json")

        with open(layer_file, "r") as json_file:
            rigify_ui = json.load(json_file)

        bpy.ops.armature.rigify_add_bone_groups()
        bpy.ops.pose.rigify_layer_init()

        armature_object.data.rigify_colors_lock = rigify_ui[
            "rigify_colors_lock"]
        armature_object.data.rigify_selection_colors.select = rigify_ui[
            "selection_colors"]["select"]
        armature_object.data.rigify_selection_colors.active = rigify_ui[
            "selection_colors"]["active"]

        i = 0
        for color in armature_object.data.rigify_colors:
            col = rigify_ui["colors"][i]
            color.name = col["name"]
            color.normal = col["normal"]
            i = i + 1

        i = 0
        for rigify_layer in armature_object.data.layers:
            armature_object.data.layers[i] = rigify_ui["layers"][i]
            i = i + 1

        i = 0
        for rigify_layer in armature_object.data.rigify_layers:
            layer = rigify_ui["rigify_layers"][i]
            rigify_layer.name = layer["name"]
            rigify_layer.row = layer["row"]
            rigify_layer.selset = layer["selset"]
            rigify_layer.group = layer["group"]
            i = i + 1

        if not generate:
            basemesh.parent = armature_object

        if import_weights:
            weights_file = os.path.join(rigify_dir, "weights.human.json")
            weights = dict()
            with open(weights_file, 'r') as json_file:
                weights = json.load(json_file)
            RigService.apply_weights(armature_object, basemesh, weights)

        if generate:
            bpy.ops.pose.rigify_generate()
            rigify_object = context.active_object
            rigify_object.show_in_front = True

            _LOG.debug("rigify", rigify_object)
            basemesh.parent = rigify_object

            for bone in armature_object.data.bones:
                name = bone.name
                if name in basemesh.vertex_groups and not "teeth" in name:
                    vertex_group = basemesh.vertex_groups.get(name)
                    vertex_group.name = "DEF-" + name

            for modifier in basemesh.modifiers:
                if modifier.type == 'ARMATURE':
                    modifier.object = rigify_object

            if delete_after_generate:
                objs = bpy.data.objects
                objs.remove(objs[armature_object.name], do_unlink=True)

            bpy.ops.object.mode_set(mode='EDIT', toggle=False)

            teethb = RigService.find_edit_bone_by_name("teeth.B",
                                                       rigify_object)
            teethb.use_deform = True

            bpy.ops.object.mode_set(mode='OBJECT', toggle=False)

        self.report({'INFO'}, "A rig was added")
        return {'FINISHED'}
Ejemplo n.º 18
0
    def _create_eye_ik_bones(self, armature_object):
        _LOG.enter()

        bpy.ops.object.mode_set(mode='EDIT', toggle=False)

        bones = armature_object.data.edit_bones

        for side in ["left", "right"]:
            is_right = side == "right"
            bone_name = self.get_eye_name(is_right)

            bone = bones.new(side + "_eye_ik")
            head = self._bone_info["pose_bones"][bone_name]["head"]
            tail = self._bone_info["pose_bones"][bone_name]["tail"]
            length = tail - head

            bone.head = head + length * 4
            bone.tail = tail = tail + length * 4
            bone.roll = self._bone_info["edit_bones"][bone_name]["roll"]

        left_eye_bone = RigService.find_edit_bone_by_name(
            "left_eye_ik", armature_object)
        right_eye_bone = RigService.find_edit_bone_by_name(
            "right_eye_ik", armature_object)

        bone = bones.new("eye_ik")
        bone.head = (left_eye_bone.head + right_eye_bone.head) / 2
        bone.tail = (left_eye_bone.tail + right_eye_bone.tail) / 2
        bone.roll = left_eye_bone.roll

        left_eye_bone.parent = bone
        right_eye_bone.parent = bone

        if self.settings["eye_parenting_strategy"] == "HEAD":
            bone.parent = RigService.find_edit_bone_by_name(
                self.get_head_name(), armature_object)

        if self.settings["eye_parenting_strategy"] == "ROOT":
            bone.parent = RigService.find_edit_bone_by_name(
                self.get_root_name(), armature_object)

        # Needed to save bone
        bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
        bpy.ops.object.mode_set(mode='POSE', toggle=False)

        RigService.display_pose_bone_as_empty(armature_object,
                                              "left_eye_ik",
                                              "CIRCLE",
                                              scale=0.5)
        RigService.display_pose_bone_as_empty(armature_object,
                                              "right_eye_ik",
                                              "CIRCLE",
                                              scale=0.5)
        RigService.display_pose_bone_as_empty(armature_object,
                                              "eye_ik",
                                              "CIRCLE",
                                              scale=1.4)

        for side in ["left", "right"]:
            pose_bone = RigService.find_pose_bone_by_name(
                side + "_eye_ik", armature_object)
            for i in range(3):
                pose_bone.lock_rotation[i] = True
                pose_bone.lock_scale[i] = True