[Bf-blender-cvs] [29ce51a67eb] temp-gpencil-bezier-stroke-type: GPencil: Remove Bezier curve data in Evaluated strokes

Antonio Vazquez noreply at git.blender.org
Tue Mar 16 15:36:36 CET 2021


Commit: 29ce51a67ebee6d8a9d70465a9f60c9c56e90fdc
Author: Antonio Vazquez
Date:   Tue Mar 16 15:36:29 2021 +0100
Branches: temp-gpencil-bezier-stroke-type
https://developer.blender.org/rB29ce51a67ebee6d8a9d70465a9f60c9c56e90fdc

GPencil: Remove Bezier curve data in Evaluated strokes

As we have no time to implement Beziers in modifers, we remove in the eval data the curve to keep all system running.

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

M	source/blender/blenkernel/intern/gpencil.c
M	source/blender/blenkernel/intern/gpencil_modifier.c

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

diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c
index 29928cd25d2..07d12c1dc2d 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -1040,7 +1040,10 @@ void BKE_gpencil_frame_copy_strokes(bGPDframe *gpf_src, struct bGPDframe *gpf_ds
   BLI_listbase_clear(&gpf_dst->strokes);
   LISTBASE_FOREACH (bGPDstroke *, gps_src, &gpf_src->strokes) {
     /* make copy of source stroke */
-    gps_dst = BKE_gpencil_stroke_duplicate(gps_src, true, true);
+    /* TODO: While Bezier type is not implemented in modifiers, don't copy the curve data. When
+     * this implementation will be ready, the copy curves parameter must be set again to `true`.
+     * (antoniov/filedescriptor) */
+    gps_dst = BKE_gpencil_stroke_duplicate(gps_src, true, false);
     BLI_addtail(&gpf_dst->strokes, gps_dst);
   }
 }
@@ -2779,7 +2782,7 @@ void BKE_gpencil_frame_original_pointers_update(const struct bGPDframe *gpf_orig
     /* Assign original stroke pointer. */
     if (gps_eval != NULL) {
       gps_eval->runtime.gps_orig = gps_orig;
-      if (GPENCIL_STROKE_TYPE_BEZIER(gps_orig)) {
+      if ((GPENCIL_STROKE_TYPE_BEZIER(gps_orig)) && (GPENCIL_STROKE_TYPE_BEZIER(gps_eval))) {
         bGPDcurve *gpc_orig = gps_orig->editcurve;
         bGPDcurve *gpc_eval = gps_eval->editcurve;
 
diff --git a/source/blender/blenkernel/intern/gpencil_modifier.c b/source/blender/blenkernel/intern/gpencil_modifier.c
index f734241eecb..787de3edc8d 100644
--- a/source/blender/blenkernel/intern/gpencil_modifier.c
+++ b/source/blender/blenkernel/intern/gpencil_modifier.c
@@ -755,8 +755,7 @@ void BKE_gpencil_modifiers_calc(Depsgraph *depsgraph, Scene *scene, Object *ob)
   const bool is_edit = GPENCIL_ANY_EDIT_MODE(gpd);
   const bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd);
   const bool is_render = (bool)(DEG_get_mode(depsgraph) == DAG_EVAL_RENDER);
-  const bool do_modifiers = (bool)((!is_multiedit) &&
-                                   (ob->greasepencil_modifiers.first != NULL) &&
+  const bool do_modifiers = (bool)((!is_multiedit) && (ob->greasepencil_modifiers.first != NULL) &&
                                    (!GPENCIL_SIMPLIFY_MODIF(scene)));
   if (!do_modifiers) {
     return;
@@ -791,6 +790,13 @@ void BKE_gpencil_modifiers_calc(Depsgraph *depsgraph, Scene *scene, Object *ob)
 
           if (mti->deformStroke) {
             LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) {
+              /* TODO: While we implement modifier logic for Bezier type, we remove any Bezier data
+               * to keep running modifiers. Bezier types will be implement in the future, but
+               * we need keep the actual code running. (antoniov/filedescriptor) */
+              if (GPENCIL_STROKE_TYPE_BEZIER(gps)) {
+                BKE_gpencil_free_stroke_editcurve(gps);
+              }
+
               mti->deformStroke(md, depsgraph, ob, gpl, gpf, gps);
             }
           }



More information about the Bf-blender-cvs mailing list