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