[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [26332] trunk/blender/source/blender: Bugfix #20845: Grease Pencil settings lack view refresh

Joshua Leung aligorith at gmail.com
Wed Jan 27 12:56:15 CET 2010


Revision: 26332
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=26332
Author:   aligorith
Date:     2010-01-27 12:56:14 +0100 (Wed, 27 Jan 2010)

Log Message:
-----------
Bugfix #20845: Grease Pencil settings lack view refresh

Added updates to Grease Pencil RNA data, and added appropriate listeners to 3D-View and Nodes Editors that were previously missing too.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_node/space_node.c
    trunk/blender/source/blender/editors/space_view3d/space_view3d.c
    trunk/blender/source/blender/makesrna/intern/rna_gpencil.c

Modified: trunk/blender/source/blender/editors/space_node/space_node.c
===================================================================
--- trunk/blender/source/blender/editors/space_node/space_node.c	2010-01-27 11:43:34 UTC (rev 26331)
+++ trunk/blender/source/blender/editors/space_node/space_node.c	2010-01-27 11:56:14 UTC (rev 26332)
@@ -312,6 +312,10 @@
 			if(wmn->data==ND_SPACE_NODE)
 				ED_region_tag_redraw(ar);
 			break;
+		case NC_SCREEN:
+			if(wmn->data == ND_GPENCIL)	
+				ED_region_tag_redraw(ar);
+			break;
 		case NC_SCENE:
 		case NC_MATERIAL:
 		case NC_TEXTURE:

Modified: trunk/blender/source/blender/editors/space_view3d/space_view3d.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/space_view3d.c	2010-01-27 11:43:34 UTC (rev 26331)
+++ trunk/blender/source/blender/editors/space_view3d/space_view3d.c	2010-01-27 11:56:14 UTC (rev 26332)
@@ -598,6 +598,10 @@
 			if(wmn->action == NA_RENAME)
 				ED_region_tag_redraw(ar);
 			break;
+		case NC_SCREEN:
+			if(wmn->data == ND_GPENCIL)	
+				ED_region_tag_redraw(ar);
+			break;
 	}
 }
 

Modified: trunk/blender/source/blender/makesrna/intern/rna_gpencil.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_gpencil.c	2010-01-27 11:43:34 UTC (rev 26331)
+++ trunk/blender/source/blender/makesrna/intern/rna_gpencil.c	2010-01-27 11:56:14 UTC (rev 26332)
@@ -35,6 +35,8 @@
 
 #include "MEM_guardedalloc.h"
 
+#include "WM_types.h"
+
 #ifdef RNA_RUNTIME
 
 static int rna_GPencilLayer_active_frame_editable(PointerRNA *ptr)
@@ -81,11 +83,13 @@
 	RNA_def_property_float_sdna(prop, NULL, "x");
 	RNA_def_property_array(prop, 3);
 	RNA_def_property_ui_text(prop, "Coordinates", "");
+	RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
 	
 	prop= RNA_def_property(srna, "pressure", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "pressure");
 	RNA_def_property_range(prop, 0.0f, 1.0f);
 	RNA_def_property_ui_text(prop, "Pressure", "Pressure of tablet at point when drawing it.");
+	RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
 }
 
 static void rna_def_gpencil_stroke(BlenderRNA *brna)
@@ -168,55 +172,65 @@
 	prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
 	RNA_def_property_array(prop, 3);
 	RNA_def_property_ui_text(prop, "Color", "Color that all sketches in this layer are drawn with.");
+	RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
 	
 	prop= RNA_def_property(srna, "opacity", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "color[3]");
 	RNA_def_property_range(prop, 0.3, 1.0f);
 	RNA_def_property_ui_text(prop, "Opacity", "Visibility of strokes.");
+	RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
 	
 	/* Line Thickness */
 	prop= RNA_def_property(srna, "line_thickness", PROP_INT, PROP_NONE);
 	RNA_def_property_int_sdna(prop, NULL, "thickness");
 	RNA_def_property_range(prop, 1, 10);
 	RNA_def_property_ui_text(prop, "Thickness", "Thickness of strokes (in pixels).");
+	RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
 	
 	/* Onion-Skinning */
 	prop= RNA_def_property(srna, "use_onion_skinning", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_ONIONSKIN);
 	RNA_def_property_ui_text(prop, "Use Onion Skinning", "Ghost frames on either side of frame.");
+	RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
 	
 	prop= RNA_def_property(srna, "max_ghost_range", PROP_INT, PROP_NONE);
 	RNA_def_property_int_sdna(prop, NULL, "gstep");
 	RNA_def_property_range(prop, 0, 120);
 	RNA_def_property_ui_text(prop, "Max Ghost Range", "Maximum number of frames on either side of the active frame to show. (0 = just show the 'first' available sketch on either side)");
+	RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
 	
 	/* Flags */
 	prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_HIDE);
 	RNA_def_property_ui_text(prop, "Hide", "Layer doesn't get drawn.");
+	RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
 	
 	prop= RNA_def_property(srna, "locked", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_LOCKED);
 	RNA_def_property_ui_text(prop, "Locked", "Layer is protected from further editing and/or frame changes.");
+	RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
 	
 	prop= RNA_def_property(srna, "frame_lock", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_FRAMELOCK);
 	RNA_def_property_ui_text(prop, "Frame Locked", "Current frame displayed by layer cannot be changed.");
+	RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
 	
 	prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_ACTIVE);
 	RNA_def_property_boolean_funcs(prop, NULL, "rna_GPencilLayer_active_set");
 	RNA_def_property_ui_text(prop, "Active", "Layer is 'active' layer being edited.");
+	RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
 	
 	prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_SELECT);
 	RNA_def_property_ui_text(prop, "Selected", "Layer is selected for editing in the DopeSheet.");
+	RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
 	
 		// XXX keep this option?
 	prop= RNA_def_property(srna, "show_points", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_DRAWDEBUG);
 	RNA_def_property_ui_text(prop, "Show Points", "Draw the points which make up the strokes (for debugging purposes).");
-	
+	RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
 }
 
 static void rna_def_gpencil_data(BlenderRNA *brna)





More information about the Bf-blender-cvs mailing list