Cleanup: rename the curveInX etc bbone DNA fields to curve_in_x etc.
authorAlexander Gavrilov <angavrilov@gmail.com>
Tue, 23 Apr 2019 10:15:30 +0000 (13:15 +0300)
committerAlexander Gavrilov <angavrilov@gmail.com>
Tue, 23 Apr 2019 10:45:04 +0000 (13:45 +0300)
15 files changed:
source/blender/blenkernel/BKE_armature.h
source/blender/blenkernel/intern/action.c
source/blender/blenkernel/intern/armature.c
source/blender/draw/intern/draw_armature.c
source/blender/editors/armature/armature_add.c
source/blender/editors/armature/armature_intern.h
source/blender/editors/armature/armature_utils.c
source/blender/editors/armature/pose_transform.c
source/blender/editors/armature/pose_utils.c
source/blender/editors/include/ED_armature.h
source/blender/editors/space_view3d/view3d_gizmo_armature.c
source/blender/makesdna/DNA_action_types.h
source/blender/makesdna/DNA_armature_types.h
source/blender/makesdna/intern/dna_rename_defs.h
source/blender/makesrna/intern/rna_armature.c

index 366fdc0..267617e 100644 (file)
@@ -208,7 +208,7 @@ typedef struct BBoneSplineParameters {
   float ease1, ease2;
   float roll1, roll2;
   float scale_in_x, scale_in_y, scale_out_x, scale_out_y;
-  float curveInX, curveInY, curveOutX, curveOutY;
+  float curve_in_x, curve_in_y, curve_out_x, curve_out_y;
 } BBoneSplineParameters;
 
 void BKE_pchan_bbone_handles_get(struct bPoseChannel *pchan,
index 59e279d..8e9158b 100644 (file)
@@ -1408,8 +1408,8 @@ void BKE_pose_rest(bPose *pose)
     pchan->size[0] = pchan->size[1] = pchan->size[2] = 1.0f;
 
     pchan->roll1 = pchan->roll2 = 0.0f;
-    pchan->curveInX = pchan->curveInY = 0.0f;
-    pchan->curveOutX = pchan->curveOutY = 0.0f;
+    pchan->curve_in_x = pchan->curve_in_y = 0.0f;
+    pchan->curve_out_x = pchan->curve_out_y = 0.0f;
     pchan->ease1 = pchan->ease2 = 0.0f;
     pchan->scale_in_x = pchan->scale_in_y = 1.0f;
     pchan->scale_out_x = pchan->scale_out_y = 1.0f;
@@ -1434,10 +1434,10 @@ void BKE_pose_copyesult_pchan_result(bPoseChannel *pchanto, const bPoseChannel *
 
   pchanto->roll1 = pchanfrom->roll1;
   pchanto->roll2 = pchanfrom->roll2;
-  pchanto->curveInX = pchanfrom->curveInX;
-  pchanto->curveInY = pchanfrom->curveInY;
-  pchanto->curveOutX = pchanfrom->curveOutX;
-  pchanto->curveOutY = pchanfrom->curveOutY;
+  pchanto->curve_in_x = pchanfrom->curve_in_x;
+  pchanto->curve_in_y = pchanfrom->curve_in_y;
+  pchanto->curve_out_x = pchanfrom->curve_out_x;
+  pchanto->curve_out_y = pchanfrom->curve_out_y;
   pchanto->ease1 = pchanfrom->ease1;
   pchanto->ease2 = pchanfrom->ease2;
   pchanto->scale_in_x = pchanfrom->scale_in_x;
index 3dd655e..531c179 100644 (file)
@@ -686,11 +686,11 @@ void BKE_pchan_bbone_spline_params_get(struct bPoseChannel *pchan,
     param->scale_out_y = bone->scale_out_y * (!rest ? pchan->scale_out_y : 1.0f);
 
     /* Extra curve x / y */
-    param->curveInX = bone->curveInX + (!rest ? pchan->curveInX : 0.0f);
-    param->curveInY = bone->curveInY + (!rest ? pchan->curveInY : 0.0f);
+    param->curve_in_x = bone->curve_in_x + (!rest ? pchan->curve_in_x : 0.0f);
+    param->curve_in_y = bone->curve_in_y + (!rest ? pchan->curve_in_y : 0.0f);
 
-    param->curveOutX = bone->curveOutX + (!rest ? pchan->curveOutX : 0.0f);
-    param->curveOutY = bone->curveOutY + (!rest ? pchan->curveOutY : 0.0f);
+    param->curve_out_x = bone->curve_out_x + (!rest ? pchan->curve_out_x : 0.0f);
+    param->curve_out_y = bone->curve_out_y + (!rest ? pchan->curve_out_y : 0.0f);
   }
 }
 
@@ -816,11 +816,11 @@ void BKE_pchan_bbone_handles_compute(const BBoneSplineParameters *param,
     const float xscale_correction = (param->do_scale) ? param->scale[0] : 1.0f;
     const float yscale_correction = (param->do_scale) ? param->scale[2] : 1.0f;
 
-    h1[0] += param->curveInX * xscale_correction;
-    h1[2] += param->curveInY * yscale_correction;
+    h1[0] += param->curve_in_x * xscale_correction;
+    h1[2] += param->curve_in_y * yscale_correction;
 
-    h2[0] += param->curveOutX * xscale_correction;
-    h2[2] += param->curveOutY * yscale_correction;
+    h2[0] += param->curve_out_x * xscale_correction;
+    h2[2] += param->curve_out_y * yscale_correction;
   }
 }
 
index bd2fa1d..7d1f056 100644 (file)
@@ -1116,11 +1116,11 @@ static void ebone_spline_preview(EditBone *ebone, float result_array[MAX_BBONE_S
   param.scale_out_x = ebone->scale_out_x;
   param.scale_out_y = ebone->scale_out_y;
 
-  param.curveInX = ebone->curveInX;
-  param.curveInY = ebone->curveInY;
+  param.curve_in_x = ebone->curve_in_x;
+  param.curve_in_y = ebone->curve_in_y;
 
-  param.curveOutX = ebone->curveOutX;
-  param.curveOutY = ebone->curveOutY;
+  param.curve_out_x = ebone->curve_out_x;
+  param.curve_out_y = ebone->curve_out_y;
 
   ebone->segments = BKE_pchan_bbone_spline_compute(&param, false, (Mat4 *)result_array);
 }
index 2e14595..d02e58d 100644 (file)
@@ -79,10 +79,10 @@ EditBone *ED_armature_ebone_add(bArmature *arm, const char *name)
   /* Bendy-Bone parameters */
   bone->roll1 = 0.0f;
   bone->roll2 = 0.0f;
-  bone->curveInX = 0.0f;
-  bone->curveInY = 0.0f;
-  bone->curveOutX = 0.0f;
-  bone->curveOutY = 0.0f;
+  bone->curve_in_x = 0.0f;
+  bone->curve_in_y = 0.0f;
+  bone->curve_out_x = 0.0f;
+  bone->curve_out_y = 0.0f;
   bone->ease1 = 1.0f;
   bone->ease2 = 1.0f;
   bone->scale_in_x = 1.0f;
@@ -992,10 +992,10 @@ static int armature_extrude_exec(bContext *C, wmOperator *op)
             /* Bendy-Bone parameters */
             newbone->roll1 = ebone->roll1;
             newbone->roll2 = ebone->roll2;
-            newbone->curveInX = ebone->curveInX;
-            newbone->curveInY = ebone->curveInY;
-            newbone->curveOutX = ebone->curveOutX;
-            newbone->curveOutY = ebone->curveOutY;
+            newbone->curve_in_x = ebone->curve_in_x;
+            newbone->curve_in_y = ebone->curve_in_y;
+            newbone->curve_out_x = ebone->curve_out_x;
+            newbone->curve_out_y = ebone->curve_out_y;
             newbone->ease1 = ebone->ease1;
             newbone->ease2 = ebone->ease2;
             newbone->scale_in_x = ebone->scale_in_x;
index f5833e0..4aed421 100644 (file)
@@ -162,8 +162,8 @@ typedef struct tPChanFCurveLink {
   /** old bbone values (to be restored along with the transform properties) */
   float roll1, roll2;
   /** (NOTE: we haven't renamed these this time, as their names are already long enough) */
-  float curveInX, curveInY;
-  float curveOutX, curveOutY;
+  float curve_in_x, curve_in_y;
+  float curve_out_x, curve_out_y;
   float ease1, ease2;
   float scale_in_x, scale_in_y;
   float scale_out_x, scale_out_y;
index 29e90ea..fb3fb31 100644 (file)
@@ -390,7 +390,7 @@ void ED_armature_edit_transform_mirror_update(Object *obedit)
           eboflip->tail[2] = ebo->tail[2];
           eboflip->rad_tail = ebo->rad_tail;
           eboflip->roll = -ebo->roll;
-          eboflip->curveOutX = -ebo->curveOutX;
+          eboflip->curve_out_x = -ebo->curve_out_x;
           eboflip->roll2 = -ebo->roll2;
 
           /* Also move connected children, in case children's name aren't mirrored properly */
@@ -407,7 +407,7 @@ void ED_armature_edit_transform_mirror_update(Object *obedit)
           eboflip->head[2] = ebo->head[2];
           eboflip->rad_head = ebo->rad_head;
           eboflip->roll = -ebo->roll;
-          eboflip->curveInX = -ebo->curveInX;
+          eboflip->curve_in_x = -ebo->curve_in_x;
           eboflip->roll1 = -ebo->roll1;
 
           /* Also move connected parent, in case parent's name isn't mirrored properly */
@@ -423,8 +423,8 @@ void ED_armature_edit_transform_mirror_update(Object *obedit)
           eboflip->xwidth = ebo->xwidth;
           eboflip->zwidth = ebo->zwidth;
 
-          eboflip->curveInX = -ebo->curveInX;
-          eboflip->curveOutX = -ebo->curveOutX;
+          eboflip->curve_in_x = -ebo->curve_in_x;
+          eboflip->curve_out_x = -ebo->curve_out_x;
           eboflip->roll1 = -ebo->roll1;
           eboflip->roll2 = -ebo->roll2;
         }
@@ -496,10 +496,10 @@ static EditBone *make_boneList_rec(ListBase *edbo,
     /* Bendy-Bone parameters */
     eBone->roll1 = curBone->roll1;
     eBone->roll2 = curBone->roll2;
-    eBone->curveInX = curBone->curveInX;
-    eBone->curveInY = curBone->curveInY;
-    eBone->curveOutX = curBone->curveOutX;
-    eBone->curveOutY = curBone->curveOutY;
+    eBone->curve_in_x = curBone->curve_in_x;
+    eBone->curve_in_y = curBone->curve_in_y;
+    eBone->curve_out_x = curBone->curve_out_x;
+    eBone->curve_out_y = curBone->curve_out_y;
     eBone->ease1 = curBone->ease1;
     eBone->ease2 = curBone->ease2;
     eBone->scale_in_x = curBone->scale_in_x;
@@ -708,10 +708,10 @@ void ED_armature_from_edit(Main *bmain, bArmature *arm)
     /* Bendy-Bone parameters */
     newBone->roll1 = eBone->roll1;
     newBone->roll2 = eBone->roll2;
-    newBone->curveInX = eBone->curveInX;
-    newBone->curveInY = eBone->curveInY;
-    newBone->curveOutX = eBone->curveOutX;
-    newBone->curveOutY = eBone->curveOutY;
+    newBone->curve_in_x = eBone->curve_in_x;
+    newBone->curve_in_y = eBone->curve_in_y;
+    newBone->curve_out_x = eBone->curve_out_x;
+    newBone->curve_out_y = eBone->curve_out_y;
     newBone->ease1 = eBone->ease1;
     newBone->ease2 = eBone->ease2;
     newBone->scale_in_x = eBone->scale_in_x;
index 03984bf..6207d54 100644 (file)
@@ -162,10 +162,10 @@ static int apply_armature_pose2bones_exec(bContext *C, wmOperator *op)
      */
     if (pchan->bone->segments > 1) {
       /* combine rest/pose values  */
-      curbone->curveInX += pchan_eval->curveInX;
-      curbone->curveInY += pchan_eval->curveInY;
-      curbone->curveOutX += pchan_eval->curveOutX;
-      curbone->curveOutY += pchan_eval->curveOutY;
+      curbone->curve_in_x += pchan_eval->curve_in_x;
+      curbone->curve_in_y += pchan_eval->curve_in_y;
+      curbone->curve_out_x += pchan_eval->curve_out_x;
+      curbone->curve_out_y += pchan_eval->curve_out_y;
       curbone->roll1 += pchan_eval->roll1;
       curbone->roll2 += pchan_eval->roll2;
       curbone->ease1 += pchan_eval->ease1;
@@ -176,8 +176,8 @@ static int apply_armature_pose2bones_exec(bContext *C, wmOperator *op)
       curbone->scale_out_y *= pchan_eval->scale_out_y;
 
       /* reset pose values */
-      pchan->curveInX = pchan->curveOutX = 0.0f;
-      pchan->curveInY = pchan->curveOutY = 0.0f;
+      pchan->curve_in_x = pchan->curve_out_x = 0.0f;
+      pchan->curve_in_y = pchan->curve_out_y = 0.0f;
       pchan->roll1 = pchan->roll2 = 0.0f;
       pchan->ease1 = pchan->ease2 = 0.0f;
       pchan->scale_in_x = pchan->scale_in_y = 1.0f;
@@ -400,10 +400,10 @@ static bPoseChannel *pose_bone_do_paste(Object *ob,
     }
 
     /* B-Bone posing options should also be included... */
-    pchan->curveInX = chan->curveInX;
-    pchan->curveInY = chan->curveInY;
-    pchan->curveOutX = chan->curveOutX;
-    pchan->curveOutY = chan->curveOutY;
+    pchan->curve_in_x = chan->curve_in_x;
+    pchan->curve_in_y = chan->curve_in_y;
+    pchan->curve_out_x = chan->curve_out_x;
+    pchan->curve_out_y = chan->curve_out_y;
 
     pchan->roll1 = chan->roll1;
     pchan->roll2 = chan->roll2;
@@ -418,8 +418,8 @@ static bPoseChannel *pose_bone_do_paste(Object *ob,
     if (flip) {
       pchan->loc[0] *= -1;
 
-      pchan->curveInX *= -1;
-      pchan->curveOutX *= -1;
+      pchan->curve_in_x *= -1;
+      pchan->curve_out_x *= -1;
       pchan->roll1 *= -1;  // XXX?
       pchan->roll2 *= -1;  // XXX?
 
@@ -798,10 +798,10 @@ static void pchan_clear_rot(bPoseChannel *pchan)
   pchan->roll1 = 0.0f;
   pchan->roll2 = 0.0f;
 
-  pchan->curveInX = 0.0f;
-  pchan->curveInY = 0.0f;
-  pchan->curveOutX = 0.0f;
-  pchan->curveOutY = 0.0f;
+  pchan->curve_in_x = 0.0f;
+  pchan->curve_in_y = 0.0f;
+  pchan->curve_out_x = 0.0f;
+  pchan->curve_out_y = 0.0f;
 }
 
 /* clear loc/rot/scale of pose-channel */
index 4215c12..45c5189 100644 (file)
@@ -115,10 +115,10 @@ static void fcurves_to_pchan_links_get(ListBase *pfLinks,
     /* store current bbone values */
     pfl->roll1 = pchan->roll1;
     pfl->roll2 = pchan->roll2;
-    pfl->curveInX = pchan->curveInX;
-    pfl->curveInY = pchan->curveInY;
-    pfl->curveOutX = pchan->curveOutX;
-    pfl->curveOutY = pchan->curveOutY;
+    pfl->curve_in_x = pchan->curve_in_x;
+    pfl->curve_in_y = pchan->curve_in_y;
+    pfl->curve_out_x = pchan->curve_out_x;
+    pfl->curve_out_y = pchan->curve_out_y;
     pfl->ease1 = pchan->ease1;
     pfl->ease2 = pchan->ease2;
     pfl->scale_in_x = pchan->scale_in_x;
@@ -261,10 +261,10 @@ void poseAnim_mapping_reset(ListBase *pfLinks)
     /* store current bbone values */
     pchan->roll1 = pfl->roll1;
     pchan->roll2 = pfl->roll2;
-    pchan->curveInX = pfl->curveInX;
-    pchan->curveInY = pfl->curveInY;
-    pchan->curveOutX = pfl->curveOutX;
-    pchan->curveOutY = pfl->curveOutY;
+    pchan->curve_in_x = pfl->curve_in_x;
+    pchan->curve_in_y = pfl->curve_in_y;
+    pchan->curve_out_x = pfl->curve_out_x;
+    pchan->curve_out_y = pfl->curve_out_y;
     pchan->ease1 = pfl->ease1;
     pchan->ease2 = pfl->ease2;
     pchan->scale_in_x = pfl->scale_in_x;
index 6b3bbd1..3eb277a 100644 (file)
@@ -82,8 +82,8 @@ typedef struct EditBone {
 
   /* Bendy-Bone parameters */
   float roll1, roll2;
-  float curveOutX, curveOutY;
-  float curveInX, curveInY;
+  float curve_in_x, curve_in_y;
+  float curve_out_x, curve_out_y;
   float ease1, ease2;
   float scale_in_x, scale_in_y;
   float scale_out_x, scale_out_y;
index ae18650..3ea127b 100644 (file)
@@ -85,13 +85,13 @@ static void gizmo_bbone_offset_get(const wmGizmo *UNUSED(gz),
 
   if (bh->index == 0) {
     bh->co[1] = pchan->bone->ease1 / BBONE_SCALE_Y;
-    bh->co[0] = pchan->curveInX;
-    bh->co[2] = pchan->curveInY;
+    bh->co[0] = pchan->curve_in_x;
+    bh->co[2] = pchan->curve_in_y;
   }
   else {
     bh->co[1] = -pchan->bone->ease2 / BBONE_SCALE_Y;
-    bh->co[0] = pchan->curveOutX;
-    bh->co[2] = pchan->curveOutY;
+    bh->co[0] = pchan->curve_out_x;
+    bh->co[2] = pchan->curve_out_y;
   }
   copy_v3_v3(value, bh->co);
 }
@@ -110,13 +110,13 @@ static void gizmo_bbone_offset_set(const wmGizmo *UNUSED(gz),
 
   if (bh->index == 0) {
     pchan->bone->ease1 = max_ff(0.0f, bh->co[1] * BBONE_SCALE_Y);
-    pchan->curveInX = bh->co[0];
-    pchan->curveInY = bh->co[2];
+    pchan->curve_in_x = bh->co[0];
+    pchan->curve_in_y = bh->co[2];
   }
   else {
     pchan->bone->ease2 = max_ff(0.0f, -bh->co[1] * BBONE_SCALE_Y);
-    pchan->curveOutX = bh->co[0];
-    pchan->curveOutY = bh->co[2];
+    pchan->curve_out_x = bh->co[0];
+    pchan->curve_out_y = bh->co[2];
   }
 }
 
index 26fe63e..5af7f9d 100644 (file)
@@ -317,8 +317,8 @@ typedef struct bPoseChannel {
    * and are applied on top of the copies in pchan->bone
    */
   float roll1, roll2;
-  float curveInX, curveInY;
-  float curveOutX, curveOutY;
+  float curve_in_x, curve_in_y;
+  float curve_out_x, curve_out_y;
   float ease1, ease2;
   float scale_in_x, scale_in_y;
   float scale_out_x, scale_out_y;
index c7a3c76..483ff34 100644 (file)
@@ -77,8 +77,8 @@ typedef struct Bone {
 
   /** Curved bones settings - these define the "restpose" for a curved bone. */
   float roll1, roll2;
-  float curveInX, curveInY;
-  float curveOutX, curveOutY;
+  float curve_in_x, curve_in_y;
+  float curve_out_x, curve_out_y;
   /** Length of bezier handles. */
   float ease1, ease2;
   float scale_in_x, scale_in_y;
index 7b4362e..b9e0853 100644 (file)
@@ -60,6 +60,10 @@ DNA_STRUCT_RENAME_ELEM(BPoint, alfa, tilt)
 DNA_STRUCT_RENAME_ELEM(BezTriple, alfa, tilt)
 DNA_STRUCT_RENAME_ELEM(Bone, scaleIn, scale_in_x)
 DNA_STRUCT_RENAME_ELEM(Bone, scaleOut, scale_out_x)
+DNA_STRUCT_RENAME_ELEM(Bone, curveInX, curve_in_x)
+DNA_STRUCT_RENAME_ELEM(Bone, curveInY, curve_in_y)
+DNA_STRUCT_RENAME_ELEM(Bone, curveOutX, curve_out_x)
+DNA_STRUCT_RENAME_ELEM(Bone, curveOutY, curve_out_y)
 DNA_STRUCT_RENAME_ELEM(Camera, YF_dofdist, dof_distance)
 DNA_STRUCT_RENAME_ELEM(Camera, clipend, clip_end)
 DNA_STRUCT_RENAME_ELEM(Camera, clipsta, clip_start)
@@ -75,6 +79,10 @@ DNA_STRUCT_RENAME_ELEM(View3D, far, clip_end)
 DNA_STRUCT_RENAME_ELEM(View3D, near, clip_start)
 DNA_STRUCT_RENAME_ELEM(bPoseChannel, scaleIn, scale_in_x)
 DNA_STRUCT_RENAME_ELEM(bPoseChannel, scaleOut, scale_out_x)
+DNA_STRUCT_RENAME_ELEM(bPoseChannel, curveInX, curve_in_x)
+DNA_STRUCT_RENAME_ELEM(bPoseChannel, curveInY, curve_in_y)
+DNA_STRUCT_RENAME_ELEM(bPoseChannel, curveOutX, curve_out_x)
+DNA_STRUCT_RENAME_ELEM(bPoseChannel, curveOutY, curve_out_y)
 DNA_STRUCT_RENAME_ELEM(bTheme, tact, space_action)
 DNA_STRUCT_RENAME_ELEM(bTheme, tbuts, space_properties)
 DNA_STRUCT_RENAME_ELEM(bTheme, tclip, space_clip)
index c397bb5..06e99ef 100644 (file)
@@ -628,28 +628,28 @@ void rna_def_bone_curved_common(StructRNA *srna, bool is_posebone)
 
   /* Curve X/Y Offsets */
   prop = RNA_def_property(srna, "bbone_curveinx", PROP_FLOAT, PROP_NONE);
-  RNA_def_property_float_sdna(prop, NULL, "curveInX");
+  RNA_def_property_float_sdna(prop, NULL, "curve_in_x");
   RNA_def_property_range(prop, -5.0f, 5.0f);
   RNA_def_property_ui_text(
       prop, "In X", "X-axis handle offset for start of the B-Bone's curve, adjusts curvature");
   RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone);
 
   prop = RNA_def_property(srna, "bbone_curveiny", PROP_FLOAT, PROP_NONE);
-  RNA_def_property_float_sdna(prop, NULL, "curveInY");
+  RNA_def_property_float_sdna(prop, NULL, "curve_in_y");
   RNA_def_property_range(prop, -5.0f, 5.0f);
   RNA_def_property_ui_text(
       prop, "In Y", "Y-axis handle offset for start of the B-Bone's curve, adjusts curvature");
   RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone);
 
   prop = RNA_def_property(srna, "bbone_curveoutx", PROP_FLOAT, PROP_NONE);
-  RNA_def_property_float_sdna(prop, NULL, "curveOutX");
+  RNA_def_property_float_sdna(prop, NULL, "curve_out_x");
   RNA_def_property_range(prop, -5.0f, 5.0f);
   RNA_def_property_ui_text(
       prop, "Out X", "X-axis handle offset for end of the B-Bone's curve, adjusts curvature");
   RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone);
 
   prop = RNA_def_property(srna, "bbone_curveouty", PROP_FLOAT, PROP_NONE);
-  RNA_def_property_float_sdna(prop, NULL, "curveOutY");
+  RNA_def_property_float_sdna(prop, NULL, "curve_out_y");
   RNA_def_property_range(prop, -5.0f, 5.0f);
   RNA_def_property_ui_text(
       prop, "Out Y", "Y-axis handle offset for end of the B-Bone's curve, adjusts curvature");