From 52064bf5da75f7763881bd69bf9159aeba9c4baa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Ch=C3=A9hab?= Date: Wed, 1 Mar 2023 10:09:23 +0100 Subject: [PATCH] Fix #104824: GPencil natural drawing building with 1 subdivision very slow 1. Changes the subdivision function to not fill in time but add 0 to fix bug #104824 2. Fixes a bug in sanitization function noticed while fixing this bug. Pull Request #105306 --- source/blender/blenkernel/intern/gpencil_geom.cc | 2 +- source/blender/gpencil_modifiers/intern/MOD_gpencilbuild.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/blender/blenkernel/intern/gpencil_geom.cc b/source/blender/blenkernel/intern/gpencil_geom.cc index e3884c17516..325aa5e8e42 100644 --- a/source/blender/blenkernel/intern/gpencil_geom.cc +++ b/source/blender/blenkernel/intern/gpencil_geom.cc @@ -2270,7 +2270,7 @@ void BKE_gpencil_stroke_subdivide(bGPdata *gpd, bGPDstroke *gps, int level, int pt_final->uv_fac = interpf(pt->uv_fac, next->uv_fac, 0.5f); interp_v4_v4v4(pt_final->uv_fill, pt->uv_fill, next->uv_fill, 0.5f); CLAMP(pt_final->strength, GPENCIL_STRENGTH_MIN, 1.0f); - pt_final->time = interpf(pt->time, next->time, 0.5f); + pt_final->time = 0; pt_final->runtime.pt_orig = nullptr; pt_final->flag = 0; interp_v4_v4v4(pt_final->vert_color, pt->vert_color, next->vert_color, 0.5f); diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilbuild.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilbuild.c index d5aa97987af..5daa45aba99 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencilbuild.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilbuild.c @@ -384,7 +384,7 @@ static void build_sequential(Object *ob, /* Cycling backwards through zero-points to fix them. */ for (int k = 0; k < zeropoints; k++) { float linear_fill = interpf( - deltatime, 0, ((float)k + 1) / (zeropoints + 1)); /* Factor = Proportion. */ + 0, deltatime, ((float)k + 1) / (zeropoints + 1)); /* Factor = Proportion. */ idx_times[curpoint - k - 1] = sumtime + linear_fill; } }