[Bf-blender-cvs] [5e12a5622c4] temp-nla-strip-alignment: - bugfix: fixed the scaling problem. Was due to not normalizing quaternion after reading from fcurves

Wayde Moss noreply at git.blender.org
Thu Dec 10 06:13:39 CET 2020


Commit: 5e12a5622c466d4e1e9f7fa9c62b72d083fc0fcc
Author: Wayde Moss
Date:   Sun Nov 29 15:53:54 2020 -0500
Branches: temp-nla-strip-alignment
https://developer.blender.org/rB5e12a5622c466d4e1e9f7fa9c62b72d083fc0fcc

- bugfix: fixed the scaling problem. Was due to not normalizing quaternion after reading from fcurves

===================================================================

M	release/scripts/startup/bl_ui/properties_nla.py
M	source/blender/blenkernel/intern/anim_sys.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/properties_nla.py b/release/scripts/startup/bl_ui/properties_nla.py
index b1e78f8613e..262b16caa84 100644
--- a/release/scripts/startup/bl_ui/properties_nla.py
+++ b/release/scripts/startup/bl_ui/properties_nla.py
@@ -122,8 +122,8 @@ class OBJECT_PT_nla_alignment(Panel):
 
 
         layout.prop(active_strip,"name")
-        layout.prop(active_strip,"action")
-        layout.prop(active_strip,"blend_transforms")
+        # layout.prop(active_strip,"action")
+        # layout.prop(active_strip,"blend_transforms")
         
         # layout.prop(active_strip,"frame_start")
         # layout.prop(context.active_object,"location")
@@ -133,8 +133,8 @@ class OBJECT_PT_nla_alignment(Panel):
         #     if(c):
         #         layout.prop(c[0],'type')
         layout.operator(OBJECT_OT_nla_add_blend.bl_idname,text='New Transform',icon='ADD')
-        box = layout.box()
         for i,blend in enumerate(active_strip.blend_transforms):
+            box = layout.box()
             row = box.row(align=True)
             row.label(text="World Transform")
             row.operator(OBJECT_OT_nla_remove_blend.bl_idname,text='',icon='REMOVE').blend_index = i 
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index 51b6d0b7c57..7e281c8f47e 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -3169,7 +3169,8 @@ void nlastrip_evaluate(PointerRNA *ptr,
       float raw_snapshot_matrix[4][4];
       float decomposed_quat[4];
       switch (pose_channel->rotmode) {
-        case ROT_MODE_QUAT:
+        case ROT_MODE_QUAT: {
+
           // todo:... large error for some reason here? Maybe its a separate IK issue?
           // (seems fine with FK blends, but when I use the same animation with IK i get scealing
           // issues.)
@@ -3193,6 +3194,7 @@ void nlastrip_evaluate(PointerRNA *ptr,
           //  scale with be non-one afterward even if scale is one every  where else...
           // maybe it would be better to manually do scaling since its only affected by blend
           // xform's scale? but would error lead to issues with rotation and location?
+          normalize_qt(rotation_values);
           loc_quat_size_to_mat4(
               raw_snapshot_matrix, location_values, rotation_values, scale_values);
           mul_m4_m4m4(raw_snapshot_matrix, bone_blend_matrix, raw_snapshot_matrix);
@@ -3209,9 +3211,10 @@ void nlastrip_evaluate(PointerRNA *ptr,
           mat4_to_size(scale_values, raw_snapshot_matrix);  //...why is this 1.0 as expected.. but
                                                             // blender shows .8 for scale??(hips)
           // mat4_decompose(location_values, rotation_values, scale_values, raw_snapshot_matrix);
-
           break;
-        case ROT_MODE_AXISANGLE:
+        }
+        case ROT_MODE_AXISANGLE: {
+
           loc_axisangle_size_to_mat4(raw_snapshot_matrix,
                                      location_values,
                                      rotation_values,
@@ -3221,13 +3224,14 @@ void nlastrip_evaluate(PointerRNA *ptr,
           mat4_decompose(location_values, decomposed_quat, scale_values, raw_snapshot_matrix);
           quat_to_axis_angle(rotation_values, &rotation_values[3], decomposed_quat);
           break;
-        default:
+        }
+        default: {
           loc_eul_size_to_mat4(
               raw_snapshot_matrix, location_values, rotation_values, scale_values);
           mul_m4_m4m4(raw_snapshot_matrix, bone_blend_matrix, raw_snapshot_matrix);
           quat_to_eul(rotation_values, decomposed_quat);
-
           break;
+        }
       }
 
       MEM_freeN(location_path);  // todo: verify correct call



More information about the Bf-blender-cvs mailing list