[Bf-blender-cvs] [7656611924c] greasepencil-refactor: Revert "Tag any stroke using the material property"

Antonio Vazquez noreply at git.blender.org
Sat Jan 18 11:56:00 CET 2020


Commit: 7656611924cf9f916321171b8424d2564a65735a
Author: Antonio Vazquez
Date:   Thu Jan 16 16:29:47 2020 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rB7656611924cf9f916321171b8424d2564a65735a

Revert "Tag any stroke using the material property"

This reverts commit 07c2a935cfb17c1d4b13d715d6ede26b632c7447.

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

M	source/blender/editors/gpencil/gpencil_utils.c
M	source/blender/editors/include/ED_gpencil.h
M	source/blender/makesrna/intern/rna_material.c

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

diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c
index aca13d863b6..eef36c3ab73 100644
--- a/source/blender/editors/gpencil/gpencil_utils.c
+++ b/source/blender/editors/gpencil/gpencil_utils.c
@@ -2040,31 +2040,6 @@ void ED_gpencil_update_color_uv(Main *bmain, Material *mat)
   }
 }
 
-/* Tag any stroke using the material */
-void ED_gpencil_material_strokes_tag(Main *bmain, Material *mat)
-{
-  Material *gps_ma = NULL;
-  /* read all strokes  */
-  for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) {
-    if (ob->type == OB_GPENCIL) {
-      bGPdata *gpd = (bGPdata *)ob->data;
-      LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
-        LISTBASE_FOREACH (bGPDframe *, gpf, &gpl->frames) {
-          LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) {
-            gps_ma = BKE_material_gpencil_get(ob, gps->mat_nr + 1);
-            /* update */
-            if ((gps_ma) && (gps_ma == mat)) {
-              gps->tot_triangles = 0;
-              gps->flag |= GP_STROKE_RECALC_GEOMETRY;
-            }
-          }
-        }
-      }
-      DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY);
-    }
-  }
-}
-
 static bool gpencil_check_collision(bGPDstroke *gps,
                                     bGPDstroke **gps_array,
                                     GHash *all_2d,
diff --git a/source/blender/editors/include/ED_gpencil.h b/source/blender/editors/include/ED_gpencil.h
index 35e01df299c..a458f1b3797 100644
--- a/source/blender/editors/include/ED_gpencil.h
+++ b/source/blender/editors/include/ED_gpencil.h
@@ -242,10 +242,10 @@ void ED_gp_project_point_to_plane(const struct Scene *scene,
                                   const int axis,
                                   struct bGPDspoint *pt);
 void ED_gpencil_drawing_reference_get(const struct Scene *scene,
-                                      const struct Object *ob,
-                                      struct bGPDlayer *gpl,
-                                      char align_flag,
-                                      float vec[3]);
+                                 const struct Object *ob,
+                                 struct bGPDlayer *gpl,
+                                 char align_flag,
+                                 float vec[3]);
 void ED_gpencil_project_stroke_to_view(struct bContext *C,
                                        struct bGPDlayer *gpl,
                                        struct bGPDstroke *gps);
@@ -262,15 +262,13 @@ void ED_gpencil_vgroup_deselect(struct bContext *C, struct Object *ob);
 /* join objects */
 int ED_gpencil_join_objects_exec(struct bContext *C, struct wmOperator *op);
 
-/* texture coordinate and tag utilities */
+/* texture coordinate utilities */
 void ED_gpencil_tpoint_to_point(struct ARegion *ar,
                                 float origin[3],
                                 const struct tGPspoint *tpt,
                                 struct bGPDspoint *pt);
 void ED_gpencil_update_color_uv(struct Main *bmain, struct Material *mat);
 
-void ED_gpencil_material_strokes_tag(struct Main *bmain, struct Material *mat);
-
 /* extend selection to stroke intersections
  * returns:
  * 0 - No hit
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c
index c0a004b93ce..bc18af9e532 100644
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -112,9 +112,6 @@ static void rna_MaterialGpencil_update(Main *bmain, Scene *scene, PointerRNA *pt
 {
   Material *ma = (Material *)ptr->owner_id;
 
-  /* Tag any related stroke. */
-  ED_gpencil_material_strokes_tag(bmain, ma);
-
   rna_Material_update(bmain, scene, ptr);
   WM_main_add_notifier(NC_GPENCIL | ND_DATA, ma);
 }



More information about the Bf-blender-cvs mailing list