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
path: root/source
diff options
context:
space:
mode:
authorAntonioya <blendergit@gmail.com>2018-12-16 21:53:40 +0300
committerAntonioya <blendergit@gmail.com>2018-12-16 21:53:40 +0300
commitea33b90a1bf21061ab8a862d862db4dea048b28c (patch)
tree01705a2a63d8f978e06168ee4204873cceb485e6 /source
parentfbed69866ea574dcf3a304ca2ca5b223f997b13f (diff)
Fix T59446: Grease pencil mirror modifier wrong
The mirror was working different to mesh mirror and the result was not the expected.
Diffstat (limited to 'source')
-rw-r--r--source/blender/gpencil_modifiers/intern/MOD_gpencilmirror.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilmirror.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilmirror.c
index 7599e7e9bce..52de1529b72 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilmirror.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilmirror.c
@@ -83,26 +83,28 @@ static void update_position(Object *ob, MirrorGpencilModifierData *mmd, bGPDstro
float clear[3] = { 0.0f, 0.0f, 0.0f };
clear[axis] = 1.0f;
- float origin[3];
+ float ob_origin[3];
float mirror_origin[3];
+ float pt_origin[3];
- copy_v3_v3(origin, ob->loc);
+ copy_v3_v3(ob_origin, ob->loc);
/* only works with current axis */
- mul_v3_v3(origin, clear);
+ mul_v3_v3(ob_origin, clear);
zero_v3(mirror_origin);
if (mmd->object) {
- copy_v3_v3(mirror_origin, mmd->object->loc);
- mul_v3_v3(mirror_origin, clear);
- sub_v3_v3(origin, mirror_origin);
+ mul_v3_v3v3(mirror_origin, mmd->object->loc, clear);
}
+
/* clear other axis */
for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
- add_v3_v3(&pt->x, origin);
mul_v3_v3(&pt->x, factor);
- add_v3_v3(&pt->x, mirror_origin);
+ if (mmd->object) {
+ sub_v3_v3v3(pt_origin, ob_origin, mirror_origin);
+ mul_v3_fl(pt_origin, -2.0f);
+ add_v3_v3(&pt->x, pt_origin);
+ }
}
-
}
/* Generic "generateStrokes" callback */