Пример #1
0
    def add_bones_bone(self, context, rig):
        # Add bones then set their defaults
        root = self.get_root(rig)
        prev_bones = self.get_prev_bones(rig)
        bone = rig.data.edit_bones.new('Bone')
        bone.parent = root

        bone.translate(
            Vector(
                utils.multiply_list(
                    Get.cursor(context).location,
                    rig.matrix_world.inverted().to_scale(
                    ),  # Get the transforms for the unscaled rig
                )) - rig.matrix_world.to_translation())

        # Use the original bone size (unscaled by the rig)
        bone.tail = bone.head + Vector(
            utils.multiply_list(
                Vector((0, 0, 0.1)),
                rig.matrix_world.inverted().to_scale(),
            )) - rig.matrix_world.to_translation()

        bone = str(bone.name)

        # Switch back to Pose mode and setup pose bones
        Set.mode(context, 'POSE', rig)

        bone = rig.data.bones[bone]
        rig.data.bones.active = bone
        Set.select(bone)
Пример #2
0
Файл: Set.py Проект: Irmitya/zpy
 def rotation_quaternion(context, x):
     Get.cursor(context).rotation_quaternion = x
Пример #3
0
Файл: Set.py Проект: Irmitya/zpy
 def rotation_mode(context, x):
     Get.cursor(context).rotation_mode = x
Пример #4
0
Файл: Set.py Проект: Irmitya/zpy
 def rotation_euler(context, x):
     Get.cursor(context).rotation_euler = x
Пример #5
0
Файл: Set.py Проект: Irmitya/zpy
 def rotation_axis_angle(context, x):
     Get.cursor(context).rotation_axis_angle = x
Пример #6
0
Файл: Set.py Проект: Irmitya/zpy
 def location(context, x):
     Get.cursor(context).location = x