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:
Diffstat (limited to 'source/blender/editors/transform/transform_convert_gpencil.c')
-rw-r--r--source/blender/editors/transform/transform_convert_gpencil.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/editors/transform/transform_convert_gpencil.c b/source/blender/editors/transform/transform_convert_gpencil.c
index 00b0eab90cd..2bfce9f8418 100644
--- a/source/blender/editors/transform/transform_convert_gpencil.c
+++ b/source/blender/editors/transform/transform_convert_gpencil.c
@@ -25,11 +25,13 @@
#include "MEM_guardedalloc.h"
+#include "BLI_ghash.h"
#include "BLI_math.h"
#include "BKE_colortools.h"
#include "BKE_context.h"
#include "BKE_gpencil.h"
+#include "BKE_gpencil_geom.h"
#include "ED_gpencil.h"
@@ -376,4 +378,23 @@ void createTransGPencil(bContext *C, TransInfo *t)
}
}
+/* force recalculation of triangles during transformation */
+void recalcData_gpencil_strokes(TransInfo *t)
+{
+ TransDataContainer *tc = TRANS_DATA_CONTAINER_FIRST_SINGLE(t);
+ 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) && (!BLI_ghash_haskey(strokes, gps))) {
+ BLI_ghash_insert(strokes, gps, gps);
+ /* Calc geometry data. */
+ BKE_gpencil_stroke_geometry_update(gps);
+ }
+ }
+ BLI_ghash_free(strokes, NULL, NULL);
+}
+
/** \} */