[Bf-blender-cvs] [ea33b90a1bf] blender2.8: Fix T59446: Grease pencil mirror modifier wrong
Antonioya
noreply at git.blender.org
Sun Dec 16 19:53:49 CET 2018
Commit: ea33b90a1bf21061ab8a862d862db4dea048b28c
Author: Antonioya
Date: Sun Dec 16 19:53:40 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBea33b90a1bf21061ab8a862d862db4dea048b28c
Fix T59446: Grease pencil mirror modifier wrong
The mirror was working different to mesh mirror and the result was not the expected.
===================================================================
M source/blender/gpencil_modifiers/intern/MOD_gpencilmirror.c
===================================================================
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 */
More information about the Bf-blender-cvs
mailing list