Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorAlexander Gavrilov <angavrilov@gmail.com>2019-04-20 18:06:31 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2019-04-23 13:45:03 +0300
commit624e93bbef8a8a34be822c1a98df131439c32788 (patch)
tree592fce70ac6a810c6ee4ab9c0c3ce87ebedc14cf /source
parentc043ab1cf3bce77248a8d7dfa42b2e9f8f9611aa (diff)
B-Bones: split the Scale In/Out properties into X and Y values.
As far as I can tell, there is no technical reason why the B-Bone segment thickness scaling can't be separated into two axes. The only downside is the increase in complexity of the B-Bone settings, but this is inevitable due to the increase in flexibility. Updating the file is somewhat complicated though, because F-Curves and drivers have to be duplicated and updated to the new names. Reviewers: campbellbarton Subscribers: icappiello, jpbouza Differential Revision: https://developer.blender.org/D4716
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/BKE_armature.h2
-rw-r--r--source/blender/blenkernel/intern/action.c12
-rw-r--r--source/blender/blenkernel/intern/armature.c38
-rw-r--r--source/blender/blenloader/intern/versioning_270.c8
-rw-r--r--source/blender/blenloader/intern/versioning_280.c97
-rw-r--r--source/blender/draw/intern/draw_armature.c7
-rw-r--r--source/blender/editors/armature/armature_add.c12
-rw-r--r--source/blender/editors/armature/armature_intern.h3
-rw-r--r--source/blender/editors/armature/armature_utils.c12
-rw-r--r--source/blender/editors/armature/pose_transform.c19
-rw-r--r--source/blender/editors/armature/pose_utils.c12
-rw-r--r--source/blender/editors/include/ED_armature.h3
-rw-r--r--source/blender/makesdna/DNA_action_types.h3
-rw-r--r--source/blender/makesdna/DNA_armature_types.h3
-rw-r--r--source/blender/makesdna/intern/dna_rename_defs.h4
-rw-r--r--source/blender/makesrna/intern/rna_armature.c48
16 files changed, 225 insertions, 58 deletions
diff --git a/source/blender/blenkernel/BKE_armature.h b/source/blender/blenkernel/BKE_armature.h
index e171eec023f..366fdc0ce45 100644
--- a/source/blender/blenkernel/BKE_armature.h
+++ b/source/blender/blenkernel/BKE_armature.h
@@ -207,7 +207,7 @@ typedef struct BBoneSplineParameters {
/* Control values. */
float ease1, ease2;
float roll1, roll2;
- float scaleIn, scaleOut;
+ float scale_in_x, scale_in_y, scale_out_x, scale_out_y;
float curveInX, curveInY, curveOutX, curveOutY;
} BBoneSplineParameters;
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index 9ae8d27b27f..59e279d8054 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -458,7 +458,8 @@ bPoseChannel *BKE_pose_channel_verify(bPose *pose, const char *name)
unit_axis_angle(chan->rotAxis, &chan->rotAngle);
chan->size[0] = chan->size[1] = chan->size[2] = 1.0f;
- chan->scaleIn = chan->scaleOut = 1.0f;
+ chan->scale_in_x = chan->scale_in_y = 1.0f;
+ chan->scale_out_x = chan->scale_out_y = 1.0f;
chan->limitmin[0] = chan->limitmin[1] = chan->limitmin[2] = -M_PI;
chan->limitmax[0] = chan->limitmax[1] = chan->limitmax[2] = M_PI;
@@ -1410,7 +1411,8 @@ void BKE_pose_rest(bPose *pose)
pchan->curveInX = pchan->curveInY = 0.0f;
pchan->curveOutX = pchan->curveOutY = 0.0f;
pchan->ease1 = pchan->ease2 = 0.0f;
- pchan->scaleIn = pchan->scaleOut = 1.0f;
+ pchan->scale_in_x = pchan->scale_in_y = 1.0f;
+ pchan->scale_out_x = pchan->scale_out_y = 1.0f;
pchan->flag &= ~(POSE_LOC | POSE_ROT | POSE_SIZE | POSE_BBONE_SHAPE);
}
@@ -1438,8 +1440,10 @@ void BKE_pose_copyesult_pchan_result(bPoseChannel *pchanto, const bPoseChannel *
pchanto->curveOutY = pchanfrom->curveOutY;
pchanto->ease1 = pchanfrom->ease1;
pchanto->ease2 = pchanfrom->ease2;
- pchanto->scaleIn = pchanfrom->scaleIn;
- pchanto->scaleOut = pchanfrom->scaleOut;
+ pchanto->scale_in_x = pchanfrom->scale_in_x;
+ pchanto->scale_in_y = pchanfrom->scale_in_y;
+ pchanto->scale_out_x = pchanfrom->scale_out_x;
+ pchanto->scale_out_y = pchanfrom->scale_out_y;
pchanto->rotmode = pchanfrom->rotmode;
pchanto->flag = pchanfrom->flag;
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index b726ea6c20d..3dd655ee9a8 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -680,8 +680,10 @@ void BKE_pchan_bbone_spline_params_get(struct bPoseChannel *pchan,
}
}
- param->scaleIn = bone->scaleIn * (!rest ? pchan->scaleIn : 1.0f);
- param->scaleOut = bone->scaleOut * (!rest ? pchan->scaleOut : 1.0f);
+ param->scale_in_x = bone->scale_in_x * (!rest ? pchan->scale_in_x : 1.0f);
+ param->scale_in_y = bone->scale_in_y * (!rest ? pchan->scale_in_y : 1.0f);
+ param->scale_out_x = bone->scale_out_x * (!rest ? pchan->scale_out_x : 1.0f);
+ 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);
@@ -827,7 +829,8 @@ static void make_bbone_spline_matrix(BBoneSplineParameters *param,
float pos[3],
float axis[3],
float roll,
- float scalefac,
+ float scalex,
+ float scaley,
float result[4][4])
{
float mat3[3][3];
@@ -843,8 +846,8 @@ static void make_bbone_spline_matrix(BBoneSplineParameters *param,
}
/* BBone scale... */
- mul_v3_fl(result[0], scalefac);
- mul_v3_fl(result[2], scalefac);
+ mul_v3_fl(result[0], scalex);
+ mul_v3_fl(result[2], scaley);
}
/* Fade from first to second derivative when the handle is very short. */
@@ -908,17 +911,25 @@ int BKE_pchan_bbone_spline_compute(BBoneSplineParameters *param,
/* End points require special handling to fix zero length handles. */
ease_handle_axis(bezt_deriv1[0], bezt_deriv2[0], axis);
- make_bbone_spline_matrix(
- param, scalemats, bezt_controls[0], axis, roll1, param->scaleIn, result_array[0].mat);
+ make_bbone_spline_matrix(param,
+ scalemats,
+ bezt_controls[0],
+ axis,
+ roll1,
+ param->scale_in_x,
+ param->scale_in_y,
+ result_array[0].mat);
for (int a = 1; a < param->segments; a++) {
evaluate_cubic_bezier(bezt_controls, bezt_points[a], cur, axis);
float fac = ((float)a) / param->segments;
float roll = interpf(roll2, roll1, fac);
- float scalefac = interpf(param->scaleOut, param->scaleIn, fac);
+ float scalex = interpf(param->scale_out_x, param->scale_in_x, fac);
+ float scaley = interpf(param->scale_out_y, param->scale_in_y, fac);
- make_bbone_spline_matrix(param, scalemats, cur, axis, roll, scalefac, result_array[a].mat);
+ make_bbone_spline_matrix(
+ param, scalemats, cur, axis, roll, scalex, scaley, result_array[a].mat);
}
negate_v3(bezt_deriv2[1]);
@@ -928,7 +939,8 @@ int BKE_pchan_bbone_spline_compute(BBoneSplineParameters *param,
bezt_controls[3],
axis,
roll2,
- param->scaleOut,
+ param->scale_out_x,
+ param->scale_out_y,
result_array[param->segments].mat);
}
/* Other code (e.g. display) uses matrices for the segments themselves. */
@@ -942,9 +954,11 @@ int BKE_pchan_bbone_spline_compute(BBoneSplineParameters *param,
float fac = (a + 0.5f) / param->segments;
float roll = interpf(roll2, roll1, fac);
- float scalefac = interpf(param->scaleOut, param->scaleIn, fac);
+ float scalex = interpf(param->scale_out_x, param->scale_in_x, fac);
+ float scaley = interpf(param->scale_out_y, param->scale_in_y, fac);
- make_bbone_spline_matrix(param, scalemats, prev, axis, roll, scalefac, result_array[a].mat);
+ make_bbone_spline_matrix(
+ param, scalemats, prev, axis, roll, scalex, scaley, result_array[a].mat);
copy_v3_v3(prev, cur);
}
}
diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c
index bd405bd6410..20b2bfd95c8 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -256,8 +256,8 @@ static void do_version_action_editor_properties_region(ListBase *regionbase)
static void do_version_bones_super_bbone(ListBase *lb)
{
for (Bone *bone = lb->first; bone; bone = bone->next) {
- bone->scaleIn = 1.0f;
- bone->scaleOut = 1.0f;
+ bone->scale_in_x = bone->scale_in_y = 1.0f;
+ bone->scale_out_x = bone->scale_out_y = 1.0f;
do_version_bones_super_bbone(&bone->childbase);
}
@@ -1338,8 +1338,8 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain)
if (ob->pose) {
for (bPoseChannel *pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
/* see do_version_bones_super_bbone()... */
- pchan->scaleIn = 1.0f;
- pchan->scaleOut = 1.0f;
+ pchan->scale_in_x = pchan->scale_in_y = 1.0f;
+ pchan->scale_out_x = pchan->scale_out_y = 1.0f;
/* also make sure some legacy (unused for over a decade) flags are unset,
* so that we can reuse them for stuff that matters now...
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index fbe0f70527b..73109cd9a6b 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -30,6 +30,7 @@
#include "BLI_string.h"
#include "BLI_utildefines.h"
+#include "DNA_anim_types.h"
#include "DNA_object_types.h"
#include "DNA_camera_types.h"
#include "DNA_cloth_types.h"
@@ -56,11 +57,13 @@
#include "DNA_text_types.h"
#include "BKE_action.h"
+#include "BKE_animsys.h"
#include "BKE_cloth.h"
#include "BKE_collection.h"
#include "BKE_constraint.h"
#include "BKE_colortools.h"
#include "BKE_customdata.h"
+#include "BKE_fcurve.h"
#include "BKE_freestyle.h"
#include "BKE_gpencil.h"
#include "BKE_idprop.h"
@@ -621,6 +624,74 @@ static ARegion *do_versions_add_region(int regiontype, const char *name)
return ar;
}
+static void do_version_bones_split_bbone_scale(ListBase *lb)
+{
+ for (Bone *bone = lb->first; bone; bone = bone->next) {
+ bone->scale_in_y = bone->scale_in_x;
+ bone->scale_out_y = bone->scale_out_x;
+
+ do_version_bones_split_bbone_scale(&bone->childbase);
+ }
+}
+
+static bool replace_bbone_scale_rnapath(char **p_old_path)
+{
+ char *old_path = *p_old_path;
+
+ if (old_path == NULL) {
+ return false;
+ }
+
+ if (BLI_str_endswith(old_path, "bbone_scalein") ||
+ BLI_str_endswith(old_path, "bbone_scaleout")) {
+ *p_old_path = BLI_strdupcat(old_path, "x");
+
+ MEM_freeN(old_path);
+ return true;
+ }
+
+ return false;
+}
+
+static void do_version_bbone_scale_fcurve_fix(ListBase *curves, FCurve *fcu)
+{
+ /* Update driver variable paths. */
+ if (fcu->driver) {
+ LISTBASE_FOREACH (DriverVar *, dvar, &fcu->driver->variables) {
+ DRIVER_TARGETS_LOOPER_BEGIN (dvar) {
+ replace_bbone_scale_rnapath(&dtar->rna_path);
+ }
+ DRIVER_TARGETS_LOOPER_END;
+ }
+ }
+
+ /* Update F-Curve's path. */
+ if (replace_bbone_scale_rnapath(&fcu->rna_path)) {
+ /* If matched, duplicate the curve and tweak name. */
+ FCurve *second = copy_fcurve(fcu);
+
+ second->rna_path[strlen(second->rna_path) - 1] = 'y';
+
+ BLI_insertlinkafter(curves, fcu, second);
+
+ /* Add to the curve group. */
+ second->grp = fcu->grp;
+
+ if (fcu->grp != NULL && fcu->grp->channels.last == fcu) {
+ fcu->grp->channels.last = second;
+ }
+ }
+}
+
+static void do_version_bbone_scale_animdata_cb(ID *UNUSED(id),
+ AnimData *adt,
+ void *UNUSED(wrapper_data))
+{
+ LISTBASE_FOREACH_MUTABLE (FCurve *, fcu, &adt->drivers) {
+ do_version_bbone_scale_fcurve_fix(&adt->drivers, fcu);
+ }
+}
+
void do_versions_after_linking_280(Main *bmain)
{
bool use_collection_compat_28 = true;
@@ -3203,6 +3274,32 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
}
+ /* Split bbone_scalein/bbone_scaleout into x and y fields. */
+ if (!DNA_struct_elem_find(fd->filesdna, "bPoseChannel", "float", "scale_out_y")) {
+ /* Update armature data and pose channels. */
+ LISTBASE_FOREACH (bArmature *, arm, &bmain->armatures) {
+ do_version_bones_split_bbone_scale(&arm->bonebase);
+ }
+
+ LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
+ if (ob->pose) {
+ LISTBASE_FOREACH (bPoseChannel *, pchan, &ob->pose->chanbase) {
+ pchan->scale_in_y = pchan->scale_in_x;
+ pchan->scale_out_y = pchan->scale_out_x;
+ }
+ }
+ }
+
+ /* Update action curves and drivers. */
+ LISTBASE_FOREACH (bAction *, act, &bmain->actions) {
+ LISTBASE_FOREACH_MUTABLE (FCurve *, fcu, &act->curves) {
+ do_version_bbone_scale_fcurve_fix(&act->curves, fcu);
+ }
+ }
+
+ BKE_animdata_main_cb(bmain, do_version_bbone_scale_animdata_cb, NULL);
+ }
+
/* Versioning code until next subversion bump goes here. */
}
}
diff --git a/source/blender/draw/intern/draw_armature.c b/source/blender/draw/intern/draw_armature.c
index 12d4ca95a39..bd2fa1d861d 100644
--- a/source/blender/draw/intern/draw_armature.c
+++ b/source/blender/draw/intern/draw_armature.c
@@ -1110,8 +1110,11 @@ static void ebone_spline_preview(EditBone *ebone, float result_array[MAX_BBONE_S
param.roll1 += prev->roll2;
}
- param.scaleIn = ebone->scaleIn;
- param.scaleOut = ebone->scaleOut;
+ param.scale_in_x = ebone->scale_in_x;
+ param.scale_in_y = ebone->scale_in_y;
+
+ param.scale_out_x = ebone->scale_out_x;
+ param.scale_out_y = ebone->scale_out_y;
param.curveInX = ebone->curveInX;
param.curveInY = ebone->curveInY;
diff --git a/source/blender/editors/armature/armature_add.c b/source/blender/editors/armature/armature_add.c
index 3b65f3a71ed..2e14595cf57 100644
--- a/source/blender/editors/armature/armature_add.c
+++ b/source/blender/editors/armature/armature_add.c
@@ -85,8 +85,10 @@ EditBone *ED_armature_ebone_add(bArmature *arm, const char *name)
bone->curveOutY = 0.0f;
bone->ease1 = 1.0f;
bone->ease2 = 1.0f;
- bone->scaleIn = 1.0f;
- bone->scaleOut = 1.0f;
+ bone->scale_in_x = 1.0f;
+ bone->scale_in_y = 1.0f;
+ bone->scale_out_x = 1.0f;
+ bone->scale_out_y = 1.0f;
return bone;
}
@@ -996,8 +998,10 @@ static int armature_extrude_exec(bContext *C, wmOperator *op)
newbone->curveOutY = ebone->curveOutY;
newbone->ease1 = ebone->ease1;
newbone->ease2 = ebone->ease2;
- newbone->scaleIn = ebone->scaleIn;
- newbone->scaleOut = ebone->scaleOut;
+ newbone->scale_in_x = ebone->scale_in_x;
+ newbone->scale_in_y = ebone->scale_in_y;
+ newbone->scale_out_x = ebone->scale_out_x;
+ newbone->scale_out_y = ebone->scale_out_y;
BLI_strncpy(newbone->name, ebone->name, sizeof(newbone->name));
diff --git a/source/blender/editors/armature/armature_intern.h b/source/blender/editors/armature/armature_intern.h
index 09e4c1acae7..f5833e0d1e3 100644
--- a/source/blender/editors/armature/armature_intern.h
+++ b/source/blender/editors/armature/armature_intern.h
@@ -165,7 +165,8 @@ typedef struct tPChanFCurveLink {
float curveInX, curveInY;
float curveOutX, curveOutY;
float ease1, ease2;
- float scaleIn, scaleOut;
+ float scale_in_x, scale_in_y;
+ float scale_out_x, scale_out_y;
/** copy of custom properties at start of operator (to be restored before each modal step) */
struct IDProperty *oldprops;
diff --git a/source/blender/editors/armature/armature_utils.c b/source/blender/editors/armature/armature_utils.c
index b4e4396ce89..29e90ea672f 100644
--- a/source/blender/editors/armature/armature_utils.c
+++ b/source/blender/editors/armature/armature_utils.c
@@ -502,8 +502,10 @@ static EditBone *make_boneList_rec(ListBase *edbo,
eBone->curveOutY = curBone->curveOutY;
eBone->ease1 = curBone->ease1;
eBone->ease2 = curBone->ease2;
- eBone->scaleIn = curBone->scaleIn;
- eBone->scaleOut = curBone->scaleOut;
+ eBone->scale_in_x = curBone->scale_in_x;
+ eBone->scale_in_y = curBone->scale_in_y;
+ eBone->scale_out_x = curBone->scale_out_x;
+ eBone->scale_out_y = curBone->scale_out_y;
eBone->bbone_prev_type = curBone->bbone_prev_type;
eBone->bbone_next_type = curBone->bbone_next_type;
@@ -712,8 +714,10 @@ void ED_armature_from_edit(Main *bmain, bArmature *arm)
newBone->curveOutY = eBone->curveOutY;
newBone->ease1 = eBone->ease1;
newBone->ease2 = eBone->ease2;
- newBone->scaleIn = eBone->scaleIn;
- newBone->scaleOut = eBone->scaleOut;
+ newBone->scale_in_x = eBone->scale_in_x;
+ newBone->scale_in_y = eBone->scale_in_y;
+ newBone->scale_out_x = eBone->scale_out_x;
+ newBone->scale_out_y = eBone->scale_out_y;
newBone->bbone_prev_type = eBone->bbone_prev_type;
newBone->bbone_next_type = eBone->bbone_next_type;
diff --git a/source/blender/editors/armature/pose_transform.c b/source/blender/editors/armature/pose_transform.c
index 91f0bdc51ad..03984bfdbd8 100644
--- a/source/blender/editors/armature/pose_transform.c
+++ b/source/blender/editors/armature/pose_transform.c
@@ -170,15 +170,18 @@ static int apply_armature_pose2bones_exec(bContext *C, wmOperator *op)
curbone->roll2 += pchan_eval->roll2;
curbone->ease1 += pchan_eval->ease1;
curbone->ease2 += pchan_eval->ease2;
- curbone->scaleIn += pchan_eval->scaleIn;
- curbone->scaleOut += pchan_eval->scaleOut;
+ curbone->scale_in_x *= pchan_eval->scale_in_x;
+ curbone->scale_in_y *= pchan_eval->scale_in_y;
+ curbone->scale_out_x *= pchan_eval->scale_out_x;
+ 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->roll1 = pchan->roll2 = 0.0f;
pchan->ease1 = pchan->ease2 = 0.0f;
- pchan->scaleIn = pchan->scaleOut = 1.0f;
+ pchan->scale_in_x = pchan->scale_in_y = 1.0f;
+ pchan->scale_out_x = pchan->scale_out_y = 1.0f;
}
/* clear transform values for pchan */
@@ -406,8 +409,10 @@ static bPoseChannel *pose_bone_do_paste(Object *ob,
pchan->roll2 = chan->roll2;
pchan->ease1 = chan->ease1;
pchan->ease2 = chan->ease2;
- pchan->scaleIn = chan->scaleIn;
- pchan->scaleOut = chan->scaleOut;
+ pchan->scale_in_x = chan->scale_in_x;
+ pchan->scale_in_y = chan->scale_in_y;
+ pchan->scale_out_x = chan->scale_out_x;
+ pchan->scale_out_y = chan->scale_out_y;
/* paste flipped pose? */
if (flip) {
@@ -654,8 +659,8 @@ static void pchan_clear_scale(bPoseChannel *pchan)
pchan->ease1 = 0.0f;
pchan->ease2 = 0.0f;
- pchan->scaleIn = 1.0f;
- pchan->scaleOut = 1.0f;
+ pchan->scale_in_x = pchan->scale_in_y = 1.0f;
+ pchan->scale_out_x = pchan->scale_out_y = 1.0f;
}
/* clear location of pose-channel */
diff --git a/source/blender/editors/armature/pose_utils.c b/source/blender/editors/armature/pose_utils.c
index 2b7bd9ea05a..4215c122917 100644
--- a/source/blender/editors/armature/pose_utils.c
+++ b/source/blender/editors/armature/pose_utils.c
@@ -121,8 +121,10 @@ static void fcurves_to_pchan_links_get(ListBase *pfLinks,
pfl->curveOutY = pchan->curveOutY;
pfl->ease1 = pchan->ease1;
pfl->ease2 = pchan->ease2;
- pfl->scaleIn = pchan->scaleIn;
- pfl->scaleOut = pchan->scaleOut;
+ pfl->scale_in_x = pchan->scale_in_x;
+ pfl->scale_in_y = pchan->scale_in_y;
+ pfl->scale_out_x = pchan->scale_out_x;
+ pfl->scale_out_y = pchan->scale_out_y;
/* make copy of custom properties */
if (pchan->prop && (transFlags & ACT_TRANS_PROP)) {
@@ -265,8 +267,10 @@ void poseAnim_mapping_reset(ListBase *pfLinks)
pchan->curveOutY = pfl->curveOutY;
pchan->ease1 = pfl->ease1;
pchan->ease2 = pfl->ease2;
- pchan->scaleIn = pfl->scaleIn;
- pchan->scaleOut = pfl->scaleOut;
+ pchan->scale_in_x = pfl->scale_in_x;
+ pchan->scale_in_y = pfl->scale_in_y;
+ pchan->scale_out_x = pfl->scale_out_x;
+ pchan->scale_out_y = pfl->scale_out_y;
/* just overwrite values of properties from the stored copies (there should be some) */
if (pfl->oldprops) {
diff --git a/source/blender/editors/include/ED_armature.h b/source/blender/editors/include/ED_armature.h
index 9fb8f1b1b04..6b3bbd11967 100644
--- a/source/blender/editors/include/ED_armature.h
+++ b/source/blender/editors/include/ED_armature.h
@@ -85,7 +85,8 @@ typedef struct EditBone {
float curveOutX, curveOutY;
float curveInX, curveInY;
float ease1, ease2;
- float scaleIn, scaleOut;
+ float scale_in_x, scale_in_y;
+ float scale_out_x, scale_out_y;
/** for envelope scaling */
float oldlength;
diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h
index 49bd05913cd..26fe63ef951 100644
--- a/source/blender/makesdna/DNA_action_types.h
+++ b/source/blender/makesdna/DNA_action_types.h
@@ -320,7 +320,8 @@ typedef struct bPoseChannel {
float curveInX, curveInY;
float curveOutX, curveOutY;
float ease1, ease2;
- float scaleIn, scaleOut;
+ float scale_in_x, scale_in_y;
+ float scale_out_x, scale_out_y;
/** B-Bone custom handles; set on read file or rebuild pose based on pchan->bone data. */
struct bPoseChannel *bbone_prev;
diff --git a/source/blender/makesdna/DNA_armature_types.h b/source/blender/makesdna/DNA_armature_types.h
index 0b1bd23bd9c..c7a3c762b48 100644
--- a/source/blender/makesdna/DNA_armature_types.h
+++ b/source/blender/makesdna/DNA_armature_types.h
@@ -81,7 +81,8 @@ typedef struct Bone {
float curveOutX, curveOutY;
/** Length of bezier handles. */
float ease1, ease2;
- float scaleIn, scaleOut;
+ float scale_in_x, scale_in_y;
+ float scale_out_x, scale_out_y;
/** patch for upward compat, UNUSED!. */
float size[3];
diff --git a/source/blender/makesdna/intern/dna_rename_defs.h b/source/blender/makesdna/intern/dna_rename_defs.h
index f36e24b2000..7b4362e35e9 100644
--- a/source/blender/makesdna/intern/dna_rename_defs.h
+++ b/source/blender/makesdna/intern/dna_rename_defs.h
@@ -58,6 +58,8 @@ DNA_STRUCT_RENAME(SpaceIpo, SpaceGraph)
DNA_STRUCT_RENAME(SpaceOops, SpaceOutliner)
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(Camera, YF_dofdist, dof_distance)
DNA_STRUCT_RENAME_ELEM(Camera, clipend, clip_end)
DNA_STRUCT_RENAME_ELEM(Camera, clipsta, clip_start)
@@ -71,6 +73,8 @@ DNA_STRUCT_RENAME_ELEM(ParticleSettings, dup_ob, instance_object)
DNA_STRUCT_RENAME_ELEM(ParticleSettings, dupliweights, instance_weights)
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(bTheme, tact, space_action)
DNA_STRUCT_RENAME_ELEM(bTheme, tbuts, space_properties)
DNA_STRUCT_RENAME_ELEM(bTheme, tclip, space_clip)
diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c
index d32e814f7f8..c397bb51713 100644
--- a/source/blender/makesrna/intern/rna_armature.c
+++ b/source/blender/makesrna/intern/rna_armature.c
@@ -671,24 +671,48 @@ void rna_def_bone_curved_common(StructRNA *srna, bool is_posebone)
RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone);
/* Scale In/Out */
- prop = RNA_def_property(srna, "bbone_scalein", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "scaleIn");
+ prop = RNA_def_property(srna, "bbone_scaleinx", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "scale_in_x");
+ RNA_def_property_flag(prop, PROP_PROPORTIONAL);
RNA_def_property_range(prop, 0.0f, 5.0f);
RNA_def_property_float_default(prop, 1.0f);
- RNA_def_property_ui_text(
- prop,
- "Scale In",
- "Scale factor for start of the B-Bone, adjusts thickness (for tapering effects)");
+ RNA_def_property_ui_text(prop,
+ "Scale In X",
+ "X-axis scale factor for start of the B-Bone, "
+ "adjusts thickness (for tapering effects)");
RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone);
- prop = RNA_def_property(srna, "bbone_scaleout", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "scaleOut");
+ prop = RNA_def_property(srna, "bbone_scaleiny", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "scale_in_y");
+ RNA_def_property_flag(prop, PROP_PROPORTIONAL);
RNA_def_property_range(prop, 0.0f, 5.0f);
RNA_def_property_float_default(prop, 1.0f);
- RNA_def_property_ui_text(
- prop,
- "Scale Out",
- "Scale factor for end of the B-Bone, adjusts thickness (for tapering effects)");
+ RNA_def_property_ui_text(prop,
+ "Scale In Y",
+ "Y-axis scale factor for start of the B-Bone, "
+ "adjusts thickness (for tapering effects)");
+ RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone);
+
+ prop = RNA_def_property(srna, "bbone_scaleoutx", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "scale_out_x");
+ RNA_def_property_flag(prop, PROP_PROPORTIONAL);
+ RNA_def_property_range(prop, 0.0f, 5.0f);
+ RNA_def_property_float_default(prop, 1.0f);
+ RNA_def_property_ui_text(prop,
+ "Scale Out X",
+ "X-axis scale factor for end of the B-Bone, "
+ "adjusts thickness (for tapering effects)");
+ RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone);
+
+ prop = RNA_def_property(srna, "bbone_scaleouty", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "scale_out_y");
+ RNA_def_property_flag(prop, PROP_PROPORTIONAL);
+ RNA_def_property_range(prop, 0.0f, 5.0f);
+ RNA_def_property_float_default(prop, 1.0f);
+ RNA_def_property_ui_text(prop,
+ "Scale Out Y",
+ "Y-axis scale factor for end of the B-Bone, "
+ "adjusts thickness (for tapering effects)");
RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone);
# undef RNA_DEF_CURVEBONE_UPDATE