Fix T74256, crash in bmesh.ops.bevel if segments not set.
Also changed signature of bevel function to take integer for segments instead of float, which is just wrong.
This commit is contained in:
@@ -7145,7 +7145,7 @@ static void bevel_limit_offset(BevelParams *bp, BMesh *bm)
|
||||
void BM_mesh_bevel(BMesh *bm,
|
||||
const float offset,
|
||||
const int offset_type,
|
||||
const float segments,
|
||||
const int segments,
|
||||
const float profile,
|
||||
const bool vertex_only,
|
||||
const bool use_weights,
|
||||
@@ -7176,7 +7176,7 @@ void BM_mesh_bevel(BMesh *bm,
|
||||
|
||||
bp.offset = offset;
|
||||
bp.offset_type = offset_type;
|
||||
bp.seg = (int)segments;
|
||||
bp.seg = segments;
|
||||
bp.profile = profile;
|
||||
bp.pro_super_r = -logf(2.0) / logf(sqrtf(profile)); /* Convert to superellipse exponent. */
|
||||
bp.vertex_only = vertex_only;
|
||||
@@ -7207,6 +7207,10 @@ void BM_mesh_bevel(BMesh *bm,
|
||||
bp.miter_inner = BEVEL_MITER_SHARP;
|
||||
}
|
||||
|
||||
if (bp.seg <= 1) {
|
||||
bp.seg = 1;
|
||||
}
|
||||
|
||||
if (profile >= 0.950f) { /* r ~ 692, so PRO_SQUARE_R is 1e4 */
|
||||
bp.pro_super_r = PRO_SQUARE_R;
|
||||
}
|
||||
|
@@ -27,7 +27,7 @@ struct MDeformVert;
|
||||
void BM_mesh_bevel(BMesh *bm,
|
||||
const float offset,
|
||||
const int offset_type,
|
||||
const float segments,
|
||||
const int segments,
|
||||
const float profile,
|
||||
const bool vertex_only,
|
||||
const bool use_weights,
|
||||
|
Reference in New Issue
Block a user