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:
authorAntonio Vazquez <blendergit@gmail.com>2021-07-26 18:20:00 +0300
committerAntonio Vazquez <blendergit@gmail.com>2021-07-26 18:20:00 +0300
commita14ee85ccda63459395b6dc1b18c597e425b261a (patch)
tree10329c6609b4a617913bfe13680df38b340597f3
parent231b313c559b6a4969051e2f0fb978c59cf3d044 (diff)
Fix T90127: Merge Down layer doesn't take the transform location into account
Now the layer transformation is applied before the merge.
-rw-r--r--source/blender/editors/gpencil/gpencil_data.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c
index b1e57079d28..48026ae1bda 100644
--- a/source/blender/editors/gpencil/gpencil_data.c
+++ b/source/blender/editors/gpencil/gpencil_data.c
@@ -1355,6 +1355,14 @@ static int gpencil_merge_layer_exec(bContext *C, wmOperator *op)
LISTBASE_FOREACH (bGPDframe *, gpf_src, &gpl_src->frames) {
/* Try to find frame in destination layer hash table. */
bGPDframe *gpf_dst = BLI_ghash_lookup(gh_frames_dst, POINTER_FROM_INT(gpf_src->framenum));
+ /* Apply layer transformation. */
+ LISTBASE_FOREACH (bGPDstroke *, gps_src, &gpf_src->strokes) {
+ for (int p = 0; p < gps_src->totpoints; p++) {
+ const bGPDspoint *pt = &gps_src->points[p];
+ mul_v3_m4v3(&pt->x, gpl_src->layer_mat, &pt->x);
+ }
+ }
+
/* Add to tail all strokes. */
if (gpf_dst) {
BLI_movelisttolist(&gpf_dst->strokes, &gpf_src->strokes);