Fix T96238: shrinking to zero doesn't actually scales the radius to zero

Probably to prevent the radius of a point from being stuck at zero,
the `Shrink/Fatten` curve operator sets a minimum value of `0.001`
for all points being transformed.

This is an inconvenience as these points may have been purposely set
to zero on the panel.

And it also doesn't follow the convention seen in other operators
(which keep the value zero).

So remove this limitation.
This commit is contained in:
Germano Cavalcante 2022-07-12 10:11:05 -03:00
parent 57097e9a85
commit 2d1fe736fa
Notes: blender-bot 2023-02-14 07:31:32 +01:00
Referenced by commit b70bbfadfe, Fix T102000: Curve Shrink Fatten doesn't work for zero radius
Referenced by issue #102000, Spline radius doesn't work proerly
Referenced by issue #96238, shrinking to zero doesn't actually scales the radius to zero
1 changed files with 1 additions and 7 deletions

View File

@ -65,9 +65,7 @@ static void applyCurveShrinkFatten(TransInfo *t, const int UNUSED(mval[2]))
*td->val = td->ival * ratio;
/* apply PET */
*td->val = (*td->val * td->factor) + ((1.0f - td->factor) * td->ival);
if (*td->val <= 0.0f) {
*td->val = 0.001f;
}
CLAMP_MIN(*td->val, 0.0f);
}
}
}
@ -93,10 +91,6 @@ void initCurveShrinkFatten(TransInfo *t)
t->num.unit_sys = t->scene->unit.system;
t->num.unit_type[0] = B_UNIT_NONE;
#ifdef USE_NUM_NO_ZERO
t->num.val_flag[0] |= NUM_NO_ZERO;
#endif
t->flag |= T_NO_CONSTRAINT;
}