Pose Shape Keys: Major Update #321
@ -1,7 +1,7 @@
|
|||||||
import bpy
|
import bpy
|
||||||
from bpy.types import Object, Operator
|
from bpy.types import Object, Operator
|
||||||
from bpy.props import StringProperty, BoolProperty
|
from bpy.props import StringProperty, BoolProperty
|
||||||
from mathutils import Vector, Euler
|
from mathutils import Vector, Euler, Quaternion
|
||||||
from math import sqrt
|
from math import sqrt
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
|
||||||
@ -907,10 +907,15 @@ class OBJECT_OT_pose_key_magic_driver(Operator):
|
|||||||
bone_channels['rot'].append((axis.upper(), value))
|
bone_channels['rot'].append((axis.upper(), value))
|
||||||
channels[pb.name] = bone_channels
|
channels[pb.name] = bone_channels
|
||||||
else:
|
else:
|
||||||
# Quat/etc: Add variables for all 3 axes.
|
if pb.rotation_mode == 'QUATERNION':
|
||||||
euler_rot = pb.matrix_channel.to_euler()
|
euler_rot = pb.rotation_quaternion.to_euler()
|
||||||
|
elif pb.rotation_mode == 'AXIS_ANGLE':
|
||||||
|
quat = Quaternion(Vector(pb.rotation_axis_angle).yzw, pb.rotation_axis_angle[0])
|
||||||
|
euler_rot = quat.to_euler()
|
||||||
|
|
||||||
if euler_rot != Euler((0, 0, 0)):
|
if euler_rot != Euler((0, 0, 0)):
|
||||||
value = getattr(euler_rot, axis)
|
value = getattr(euler_rot, axis)
|
||||||
|
if abs(value) > 0.00001:
|
||||||
bone_channels['rot'].append((axis.upper(), value))
|
bone_channels['rot'].append((axis.upper(), value))
|
||||||
channels[pb.name] = bone_channels
|
channels[pb.name] = bone_channels
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user