[Bf-blender-cvs] [11910fdb505] greasepencil-object: New UI parameter to define UV rotation randomness

Antonio Vazquez noreply at git.blender.org
Wed Feb 21 11:09:35 CET 2018


Commit: 11910fdb505b97732b0aa96c56a2eef617f1b986
Author: Antonio Vazquez
Date:   Wed Feb 21 11:04:14 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB11910fdb505b97732b0aa96c56a2eef617f1b986

New UI parameter to define UV rotation randomness

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

M	release/scripts/startup/bl_ui/space_view3d_toolbar.py
M	source/blender/makesdna/DNA_gpencil_types.h
M	source/blender/makesrna/intern/rna_scene.c

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

diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 61724f27f2f..5d818297a3a 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -2180,6 +2180,9 @@ class VIEW3D_PT_tools_grease_pencil_brush_option(Panel):
                     col.prop(brush, "lazy_radius", text="Distance")
                     col.prop(brush, "lazy_factor", slider=True)
 
+            row = layout.row(align=True)
+            row.prop(brush, "uv_random", slider=True)
+
 
 # Grease Pencil drawingcurves
 class VIEW3D_PT_tools_grease_pencil_brushcurves(Panel):
diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h
index aea11c612ff..877c45b368f 100644
--- a/source/blender/makesdna/DNA_gpencil_types.h
+++ b/source/blender/makesdna/DNA_gpencil_types.h
@@ -135,7 +135,8 @@ typedef struct bGPDbrush {
 
 	int   lazy_radius;        /* distance to last point to create new point */
 	float lazy_factor;        /* factor of smooth */
-	char  pad[4];
+	
+	float uv_random;          /* random factor for UV rotation */
 } bGPDbrush;
 
 /* bGPDbrush->flag */
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 221bb719429..19c5ada3a01 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -2380,6 +2380,12 @@ static void rna_def_gpencil_brush(BlenderRNA *brna)
 	RNA_def_property_ui_text(prop, "Factor", "Higher values give a smoother stroke");
 	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
 
+	prop = RNA_def_property(srna, "uv_random", PROP_FLOAT, PROP_FACTOR);
+	RNA_def_property_float_sdna(prop, NULL, "uv_random");
+	RNA_def_property_range(prop, 0.0, 1.0);
+	RNA_def_property_ui_text(prop, "UV Random", "Random factor for autogenerated UV rotation");
+	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
+
 	/* Flags */
 	prop = RNA_def_property(srna, "use_pressure", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSH_USE_PRESSURE);



More information about the Bf-blender-cvs mailing list