[Bf-blender-cvs] [188dc880c6f] temp-nla-strip-alignment: - clean up formatting and obselete comments

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


Commit: 188dc880c6fea911dad840596f508696c9777c25
Author: Wayde Moss
Date:   Wed Dec 9 23:50:17 2020 -0500
Branches: temp-nla-strip-alignment
https://developer.blender.org/rB188dc880c6fea911dad840596f508696c9777c25

- clean up formatting and obselete comments

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

M	source/blender/blenkernel/intern/anim_sys.c

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

diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index 894761218e0..7d44c61d516 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -3132,13 +3132,6 @@ void nlastrip_evaluate(PointerRNA *ptr,
       float bone_blend_matrix[4][4];
       mul_m4_m4m4(bone_blend_matrix, rest_matrix_inv, world);
       mul_m4_m4m4(bone_blend_matrix, bone_blend_matrix, rest_matrix);
-      // copy_m4_m4(bone_blend_matrix, world);
-      // BKE_constraint_mat_convertspace(object,
-      //                                pose_channel,
-      //                                bone_blend_matrix,
-      //                                CONSTRAINT_SPACE_WORLD,
-      //                                CONSTRAINT_SPACE_LOCAL,
-      //                                false);
 
       char *location_path = BLI_sprintfN("pose.bones[\"%s\"].location", name_esc);
       NlaEvalChannel *location_channel = nlaevalchan_verify(ptr, channels, location_path);
@@ -3172,29 +3165,6 @@ void nlastrip_evaluate(PointerRNA *ptr,
       switch (pose_channel->rotmode) {
         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.)
-          //...but I doi think there may be a memory leak caused by this patch?
-
-          //..l.but when I use a non-NLA anim eval (full replace Action track) then everything
-          // works fine...
-          //..whats going on??? (nvm other strips ahd scale channels)
-          //    --but seems to occur when strip with preblend xform doens't have the scale
-          //    channels? After adding scale channels then it works fine? What if
-          //    nlaeevalchan_verify() keeps the path str key and assumes it survived (this isn't it
-          //    since not freeing memory doesnt solve it)
-          //        -can't be verify() func since problem still exists if other strips have scale
-          //        channels, thus it already exists. maybe its  a depsgraph issue? There is no
-          //        deps created for the blended scale channels despite it making changes-seems
-          //        unliekly?-still, blend xforms should still work if strip itself doesn't have
-          //        the channels. Notably, even if blend xform has scvale=2, then hips won't show
-          //        up in properties as having 2.0 scale, which is weird..,and why is this not a
-          //        problem for FK? (maybe the bake creates scale channels?)
-          //
-          //  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);
@@ -3202,16 +3172,8 @@ void nlastrip_evaluate(PointerRNA *ptr,
 
           copy_v3_v3(location_values, raw_snapshot_matrix[3]);
           mat4_to_quat(rotation_values, raw_snapshot_matrix);
-          //***********
-          //***IF SCALE NOT PART OF NLA DOMAIN, then it leads to serious scale errors?
-          // And the solution is literally to add scale channels in the dopesheet, then its 100%
-          // fine?
-          //...but why is this even a problem??!?!?
-          //...wait...if scale is not part of domain.. then why did it ever work in the viewport?
-          //  at what point was it being written back to the bone????
-          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);
+          mat4_to_size(scale_values, raw_snapshot_matrix);
+
           break;
         }
         case ROT_MODE_AXISANGLE: {
@@ -3293,8 +3255,8 @@ void nlastrip_evaluate_invert_get_lower_values(PointerRNA *ptr,
 }
 
 /* Evaluates strip without blending, stored within snapshot. NLAEvalChannelSnapshot
- * raw_value_sampled bits are set for channels sampled. This is only called by transition's
- * invert function. */
+ * raw_value_sampled bits are set for channels sampled. This is only called by transition's invert
+ * function. */
 void nlastrip_evaluate_raw_value(PointerRNA *ptr,
                                  NlaEvalData *upper_eval_data,
                                  ListBase *modifiers,
@@ -3326,9 +3288,9 @@ void nlastrip_evaluate_raw_value(PointerRNA *ptr,
       break;
     case NLASTRIP_TYPE_TRANSITION:
       /*
-       * If nes is eventually a transition, then nothing is written and no value bitmask is
-       * set. This matches the existing behavior that adjacent transitions evaluate to default
-       * (lower snapshot or property type default).
+       * If nes is eventually a transition, then nothing is written and no value bitmask is set.
+       * This matches the existing behavior that adjacent transitions evaluate to default (lower
+       * snapshot or property type default).
        *
        * In normal cases, this case should never happen. This is only called by
        * nlastrip_evaluate_transition_invert_get_lower_values() and transitions never reference
@@ -3370,8 +3332,8 @@ void nladata_flush_channels(PointerRNA *ptr,
   LISTBASE_FOREACH (NlaEvalChannel *, nec, &channels->channels) {
     /**
      * The bitmask is set for all channels touched by NLA due to the domain() function.
-     * Channels touched by current set of evaluated strips will have a snapshot channel
-     * directly from the evaluation snapshot.
+     * Channels touched by current set of evaluated strips will have a snapshot channel directly
+     * from the evaluation snapshot.
      *
      * This function falls back to the default value if the snapshot channel doesn't exist.
      * Thus channels, touched by NLA but not by the current set of evaluated strips, will be
@@ -3421,12 +3383,6 @@ static void nla_eval_domain_action(PointerRNA *ptr,
 
     NlaEvalChannel *nec = nlaevalchan_verify(ptr, channels, fcu->rna_path);
 
-    NlaEvalChannel *scale_channel = nlaevalchan_verify(
-        ptr, channels, "pose.bones[\"Hips\"].scale");
-    if (nec == scale_channel) {
-      nec->is_array = scale_channel->is_array;
-    }
-
     if (nec != NULL) {
       /* For quaternion properties, enable all sub-channels. */
       if (nec->mix_mode == NEC_MIX_QUATERNION) {
@@ -3580,9 +3536,8 @@ static void nonstrip_action_fill_strip_data(const AnimData *adt,
    * and this setting doesn't work. */
   action_strip->flag |= NLASTRIP_FLAG_USR_INFLUENCE;
 
-  /* Unless extendmode is Nothing (might be useful for flattening NLA evaluation), disable
-   * range. Extendmode Nothing and Hold will behave as normal. Hold Forward will behave just
-   * like Hold.
+  /* Unless extendmode is Nothing (might be useful for flattening NLA evaluation), disable range.
+   * Extendmode Nothing and Hold will behave as normal. Hold Forward will behave just like Hold.
    */
   if (action_strip->extendmode != NLASTRIP_EXTEND_NOTHING) {
     action_strip->flag |= NLASTRIP_FLAG_NO_TIME_MAP;
@@ -3630,8 +3585,8 @@ bool is_nlatrack_evaluatable(const AnimData *adt, const NlaTrack *nlt)
   return true;
 }
 
-/** Check for special case of non-pushed action being evaluated with no NLA influence (off and
- * no strips evaluated) nor NLA interference (ensure NLA not soloing). */
+/** Check for special case of non-pushed action being evaluated with no NLA influence (off and no
+ * strips evaluated) nor NLA interference (ensure NLA not soloing). */
 static bool is_nonstrip_action_evaluated_without_nla(const AnimData *adt,
                                                      const bool any_strip_evaluated)
 {
@@ -3645,12 +3600,11 @@ static bool is_nonstrip_action_evaluated_without_nla(const AnimData *adt,
 }
 
 /** XXX Wayde Moss: BKE_nlatrack_find_tweaked() exists within nla.c, but it doesn't appear to
- * work as expected. From animsys_evaluate_nla_for_flush(), it returns NULL in tweak mode. I'm
- * not sure why. Preferably, it would be as simple as checking for (adt->act_Track == nlt) but
- * that doesn't work either, neither does comparing indices.
+ * work as expected. From animsys_evaluate_nla_for_flush(), it returns NULL in tweak mode. I'm not
+ * sure why. Preferably, it would be as simple as checking for (adt->act_Track == nlt) but that
+ * doesn't work either, neither does comparing indices.
  *
- *  This function is a temporary work around. The first disabled track is always the tweaked
- * track.
+ *  This function is a temporary work around. The first disabled track is always the tweaked track.
  */
 static NlaTrack *nlatrack_find_tweaked(const AnimData *adt)
 {
@@ -3728,58 +3682,6 @@ static bool animsys_evaluate_nla_for_flush(NlaEvalData *echannels,
   nonstrip_action_fill_strip_data(adt, &action_strip, false);
   nlastrips_ctime_get_strip_single(&estrips, &action_strip, anim_eval_context, flush_to_original);
 
-  /*
-   * create and group loc/rot/scale nla channels for blend bones
-   *  -need to also calc blend xform in bone's local space (blend transform in world
-  (pose?)
-   *      space, need it in bone local space) use convert_space?
-   *
-   *
-   * Q: how to get pchan_index from bone name?
-      bPoseChannel *BKE_pose_channel_find_name(const bPose *pose, const char *name)
-  bPoseChannel *pchan = pose_pchan_get_indexed(object, pchan_index);
-
-  BKE_constraint_mat_convertspace(ob, pchan, (float(*)[4])mat_ret, from, to, false);
-
-   * will also have to compute each strip into raw-value snapshots.
-   *
-   * before blending snapshot wtih lower, we apply blend transforms -use blend
-   * grouped data
-   * ______
-   *
-   * Prep:
-   *    1) Get all strips that will evaluate on current frame.
-   *    2) Create and group specified bones' nla channels. This is used to conveniently get
-  

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list