Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import bpy
- import mathutils
- ob = bpy.context.object
- sce = bpy.context.scene
- if ob.type == 'ARMATURE':
- armature = ob.data
- pose = sce.objects.active.pose
- for bone in armature.bones:
- if "spine" in bone.name or "neck" in bone.name or "head" in bone.name or "pelvis" in bone.name:
- print(bone.name , " : " , bone.vector.x)
- boneRot = pose.bones[bone.name].rotation_quaternion.to_euler()
- print(pose.bones[bone.name].rotation_quaternion)
- print(boneRot)
- #Comment/Uncomment to select Axis to flip
- #X-Axis
- boneRot[0] *= -1
- #Y-Axis
- boneRot[1] *= -1
- #Z-Axis
- boneRot[2] *= -1
- print(boneRot)
- pose.bones[bone.name].rotation_quaternion = boneRot.to_quaternion()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement