diff options
author | Henrik Dick <weasel> | 2020-03-29 12:23:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-03-29 12:25:14 +0300 |
commit | fc37318fe7361bc4d3632213ddb567b790305710 (patch) | |
tree | eb6bac76cd7ca567529bb3e47a68cb70201f964f /source/blender/modifiers/intern/MOD_screw.c | |
parent | e8dd6128b58b138b0163e6376a6e8a54cc6e5ab1 (diff) |
Screw Modifier: support 1-2 steps
The Screw Modifier had a lower limit for the steps value, which not only
was inconsistent between render and viewport steps, but also was capped
to 2 in UI and also in the code internally.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_screw.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_screw.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/source/blender/modifiers/intern/MOD_screw.c b/source/blender/modifiers/intern/MOD_screw.c index 8921ddb894f..e832a23b4ed 100644 --- a/source/blender/modifiers/intern/MOD_screw.c +++ b/source/blender/modifiers/intern/MOD_screw.c @@ -352,12 +352,9 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes * Note! smaller then `FLT_EPSILON * 100` * gives problems with float precision so its never closed. */ if (fabsf(screw_ofs) <= (FLT_EPSILON * 100.0f) && - fabsf(fabsf(angle) - ((float)M_PI * 2.0f)) <= (FLT_EPSILON * 100.0f)) { + fabsf(fabsf(angle) - ((float)M_PI * 2.0f)) <= (FLT_EPSILON * 100.0f) && step_tot > 3) { close = 1; step_tot--; - if (step_tot < 3) { - step_tot = 3; - } maxVerts = totvert * step_tot; /* -1 because we're joining back up */ maxEdges = (totvert * step_tot) + /* these are the edges between new verts */ @@ -368,8 +365,8 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes } else { close = 0; - if (step_tot < 3) { - step_tot = 3; + if (step_tot < 2) { + step_tot = 2; } maxVerts = totvert * step_tot; /* -1 because we're joining back up */ |