[Bf-blender-cvs] [c355869cb1e] greasepencil-object: Cleanup: Remove a whole bunch of manual GP cache tagging (marked for review)

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


Commit: c355869cb1ee25a5cafc2f2537b3ff1aca541ded
Author: Joshua Leung
Date:   Sat Nov 4 13:20:08 2017 +1300
Branches: greasepencil-object
https://developer.blender.org/rBc355869cb1ee25a5cafc2f2537b3ff1aca541ded

Cleanup: Remove a whole bunch of manual GP cache tagging (marked for review)

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

M	source/blender/editors/object/object_modifier.c
M	source/blender/editors/space_time/space_time.c
M	source/blender/makesrna/intern/rna_modifier.c

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

diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index 6526744e293..0ae0dd243c6 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -334,13 +334,6 @@ static bool object_modifier_remove(Main *bmain, Object *ob, ModifierData *md,
 	modifier_free(md);
 	BKE_object_free_derived_caches(ob);
 
-	/* if grease pencil, need refresh cache */
-#if 0 // XXX: Review this (aligorith)
-	if (ob->type == OB_GPENCIL) {
-		BKE_gpencil_batch_cache_dirty(ob->gpd);
-	}
-#endif
-
 	return 1;
 }
 
@@ -927,13 +920,6 @@ static int modifier_remove_exec(bContext *C, wmOperator *op)
 		if ((ob->mode & OB_MODE_PARTICLE_EDIT) == 0)
 			if (sl->basact && sl->basact->object == ob)
 				WM_event_add_notifier(C, NC_SCENE | ND_MODE | NS_MODE_OBJECT, NULL);
-	
-	/* if grease pencil, need refresh cache */
-#if 0 // XXX: Review this (aligorith)
-	if (ob->type == OB_GPENCIL) {
-		BKE_gpencil_batch_cache_dirty(ob->data);
-	}
-#endif
 
 	return OPERATOR_FINISHED;
 }
@@ -974,13 +960,6 @@ static int modifier_move_up_exec(bContext *C, wmOperator *op)
 	DEG_id_tag_update(&ob->id, OB_RECALC_DATA);
 	WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob);
 
-	/* if grease pencil, need refresh cache */
-#if 0 // XXX: Review this (aligorith)
-	if (ob->type == OB_GPENCIL) {
-		BKE_gpencil_batch_cache_dirty(ob->data);
-	}
-#endif
-
 	return OPERATOR_FINISHED;
 }
 
@@ -1020,13 +999,6 @@ static int modifier_move_down_exec(bContext *C, wmOperator *op)
 	DEG_id_tag_update(&ob->id, OB_RECALC_DATA);
 	WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob);
 
-	/* if grease pencil, need refresh cache */
-#if 0 // XXX: Review this (aligorith)
-	if (ob->type == OB_GPENCIL) {
-		BKE_gpencil_batch_cache_dirty(ob->data);
-	}
-#endif
-
 	return OPERATOR_FINISHED;
 }
 
@@ -1158,13 +1130,6 @@ static int modifier_copy_exec(bContext *C, wmOperator *op)
 	DEG_id_tag_update(&ob->id, OB_RECALC_DATA);
 	WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob);
 
-	/* if grease pencil, need refresh cache */
-#if 0 // XXX: Review this (aligorith)
-	if (ob->type == OB_GPENCIL) {
-		BKE_gpencil_batch_cache_dirty(ob->data);
-	}
-#endif
-
 	return OPERATOR_FINISHED;
 }
 
diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c
index 6604c5ff22c..eb4c6f64630 100644
--- a/source/blender/editors/space_time/space_time.c
+++ b/source/blender/editors/space_time/space_time.c
@@ -432,10 +432,6 @@ static void time_draw_keyframes(const bContext *C, ARegion *ar)
 	/* draw grease pencil keyframes (if available) */	
 	UI_GetThemeColor3ubv(TH_TIME_GP_KEYFRAME, color);
 
-	if (scene->gpd) {
-		// XXX: Review this (aligorith)
-		time_draw_idblock_keyframes(v2d, (ID *)scene->gpd, onlysel, color);
-	}
 	if (ob && ob->data && (ob->type == OB_GPENCIL)) {
 		time_draw_idblock_keyframes(v2d, (ID *)ob->data, onlysel, color);
 	}
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index e7c7df35aae..e5b57c97cf7 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -517,24 +517,6 @@ static void rna_Modifier_dependency_update(Main *bmain, Scene *scene, PointerRNA
 	DEG_relations_tag_update(bmain);
 }
 
-/* Hacky update callback for updating GPencil modifiers.
- *
- * For whatever reason, sometimes updating the modifier settings
- * doesn't trigger a refresh. So, we'll just call one manually...
- *
- * FIXME: The depsgraph is probably missing a relation somewhere
- * between Modifier properties and GP geometry ubereval... (aligorith)
- */
-static void rna_Modifier_gpencil_update(Main *bmain, Scene *scene, PointerRNA *ptr)
-{
-	Object *ob = ptr->id.data;
-	if (ob && ob->data) {
-		BKE_gpencil_batch_cache_dirty(ob->data);
-	}
-	
-	rna_Modifier_update(bmain, scene, ptr);
-}
-
 /* Vertex Groups */
 
 #define RNA_MOD_VGROUP_NAME_SET(_type, _prop)                                               \
@@ -4881,76 +4863,76 @@ static void rna_def_modifier_gpencilnoise(BlenderRNA *brna)
 	prop = RNA_def_property(srna, "layer", PROP_STRING, PROP_NONE);
 	RNA_def_property_string_sdna(prop, NULL, "layername");
 	RNA_def_property_ui_text(prop, "Layer", "Layer name");
-	RNA_def_property_update(prop, 0, "rna_Modifier_gpencil_update");
+	RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
 	prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
 	RNA_def_property_string_sdna(prop, NULL, "vgname");
 	RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name for modulating the deform");
 	RNA_def_property_string_funcs(prop, NULL, NULL, "rna_GpencilNoiseModifier_vgname_set");
-	RNA_def_property_update(prop, 0, "rna_Modifier_gpencil_update");
+	RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
 	prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "factor");
 	RNA_def_property_range(prop, 0, 30.0);
 	RNA_def_property_ui_text(prop, "Factor", "Amount of noise to apply");
-	RNA_def_property_update(prop, 0, "rna_Modifier_gpencil_update");
+	RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
 	prop = RNA_def_property(srna, "random", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_NOISE_USE_RANDOM);
 	RNA_def_property_ui_text(prop, "Random", "Use random values");
-	RNA_def_property_update(prop, 0, "rna_Modifier_gpencil_update");
+	RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
 	prop = RNA_def_property(srna, "affect_position", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_NOISE_MOD_LOCATION);
 	RNA_def_property_ui_text(prop, "Affect Position", "The modifier affects the position of the point");
-	RNA_def_property_update(prop, 0, "rna_Modifier_gpencil_update");
+	RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
 	prop = RNA_def_property(srna, "affect_strength", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_NOISE_MOD_STRENGTH);
 	RNA_def_property_ui_text(prop, "Affect Strength", "The modifier affects the color strength of the point");
-	RNA_def_property_update(prop, 0, "rna_Modifier_gpencil_update");
+	RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
 	prop = RNA_def_property(srna, "affect_thickness", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_NOISE_MOD_THICKNESS);
 	RNA_def_property_ui_text(prop, "Affect Thickness", "The modifier affects the thickness of the point");
-	RNA_def_property_update(prop, 0, "rna_Modifier_gpencil_update");
+	RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
 	prop = RNA_def_property(srna, "full_stroke", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_NOISE_FULL_STROKE);
 	RNA_def_property_ui_text(prop, "Full Stroke", "The noise moves the stroke as a whole, not point by point");
-	RNA_def_property_update(prop, 0, "rna_Modifier_gpencil_update");
+	RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
 	prop = RNA_def_property(srna, "move_extreme", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_NOISE_MOVE_EXTREME);
 	RNA_def_property_ui_text(prop, "Move Extremes", "The noise moves the stroke extreme points");
-	RNA_def_property_update(prop, 0, "rna_Modifier_gpencil_update");
+	RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
 	prop = RNA_def_property(srna, "pass_index", PROP_INT, PROP_NONE);
 	RNA_def_property_int_sdna(prop, NULL, "pass_index");
 	RNA_def_property_range(prop, 0, 100);
 	RNA_def_property_ui_text(prop, "Pass", "Pass index");
-	RNA_def_property_update(prop, 0, "rna_Modifier_gpencil_update");
+	RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
 	prop = RNA_def_property(srna, "step", PROP_INT, PROP_NONE);
 	RNA_def_property_int_sdna(prop, NULL, "step");
 	RNA_def_property_range(prop, 1, 100);
 	RNA_def_property_ui_text(prop, "Step", "Number of frames before recalculate random values again");
-	RNA_def_property_update(prop, 0, "rna_Modifier_gpencil_update");
+	RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
 	prop = RNA_def_property(srna, "inverse_layers", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_NOISE_INVERSE_LAYER);
 	RNA_def_property_ui_text(prop, "Inverse Layers", "Inverse filter");
-	RNA_def_property_update(prop, 0, "rna_Modifier_gpencil_update");
+	RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
 	prop = RNA_def_property(srna, "inverse_pass", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_NOISE_INVERSE_PASS);
 	RNA_def_property_ui_text(prop, "Inverse Pass", "Inverse filter");
-	RNA_def_property_update(prop, 0, "rna_Modifier_gpencil_update");
+	RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
 	prop = RNA_def_property(srna, "inverse_vertex", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_NOISE_INVERSE_VGROUP);
 	RNA_def_property_ui_text(prop, "Inverse VertexGroup", "Inverse filter");
-	RNA_def_property_update(prop, 0, "rna_Modifier_gpencil_update");
+	RNA_def_property_update(prop, 0, "rna_Modifier_update");
 }
 
 static void rna_def_modifier_gpencilsubdiv(BlenderRNA *brna)
@@ -4966,34 +4948,34 @@ static void rna_def_modifier_gpencilsubdiv(BlenderRNA *brna)
 	prop = RNA_def_property(srna, "layer", PROP_STRING, PROP_NONE);
 	RNA_def_property_string_sdna(prop, NULL, "layername");
 	RNA_def_property_ui_text(prop, "Layer", "Layer name");
-	RNA_def_property_update(prop, 0, "rna_Modifier_gpencil_update");
+	RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
 	prop = RNA_def_property(srna, "level", PROP_INT, PROP_NONE);
 	RNA_def_property_int_sdna(prop, NULL, "level");
 	RNA_def_property_range(prop, 0, 5);
 	RNA_def_property_ui_text(prop, "Level", "Number of subdivisions");
-	RNA_def_property_update(prop, 0, "rna_Modifier_gpencil_update");
+	RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
 	prop = RNA_def_property(srna, "simple", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_SUBDIV_SIMPLE);
 	RNA_def_property_

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list