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:
authorHans Goudey <h.goudey@me.com>2020-08-04 01:18:02 +0300
committerHans Goudey <h.goudey@me.com>2020-08-04 01:18:02 +0300
commit4b99df20d57e851e445db0df95f6d297a91941f8 (patch)
treec0ce1091e93bc08f10b00df321c06a71ad208a3b /source/blender/bmesh
parent862d79fffc98130dd2ef871655150544b0d9b412 (diff)
parentfbc3c1b24ddc6d48ec45e1919113db25e54d6de7 (diff)
Merge branch 'blender-v2.90-release'
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r--source/blender/bmesh/tools/bmesh_bevel.c43
1 files changed, 20 insertions, 23 deletions
diff --git a/source/blender/bmesh/tools/bmesh_bevel.c b/source/blender/bmesh/tools/bmesh_bevel.c
index cfa39237ac9..1d3dd8b0c1c 100644
--- a/source/blender/bmesh/tools/bmesh_bevel.c
+++ b/source/blender/bmesh/tools/bmesh_bevel.c
@@ -7155,31 +7155,9 @@ static void set_profile_spacing(BevelParams *bp, ProfileSpacing *pro_spacing, bo
return;
}
- int seg_2 = power_of_2_max_i(bp->seg);
-
- /* Sample the input number of segments. */
- pro_spacing->xvals = (double *)BLI_memarena_alloc(bp->mem_arena, sizeof(double) * (seg + 1));
- pro_spacing->yvals = (double *)BLI_memarena_alloc(bp->mem_arena, sizeof(double) * (seg + 1));
- if (custom) {
- /* Make sure the curve profile's sample table is full. */
- if (bp->custom_profile->segments_len != seg || !bp->custom_profile->segments) {
- BKE_curveprofile_init((CurveProfile *)bp->custom_profile, (short)seg);
- }
-
- /* Copy segment locations into the profile spacing struct. */
- for (int i = 0; i < seg + 1; i++) {
- pro_spacing->xvals[i] = (double)bp->custom_profile->segments[i].y;
- pro_spacing->yvals[i] = (double)bp->custom_profile->segments[i].x;
- }
- }
- else {
- find_even_superellipse_chords(seg, bp->pro_super_r, pro_spacing->xvals, pro_spacing->yvals);
- }
+ int seg_2 = max_ii(power_of_2_max_i(bp->seg), 4);
/* Sample the seg_2 segments used during vertex mesh subdivision. */
- if (seg_2 == 2) {
- seg_2 = 4;
- }
bp->pro_spacing.seg_2 = seg_2;
if (seg_2 == seg) {
pro_spacing->xvals_2 = pro_spacing->xvals;
@@ -7205,6 +7183,25 @@ static void set_profile_spacing(BevelParams *bp, ProfileSpacing *pro_spacing, bo
seg_2, bp->pro_super_r, pro_spacing->xvals_2, pro_spacing->yvals_2);
}
}
+
+ /* Sample the input number of segments. */
+ pro_spacing->xvals = (double *)BLI_memarena_alloc(bp->mem_arena, sizeof(double) * (seg + 1));
+ pro_spacing->yvals = (double *)BLI_memarena_alloc(bp->mem_arena, sizeof(double) * (seg + 1));
+ if (custom) {
+ /* Make sure the curve profile's sample table is full. */
+ if (bp->custom_profile->segments_len != seg || !bp->custom_profile->segments) {
+ BKE_curveprofile_init((CurveProfile *)bp->custom_profile, (short)seg);
+ }
+
+ /* Copy segment locations into the profile spacing struct. */
+ for (int i = 0; i < seg + 1; i++) {
+ pro_spacing->xvals[i] = (double)bp->custom_profile->segments[i].y;
+ pro_spacing->yvals[i] = (double)bp->custom_profile->segments[i].x;
+ }
+ }
+ else {
+ find_even_superellipse_chords(seg, bp->pro_super_r, pro_spacing->xvals, pro_spacing->yvals);
+ }
}
/**