[Bf-blender-cvs] [ccf794dfc4c] blender2.8: GP: Fix stupid mistake in mirror modifier

Antonioya noreply at git.blender.org
Sat Aug 4 16:00:11 CEST 2018


Commit: ccf794dfc4c84e9831c48defa4dbb43b9e5bf63f
Author: Antonioya
Date:   Sat Aug 4 15:59:57 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBccf794dfc4c84e9831c48defa4dbb43b9e5bf63f

GP: Fix stupid mistake in mirror modifier

The object can be NULL. This was a line used in debug that it was not removed.

Also removed an old function not used.

Thanks to Charlie Jolly for catching this error.

===================================================================

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 d4e8e8d3cff..a01ed4da695 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilmirror.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilmirror.c
@@ -73,29 +73,6 @@ static void copyData(const GpencilModifierData *md, GpencilModifierData *target)
 	BKE_gpencil_modifier_copyData_generic(md, target);
 }
 
-static void clip_stroke(MirrorGpencilModifierData *mmd, bGPDstroke *gps)
-{
-	int i;
-	bGPDspoint *pt;
-	float fpt[3];
-	if ((mmd->flag & GP_MIRROR_CLIPPING) == 0) {
-		return;
-	}
-
-	for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
-		copy_v3_v3(fpt, &pt->x);
-		for (int xi = 0; xi < 3; ++xi) {
-			if (mmd->flag & (GP_MIRROR_AXIS_X << xi)) {
-				if (fpt[xi] >= 0.0f) {
-					fpt[xi] = 0.0f;
-				}
-			}
-		}
-		copy_v3_v3(&pt->x, fpt);
-	}
-
-}
-
 static void update_position(Object *ob, MirrorGpencilModifierData *mmd, bGPDstroke *gps, int axis)
 {
 	int i;
@@ -150,9 +127,6 @@ static void generateStrokes(
 					ob, mmd->layername, mmd->pass_index, 1, gpl, gps,
 					mmd->flag & GP_MIRROR_INVERT_LAYER, mmd->flag & GP_MIRROR_INVERT_PASS))
 				{
-					/* clip before duplicate */
-					clip_stroke(mmd, gps);
-
 					gps_new = BKE_gpencil_stroke_duplicate(gps);
 					update_position(ob, mmd, gps_new, xi);
 					BLI_addtail(&gpf->strokes, gps_new);
@@ -171,9 +145,6 @@ static void bakeModifier(
 	bGPdata *gpd = ob->data;
 	int oldframe = (int)DEG_get_ctime(depsgraph);
 
-	if (mmd->object == NULL)
-		return;
-
 	for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) {
 		for (bGPDframe *gpf = gpl->frames.first; gpf; gpf = gpf->next) {
 			/* apply mirror effects on this frame */



More information about the Bf-blender-cvs mailing list