[Bf-blender-cvs] [703c302] GPencil_EditStrokes: Notifier fixes for entering/exiting stroke editmode (and other fixes)

Joshua Leung noreply at git.blender.org
Sat Nov 29 13:57:05 CET 2014


Commit: 703c302641c696c0fa19a836bee9769b1c9d98bf
Author: Joshua Leung
Date:   Sun Nov 30 01:56:05 2014 +1300
Branches: GPencil_EditStrokes
https://developer.blender.org/rB703c302641c696c0fa19a836bee9769b1c9d98bf

Notifier fixes for entering/exiting stroke editmode (and other fixes)

* Entering/exiting stroke editmode now updates the headers, so that the right
  proportional editing options get shown

* Doing anything Grease Pencil related in the Node Editor doesn't trigger a
  recalc of the nodetree anymore. AFAICT, there is no legitimate reason to
  be doing full refreshes there - simple redraws will do.

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

M	source/blender/editors/space_clip/space_clip.c
M	source/blender/editors/space_node/space_node.c
M	source/blender/editors/space_sequencer/space_sequencer.c
M	source/blender/editors/space_view3d/space_view3d.c
M	source/blender/makesrna/intern/rna_gpencil.c
M	source/blender/windowmanager/WM_types.h

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

diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c
index bf9b55b..fc2c0d3 100644
--- a/source/blender/editors/space_clip/space_clip.c
+++ b/source/blender/editors/space_clip/space_clip.c
@@ -420,6 +420,9 @@ static void clip_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *wmn)
 				clip_scopes_check_gpencil_change(sa);
 				ED_area_tag_redraw(sa);
 			}
+			else if (wmn->data & ND_GPENCIL_EDITMODE) {
+				ED_area_tag_redraw(sa);
+			}
 			break;
 	}
 }
@@ -1245,6 +1248,8 @@ static void clip_main_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), AR
 		case NC_GPENCIL:
 			if (wmn->action == NA_EDITED)
 				ED_region_tag_redraw(ar);
+			else if (wmn->data & ND_GPENCIL_EDITMODE)
+				ED_region_tag_redraw(ar);
 			break;
 	}
 }
@@ -1495,7 +1500,7 @@ static void clip_properties_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(s
 	/* context changes */
 	switch (wmn->category) {
 		case NC_GPENCIL:
-			if (wmn->data == ND_DATA)
+			if (ELEM(wmn->data, ND_DATA, ND_GPENCIL_EDITMODE))
 				ED_region_tag_redraw(ar);
 			break;
 		case NC_BRUSH:
diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c
index bf735f3..3c91b33 100644
--- a/source/blender/editors/space_node/space_node.c
+++ b/source/blender/editors/space_node/space_node.c
@@ -515,7 +515,7 @@ static void node_area_listener(bScreen *sc, ScrArea *sa, wmNotifier *wmn)
 			break;
 		case NC_GPENCIL:
 			if (ELEM(wmn->action, NA_EDITED, NA_SELECTED)) {
-				ED_area_tag_refresh(sa);
+				ED_area_tag_redraw(sa);
 			}
 			break;
 	}
@@ -771,6 +771,8 @@ static void node_region_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegi
 		case NC_GPENCIL:
 			if (wmn->action == NA_EDITED)
 				ED_region_tag_redraw(ar);
+			else if (wmn->data & ND_GPENCIL_EDITMODE)
+				ED_region_tag_redraw(ar);
 			break;
 	}
 }
diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c
index 2172a12..6231f02 100644
--- a/source/blender/editors/space_sequencer/space_sequencer.c
+++ b/source/blender/editors/space_sequencer/space_sequencer.c
@@ -352,6 +352,10 @@ static void sequencer_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *wmn
 			if (wmn->data == ND_SPACE_SEQUENCER)
 				sequencer_scopes_tag_refresh(sa);
 			break;
+		case NC_GPENCIL:
+			if (wmn->data & ND_GPENCIL_EDITMODE)
+				ED_area_tag_redraw(sa);
+			break;
 	}
 }
 
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index 369d824..78961b0 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -1008,6 +1008,10 @@ static void view3d_header_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa)
 			if (wmn->data == ND_SPACE_VIEW3D)
 				ED_region_tag_redraw(ar);
 			break;
+		case NC_GPENCIL:
+			if (wmn->data & ND_GPENCIL_EDITMODE)
+				ED_region_tag_redraw(ar);
+			break;
 	}
 }
 
@@ -1105,7 +1109,7 @@ static void view3d_buttons_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa
 				ED_region_tag_redraw(ar);
 			break;
 		case NC_GPENCIL:
-			if (wmn->data == ND_DATA || wmn->action == NA_EDITED)
+			if ((wmn->data & (ND_DATA | ND_GPENCIL_EDITMODE)) || (wmn->action == NA_EDITED))
 				ED_region_tag_redraw(ar);
 			break;
 		case NC_IMAGE:
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index ace4f75..96d0201 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -856,7 +856,7 @@ static void rna_def_gpencil_data(BlenderRNA *brna)
 	prop = RNA_def_property(srna, "use_stroke_edit_mode", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_DATA_STROKE_EDITMODE);
 	RNA_def_property_ui_text(prop, "Stroke Edit Mode", "Enable alternative keymap to make editing stroke points easier");
-	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
+	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA | ND_GPENCIL_EDITMODE, "rna_GPencil_update");
 	
 	/* API Functions */
 	func = RNA_def_function(srna, "clear", "rna_GPencil_clear");
diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h
index ff252f0..4b6b5e9 100644
--- a/source/blender/windowmanager/WM_types.h
+++ b/source/blender/windowmanager/WM_types.h
@@ -324,6 +324,9 @@ typedef struct wmNotifier {
 #define ND_NLA_ACTCHANGE	(74<<16)
 #define ND_FCURVES_ORDER	(75<<16)
 
+	/* NC_GPENCIL */
+#define ND_GPENCIL_EDITMODE	(85<<16)
+
 	/* NC_GEOM Geometry */
 	/* Mesh, Curve, MetaBall, Armature, .. */
 #define ND_SELECT			(90<<16)




More information about the Bf-blender-cvs mailing list