[Bf-blender-cvs] [2bb956f] master: GPencil: Smooth and Subdivision variable/setting naming

Joshua Leung noreply at git.blender.org
Sun Mar 27 16:22:56 CEST 2016


Commit: 2bb956f6c90cf9f1055e46b1334e50d76f5f91dd
Author: Joshua Leung
Date:   Mon Mar 28 03:20:15 2016 +1300
Branches: master
https://developer.blender.org/rB2bb956f6c90cf9f1055e46b1334e50d76f5f91dd

GPencil: Smooth and Subdivision variable/setting naming

On second thought, these might be better names for these... I'm still not 100%
happy with these, but they will do for now.

(Best results currently seem to be with smooth 0.7, and subdivision steps 1 or 2)

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

M	release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M	source/blender/editors/gpencil/gpencil_paint.c
M	source/blender/makesdna/DNA_gpencil_types.h
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 5d09dc8..013f4e6 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -626,9 +626,8 @@ class GreasePencilDataPanel:
         layout.separator()
         col = layout.column(align=True)
         col.label(text="New Stroke Quality:")
-        split = col.split()
-        split.prop(gpl, "smooth_drawfac")
-        split.prop(gpl, "subdivision")
+        col.prop(gpl, "pen_smooth_factor")
+        col.prop(gpl, "pen_subdivision_steps")
 
 
 class GreasePencilToolsPanel:
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 8bbc10b..ea80e9a 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -750,9 +750,9 @@ static void gp_stroke_newfrombuffer(tGPsdata *p)
 		}
 		
 		/* smooth stroke - only if there's something to do */
-		if (gpl->smooth_drawfac > 0.0f) {
+		if (gpl->draw_smoothfac > 0.0f) {
 			for (i = 0; i < gps->totpoints; i++) {
-				gp_smooth_stroke(gps, i, gpl->smooth_drawfac, true);
+				gp_smooth_stroke(gps, i, gpl->draw_smoothfac, true);
 			}
 		}
 		
diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h
index 0ef2132..e5e193d 100644
--- a/source/blender/makesdna/DNA_gpencil_types.h
+++ b/source/blender/makesdna/DNA_gpencil_types.h
@@ -131,8 +131,8 @@ typedef struct bGPDlayer {
 	char info[128];			/* optional reference info about this layer (i.e. "director's comments, 12/3")
 							 * this is used for the name of the layer  too and kept unique. */
 	
-	float smooth_drawfac;   /* factor used for dynamic smooth of strokes */
-	short sublevel;         /* subdivision level */
+	float draw_smoothfac;   /* amount of smoothing to apply to newly created strokes */
+	short sublevel;         /* number of times to subdivide new strokes */
 	short pad[5];           /* padding for compiler error */
 } bGPDlayer;
 
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index 7d5e7c1..3c16f08 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -796,19 +796,19 @@ static void rna_def_gpencil_layer(BlenderRNA *brna)
 	RNA_def_property_range(prop, 0.0f, 1.0f);
 	RNA_def_property_ui_text(prop, "After Color", "Base color for ghosts after the active frame");
 	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
-
-	/* dynamic smooth factor */
-	prop = RNA_def_property(srna, "smooth_drawfac", PROP_FLOAT, PROP_NONE);
-	RNA_def_property_float_sdna(prop, NULL, "smooth_drawfac");
+	
+	/* Smoothing factor for new strokes */
+	prop = RNA_def_property(srna, "pen_smooth_factor", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "draw_smoothfac");
 	RNA_def_property_range(prop, 0.0, 2.0f);
 	RNA_def_property_ui_text(prop, "Smooth", "Amount of smoothing to apply to newly created strokes, to reduce jitter/noise");
 	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
-
-	/* Subdivision level */
-	prop = RNA_def_property(srna, "subdivision", PROP_INT, PROP_NONE);
+	
+	/* Subdivision level for new strokes */
+	prop = RNA_def_property(srna, "pen_subdivision_steps", PROP_INT, PROP_NONE);
 	RNA_def_property_int_sdna(prop, NULL, "sublevel");
 	RNA_def_property_range(prop, 0, 3);
-	RNA_def_property_ui_text(prop, "Subdivide", "Number of times to subdivide newly created strokes, for less jagged strokes");
+	RNA_def_property_ui_text(prop, "Subdivision Steps", "Number of times to subdivide newly created strokes, for less jagged strokes");
 	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
 
 	/* Flags */




More information about the Bf-blender-cvs mailing list