[Bf-blender-cvs] [9bdd8a4aa5f] greasepencil-object: Cleanup: Get rid of last uses of BKE_gpencil_batch_cache_alldirty_main()

Joshua Leung noreply at git.blender.org
Wed Mar 21 07:21:41 CET 2018


Commit: 9bdd8a4aa5f6fdb1c5bdb469c5ac249c5a2a5e57
Author: Joshua Leung
Date:   Wed Mar 21 16:10:16 2018 +1300
Branches: greasepencil-object
https://developer.blender.org/rB9bdd8a4aa5f6fdb1c5bdb469c5ac249c5a2a5e57

Cleanup: Get rid of last uses of BKE_gpencil_batch_cache_alldirty_main()

* For any cases that weren't operating on a specific bGPdata instance,
  the DEG_id_type_tag() should do the trick to tag all GP datablocks.

* For the palette case, tagging the palette should trigger just the
  GP datablocks using that palette (and not all of them) to get updated.

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

M	source/blender/blenkernel/BKE_gpencil.h
M	source/blender/blenkernel/intern/gpencil.c
M	source/blender/editors/sculpt_paint/paint_ops.c
M	source/blender/makesrna/intern/rna_sculpt_paint.c

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

diff --git a/source/blender/blenkernel/BKE_gpencil.h b/source/blender/blenkernel/BKE_gpencil.h
index 5a919fb0327..91c8ed3a9ac 100644
--- a/source/blender/blenkernel/BKE_gpencil.h
+++ b/source/blender/blenkernel/BKE_gpencil.h
@@ -68,7 +68,6 @@ void BKE_gpencil_free(struct bGPdata *gpd, bool free_all);
 
 void BKE_gpencil_batch_cache_dirty(struct bGPdata *gpd);
 void BKE_gpencil_batch_cache_free(struct bGPdata *gpd);
-void BKE_gpencil_batch_cache_alldirty_main(struct Main *bmain);
 
 void BKE_gpencil_stroke_sync_selection(struct bGPDstroke *gps);
 
diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c
index 50063a6be4b..626b61d33e6 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -83,20 +83,6 @@ void BKE_gpencil_batch_cache_free(bGPdata *gpd)
 	}
 }
 
-/* Change draw manager status in all gpd datablocks */
-/* TODO: Remove completely? */
-void BKE_gpencil_batch_cache_alldirty_main(Main *bmain)
-{
-	/* XXX: disabled by default, so we can see how much is broken without this */
-	if (G.debug_value == 66) {
-		bGPdata *gpd;
-
-		for (gpd = bmain->gpencil.first; gpd; gpd = gpd->id.next) {
-			BKE_gpencil_batch_cache_dirty(gpd);
-		}
-	}
-}
-
 /* ************************************************** */
 /* Memory Management */
 
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c
index 2fe76c92e3d..15aa6848dce 100644
--- a/source/blender/editors/sculpt_paint/paint_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_ops.c
@@ -490,7 +490,7 @@ static int palettecolor_isolate_exec(bContext *C, wmOperator *op)
 	}
 
 	/* notifiers */
-	BKE_gpencil_batch_cache_alldirty_main(bmain);
+	DEG_id_tag_update(&palette->id, OB_RECALC_DATA);
 	WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL);
 
 	return OPERATOR_FINISHED;
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c
index 7d2fb767c70..c4ae5549d71 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -123,7 +123,7 @@ const EnumPropertyItem rna_enum_symmetrize_direction_items[] = {
 
 static void rna_GPencil_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
 {
-	BKE_gpencil_batch_cache_alldirty_main(bmain);
+	DEG_id_type_tag(bmain, ID_GD);
 	WM_main_add_notifier(NC_GPENCIL | NA_EDITED, NULL);
 }



More information about the Bf-blender-cvs mailing list