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
This commit is contained in:
parent
c043ab1cf3
commit
624e93bbef
|
@ -160,8 +160,12 @@ class BONE_PT_curved(BoneButtonsPanel, Panel):
|
|||
col.prop(bone, "use_endroll_as_inroll")
|
||||
|
||||
col = topcol.column(align=True)
|
||||
col.prop(bbone, "bbone_scalein", text="Scale In")
|
||||
col.prop(bbone, "bbone_scaleout", text="Out")
|
||||
col.prop(bbone, "bbone_scaleinx", text="Scale In X")
|
||||
col.prop(bbone, "bbone_scaleiny", text="In Y")
|
||||
|
||||
col = topcol.column(align=True)
|
||||
col.prop(bbone, "bbone_scaleoutx", text="Scale Out X")
|
||||
col.prop(bbone, "bbone_scaleouty", text="Out Y")
|
||||
|
||||
col = topcol.column(align=True)
|
||||
col.prop(bbone, "bbone_easein", text="Ease In")
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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...
|
||||
|
|
|
@ -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. */
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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));
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue