diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2022-03-14 18:10:03 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2022-03-14 18:13:59 +0300 |
commit | cff6eb65804da3a06bde3c9152bec26e01a24992 (patch) | |
tree | b3d49cf7281568000695116fe990828660ed48c0 /source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c | |
parent | 8c4ddd5dde3a5f5ae0375c71e379e0fac287e3e6 (diff) |
Cleanup: Remove duplicate Bake modifier code
This patch remove all duplicate code for the same Bake modifier logic.
Still some modifiers need custom bake functions and cannot use this generic bake.
Diffstat (limited to 'source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c')
-rw-r--r-- | source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c index deac2b17498..bc0464cb4f9 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c @@ -267,32 +267,12 @@ static void bakeModifier(Main *UNUSED(bmain), Object *ob) { HookGpencilModifierData *mmd = (HookGpencilModifierData *)md; - Scene *scene = DEG_get_evaluated_scene(depsgraph); - bGPdata *gpd = ob->data; - int oldframe = (int)DEG_get_ctime(depsgraph); if (mmd->object == NULL) { return; } - LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) { - LISTBASE_FOREACH (bGPDframe *, gpf, &gpl->frames) { - /* apply hook effects on this frame - * NOTE: this assumes that we don't want hook animation on non-keyframed frames - */ - CFRA = gpf->framenum; - BKE_scene_graph_update_for_newframe(depsgraph); - - /* compute hook effects on this frame */ - LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) { - deformStroke(md, depsgraph, ob, gpl, gpf, gps); - } - } - } - - /* return frame state and DB to original state */ - CFRA = oldframe; - BKE_scene_graph_update_for_newframe(depsgraph); + generic_bake_deform_stroke(depsgraph, md, ob, true, deformStroke); } static void freeData(GpencilModifierData *md) |