[Bf-blender-cvs] [5f6b958] master: Fix: "show_points" setting for Grease Pencil drawing didn't work

Joshua Leung noreply at git.blender.org
Mon Apr 20 07:29:29 CEST 2015


Commit: 5f6b958e969d3300502933ea6276abf46e75c675
Author: Joshua Leung
Date:   Mon Apr 20 01:02:49 2015 +1200
Branches: master
https://developer.blender.org/rB5f6b958e969d3300502933ea6276abf46e75c675

Fix: "show_points" setting for Grease Pencil drawing didn't work

As reported by zeffi, the "show_points" option was not working in master.
It probably broke recently, after some changes meant that the point sizes
weren't geting set prior to drawing these points anymore. Since this was
originally added as a debugging tool (though it is now somewhat redundant
due to the stroke editing functionality, which uses/exposes the same points),
this option wasn't really that important. I have decided to add back a toggle
for this to the UI though, since it can be used for some interesting effects...

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

M	release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M	source/blender/editors/gpencil/drawgpencil.c
M	source/blender/makesrna/intern/rna_gpencil.c

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

diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
index 5088623..e86fc79 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -414,9 +414,7 @@ class GreasePencilDataPanel:
 
         col = split.column(align=True)
         col.prop(gpl, "show_x_ray")
-
-        # if debug:
-        #     layout.prop(gpl, "show_points")
+        col.prop(gpl, "show_points", text="Points")
 
         layout.separator()
 
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index 0892692..0d35d3c 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -443,6 +443,8 @@ static void gp_draw_stroke_3d(bGPDspoint *points, int totpoints, short thickness
 	/* draw debug points of curve on top? */
 	/* XXX: for now, we represent "selected" strokes in the same way as debug, which isn't used anymore */
 	if (debug) {
+		glPointSize((float)(thickness + 2));
+		
 		glBegin(GL_POINTS);
 		for (i = 0, pt = points; i < totpoints && pt; i++, pt++)
 			glVertex3fv(&pt->x);
@@ -617,6 +619,8 @@ static void gp_draw_stroke_2d(bGPDspoint *points, int totpoints, short thickness
 		bGPDspoint *pt;
 		int i;
 		
+		glPointSize((float)(thickness_s + 2));
+		
 		glBegin(GL_POINTS);
 		for (i = 0, pt = points; i < totpoints && pt; i++, pt++) {
 			float co[2];
@@ -876,7 +880,7 @@ static void gp_draw_strokes_edit(bGPDframe *gpf, int offsx, int offsy, int winx,
 
 /* draw onion-skinning for a layer */
 static void gp_draw_onionskins(bGPDlayer *gpl, bGPDframe *gpf, int offsx, int offsy, int winx, int winy,
-                               int UNUSED(cfra), int dflag, short debug, short lthick)
+                               int UNUSED(cfra), int dflag, bool debug, short lthick)
 {
 	const float alpha = gpl->color[3];
 	float color[4];
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index 2f4e788..7d7df0f 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -775,8 +775,8 @@ static void rna_def_gpencil_layer(BlenderRNA *brna)
 	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_runtime(prop, "rna_GPencil_update");
-
+	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
+	
 	/* X-Ray */
 	prop = RNA_def_property(srna, "show_x_ray", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GP_LAYER_NO_XRAY);




More information about the Bf-blender-cvs mailing list