[Bf-blender-cvs] [3d9d132ccd4] master: GPencil: Fix unreported slow transform with proportional edition
Antonio Vazquez
noreply at git.blender.org
Fri Mar 20 20:03:28 CET 2020
Commit: 3d9d132ccd4511308fbeb2d1ac323ed028a4cd9f
Author: Antonio Vazquez
Date: Fri Mar 20 20:01:35 2020 +0100
Branches: master
https://developer.blender.org/rB3d9d132ccd4511308fbeb2d1ac323ed028a4cd9f
GPencil: Fix unreported slow transform with proportional edition
Now a hash is used to avoid double update of the same stroke. The old method was not correct with proportional edition.
===================================================================
M source/blender/editors/transform/transform_generics.c
===================================================================
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index cb7071e0f49..7a787b77a62 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -47,6 +47,7 @@
#include "DNA_view3d_types.h"
#include "BLI_blenlib.h"
+#include "BLI_ghash.h"
#include "BLI_math.h"
#include "BLI_rand.h"
#include "BLI_utildefines.h"
@@ -1149,17 +1150,19 @@ static void recalcData_sequencer(TransInfo *t)
static void recalcData_gpencil_strokes(TransInfo *t)
{
TransDataContainer *tc = TRANS_DATA_CONTAINER_FIRST_SINGLE(t);
- bGPDstroke *gps_prev = NULL;
+ GHash *strokes = BLI_ghash_ptr_new(__func__);
TransData *td = tc->data;
for (int i = 0; i < tc->data_len; i++, td++) {
bGPDstroke *gps = td->extra;
- if ((gps != NULL) && (gps != gps_prev)) {
+
+ if ((gps != NULL) && (!BLI_ghash_haskey(strokes, gps))) {
+ BLI_ghash_insert(strokes, gps, gps);
/* Calc geometry data. */
BKE_gpencil_stroke_geometry_update(gps);
- gps_prev = gps;
}
}
+ BLI_ghash_free(strokes, NULL, NULL);
}
static void recalcData_sculpt(TransInfo *t)
More information about the Bf-blender-cvs
mailing list