[Bf-blender-cvs] [61c129b57ea] greasepencil-object: Cleanup - Remove direct BKE_gpencil_batch_cache_dirty() code in favor of depsgraph tagging

Joshua Leung noreply at git.blender.org
Sat Nov 4 05:47:54 CET 2017


Commit: 61c129b57ea0fd2b3c97048fe21b0eccec12ee67
Author: Joshua Leung
Date:   Mon Oct 30 03:02:30 2017 +1300
Branches: greasepencil-object
https://developer.blender.org/rB61c129b57ea0fd2b3c97048fe21b0eccec12ee67

Cleanup - Remove direct BKE_gpencil_batch_cache_dirty() code in favor of depsgraph tagging

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

M	source/blender/makesrna/intern/rna_gpencil.c
M	source/blender/makesrna/intern/rna_modifier.c

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

diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index f736735a7b8..11affa6eff9 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -81,11 +81,13 @@ static EnumPropertyItem rna_enum_gpencil_onion_modes_items[] = {
 #include "BKE_gpencil.h"
 #include "BKE_action.h"
 
+#include "DEG_depsgraph.h"
+
 
 static void rna_GPencil_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
 {
 	bGPdata *gpd = (bGPdata *)ptr->id.data;
-	BKE_gpencil_batch_cache_dirty(gpd);
+	DEG_id_tag_update(ptr->id.data, OB_RECALC_DATA);
 	WM_main_add_notifier(NC_GPENCIL | NA_EDITED, NULL);
 }
 
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 5f23bedb9ce..d6228124764 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -508,17 +508,6 @@ static char *rna_Modifier_path(PointerRNA *ptr)
 static void rna_Modifier_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
 {
 	DEG_id_tag_update(ptr->id.data, OB_RECALC_DATA);
-	/* update grease pencil cache. This could be moved to desgraph, but it has no sense to
-	 * repeat this process in any blender area, when only is needed here. This approach can be less
-	 * cleaner, but faster.
-	 */
-	// XXX: Review this (aligorith)
-	Object *obj = (Object *)ptr->id.data;
-	if ((obj) && (obj->type == OB_GPENCIL)) {
-		if (obj->data) {
-			BKE_gpencil_batch_cache_dirty(obj->data);
-		}
-	}
 	WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ptr->id.data);
 }



More information about the Bf-blender-cvs mailing list