Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpencil_modifiers/intern/MOD_gpencilmirror.c
| Show First 20 Lines • Show All 168 Lines • ▼ Show 20 Lines | LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) { | ||||
| bGPDframe *gpf = BKE_gpencil_frame_retime_get(depsgraph, scene, ob, gpl); | bGPDframe *gpf = BKE_gpencil_frame_retime_get(depsgraph, scene, ob, gpl); | ||||
| if (gpf == NULL) { | if (gpf == NULL) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| generate_geometry(md, ob, gpl, gpf); | generate_geometry(md, ob, gpl, gpf); | ||||
| } | } | ||||
| } | } | ||||
| static void bakeModifier(Main *bmain, Depsgraph *depsgraph, GpencilModifierData *md, Object *ob) | static void bakeModifier(Main *UNUSED(bmain), | ||||
| Depsgraph *depsgraph, | |||||
| GpencilModifierData *md, | |||||
| Object *ob) | |||||
| { | { | ||||
| 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); | ||||
| 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 mirror effects on this frame */ | /* apply mirror effects on this frame */ | ||||
| CFRA = gpf->framenum; | CFRA = gpf->framenum; | ||||
| BKE_scene_graph_update_for_newframe(depsgraph, bmain); | BKE_scene_graph_update_for_newframe(depsgraph); | ||||
| /* compute mirror effects on this frame */ | /* compute mirror effects on this frame */ | ||||
| generate_geometry(md, ob, gpl, gpf); | generate_geometry(md, ob, gpl, gpf); | ||||
| } | } | ||||
| } | } | ||||
| /* 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 bool isDisabled(GpencilModifierData *UNUSED(md), int UNUSED(userRenderParams)) | static bool isDisabled(GpencilModifierData *UNUSED(md), int UNUSED(userRenderParams)) | ||||
| { | { | ||||
| // MirrorGpencilModifierData *mmd = (MirrorGpencilModifierData *)md; | // MirrorGpencilModifierData *mmd = (MirrorGpencilModifierData *)md; | ||||
| return false; | return false; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 88 Lines • Show Last 20 Lines | |||||