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
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/blender/editors/armature
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/blender/editors/armature')
-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
5 files changed, 38 insertions, 20 deletions
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) {