[Bf-blender-cvs] [0d159bf74e3] soc-2019-npr: LANPR: Removed duplicated code in stroke modifier.

Yiming Wu noreply at git.blender.org
Thu Jun 13 17:09:28 CEST 2019


Commit: 0d159bf74e34a335a79bf28f3e78c04cd4ba9959
Author: Yiming Wu
Date:   Thu Jun 13 23:09:22 2019 +0800
Branches: soc-2019-npr
https://developer.blender.org/rB0d159bf74e34a335a79bf28f3e78c04cd4ba9959

LANPR: Removed duplicated code in stroke modifier.

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

M	source/blender/gpencil_modifiers/intern/MOD_gpencilstroke.c

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

diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilstroke.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilstroke.c
index ee1efaa7802..9fe6fd66dd9 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilstroke.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilstroke.c
@@ -81,6 +81,11 @@ static void copyData(const GpencilModifierData *md, GpencilModifierData *target)
   BKE_gpencil_modifier_copyData_generic(md, target);
 }
 
+static void deformStroke(GpencilModifierData *md, Depsgraph *depsgraph, Object *ob, bGPDlayer *gpl, bGPDframe *gpf){
+  lanpr_update_data_for_external(depsgraph);
+  lanpr_generate_gpencil_from_chain(md, depsgraph, ob, gpl, gpf);
+}
+
 static void bakeModifier(Main *UNUSED(bmain),
                          Depsgraph *depsgraph,
                          GpencilModifierData *md,
@@ -91,10 +96,7 @@ static void bakeModifier(Main *UNUSED(bmain),
 
   for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) {
     for (bGPDframe *gpf = gpl->frames.first; gpf; gpf = gpf->next) {
-      // lanpr_generate_gpencil_geometry(md, depsgraph, ob, gpl, gpf);
-      lanpr_update_data_for_external(depsgraph);
-      lanpr_generate_gpencil_from_chain(md, depsgraph, ob, gpl, gpf);
-      return;
+      deformStroke(md, depsgraph, ob, gpl, gpf);
     }
   }
 }
@@ -105,9 +107,7 @@ static void bakeModifier(Main *UNUSED(bmain),
 static void generateStrokes(
     GpencilModifierData *md, Depsgraph *depsgraph, Object *ob, bGPDlayer *gpl, bGPDframe *gpf)
 {
-  // lanpr_generate_gpencil_geometry(md, depsgraph, ob, gpl, gpf);
-  lanpr_update_data_for_external(depsgraph);
-  lanpr_generate_gpencil_from_chain(md, depsgraph, ob, gpl, gpf);
+  deformStroke(md, depsgraph, ob, gpl, gpf);
 }
 
 static void updateDepsgraph(GpencilModifierData *md, const ModifierUpdateDepsgraphContext *ctx)



More information about the Bf-blender-cvs mailing list