Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpencil_modifiers/intern/MOD_gpenciltint.c
| Show First 20 Lines • Show All 253 Lines • ▼ Show 20 Lines | if (mmd->mode != GPPAINT_MODE_FILL) { | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* FIXME: Ideally we be doing this on a copy of the main depsgraph | /* FIXME: Ideally we be doing this on a copy of the main depsgraph | ||||
| * (i.e. one where we don't have to worry about restoring state) | * (i.e. one where we don't have to worry about restoring state) | ||||
| */ | */ | ||||
| static void bakeModifier(Main *bmain, Depsgraph *depsgraph, GpencilModifierData *md, Object *ob) | static void bakeModifier(Main *UNUSED(bmain), | ||||
| Depsgraph *depsgraph, | |||||
| GpencilModifierData *md, | |||||
| Object *ob) | |||||
| { | { | ||||
| TintGpencilModifierData *mmd = (TintGpencilModifierData *)md; | TintGpencilModifierData *mmd = (TintGpencilModifierData *)md; | ||||
| Scene *scene = DEG_get_evaluated_scene(depsgraph); | Scene *scene = DEG_get_evaluated_scene(depsgraph); | ||||
| bGPdata *gpd = ob->data; | bGPdata *gpd = ob->data; | ||||
| int oldframe = (int)DEG_get_ctime(depsgraph); | int oldframe = (int)DEG_get_ctime(depsgraph); | ||||
| if (mmd->object == NULL) { | if (mmd->object == NULL) { | ||||
| return; | return; | ||||
| } | } | ||||
| LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) { | LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) { | ||||
| LISTBASE_FOREACH (bGPDframe *, gpf, &gpl->frames) { | LISTBASE_FOREACH (bGPDframe *, gpf, &gpl->frames) { | ||||
| /* apply effects on this frame | /* apply effects on this frame | ||||
| * NOTE: this assumes that we don't want animation on non-keyframed frames | * NOTE: this assumes that we don't want animation on non-keyframed frames | ||||
| */ | */ | ||||
| CFRA = gpf->framenum; | CFRA = gpf->framenum; | ||||
| BKE_scene_graph_update_for_newframe(depsgraph, bmain); | BKE_scene_graph_update_for_newframe(depsgraph); | ||||
| /* compute effects on this frame */ | /* compute effects on this frame */ | ||||
| LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) { | LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) { | ||||
| deformStroke(md, depsgraph, ob, gpl, gpf, gps); | deformStroke(md, depsgraph, ob, gpl, gpf, gps); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* return frame state and DB to original state */ | /* return frame state and DB to original state */ | ||||
| CFRA = oldframe; | CFRA = oldframe; | ||||
| BKE_scene_graph_update_for_newframe(depsgraph, bmain); | BKE_scene_graph_update_for_newframe(depsgraph); | ||||
| } | } | ||||
| static void freeData(GpencilModifierData *md) | static void freeData(GpencilModifierData *md) | ||||
| { | { | ||||
| TintGpencilModifierData *mmd = (TintGpencilModifierData *)md; | TintGpencilModifierData *mmd = (TintGpencilModifierData *)md; | ||||
| if (mmd->colorband) { | if (mmd->colorband) { | ||||
| MEM_freeN(mmd->colorband); | MEM_freeN(mmd->colorband); | ||||
| mmd->colorband = NULL; | mmd->colorband = NULL; | ||||
| ▲ Show 20 Lines • Show All 119 Lines • Show Last 20 Lines | |||||