Exemplo n.º 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)
Exemplo n.º 2
0
Arquivo: Set.py Projeto: Irmitya/zpy
 def rotation_quaternion(context, x):
     Get.cursor(context).rotation_quaternion = x
Exemplo n.º 3
0
Arquivo: Set.py Projeto: Irmitya/zpy
 def rotation_mode(context, x):
     Get.cursor(context).rotation_mode = x
Exemplo n.º 4
0
Arquivo: Set.py Projeto: Irmitya/zpy
 def rotation_euler(context, x):
     Get.cursor(context).rotation_euler = x
Exemplo n.º 5
0
Arquivo: Set.py Projeto: Irmitya/zpy
 def rotation_axis_angle(context, x):
     Get.cursor(context).rotation_axis_angle = x
Exemplo n.º 6
0
Arquivo: Set.py Projeto: Irmitya/zpy
 def location(context, x):
     Get.cursor(context).location = x