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.
This commit is contained in:
Antonio Vazquez 2018-08-04 15:59:57 +02:00
parent 4edae3cc2d
commit ccf794dfc4
1 changed files with 0 additions and 29 deletions

View File

@ -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 */