[Bf-blender-cvs] [f69106f6832] greasepencil-object: GPencil: New option to define if vertex color affect to Stroke and/or Fill
Antonio Vazquez
noreply at git.blender.org
Mon Nov 4 10:31:07 CET 2019
Commit: f69106f6832e243233991a13807404e4021ea627
Author: Antonio Vazquez
Date: Mon Nov 4 10:30:58 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rBf69106f6832e243233991a13807404e4021ea627
GPencil: New option to define if vertex color affect to Stroke and/or Fill
This commit only adds the parameters, but is not using them.
===================================================================
M release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M release/scripts/startup/bl_ui/space_view3d_toolbar.py
M source/blender/makesdna/DNA_scene_types.h
M source/blender/makesrna/intern/rna_sculpt_paint.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 6baf98a8c1c..36eb66f47ac 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -929,10 +929,9 @@ class GreasePencilVertexcolorPanel:
if ob:
row = layout.row(align=True)
+ row.prop(gpencil_paint, "use_vertex_mode", text="Mode")
- # row.prop(brush, "color", text="")
- # row = layout.row(align=True)
- # row.template_color_picker(brush, "color", value_slider=True)
+ row = layout.row(align=True)
if brush.gpencil_tool == 'DRAW':
row = layout.row(align=True)
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 4ab08f97fc1..26ae80ec221 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -2078,6 +2078,10 @@ class VIEW3D_PT_tools_grease_pencil_brush_mixcolor(View3DPanel, Panel):
settings = ts.gpencil_paint
brush = settings.brush
gp_settings = brush.gpencil_settings
+
+ row = layout.row(align=True)
+ row.prop(settings, "use_vertex_mode", text="Mode")
+
row = layout.row(align=True)
if context.area.type == 'PROPERTIES':
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index 9f6933a1ac7..bb57faa75d7 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -985,7 +985,8 @@ typedef struct UvSculpt {
typedef struct GpPaint {
Paint paint;
int flag;
- char _pad_[4];
+ /** Define if affect stroke, fill or both. */
+ int mode;
} GpPaint;
/* GpPaint.flag */
@@ -994,6 +995,16 @@ enum {
GPPAINT_FLAG_USE_VERTEXCOLOR = (1 << 0),
};
+/* GpPaint.mode */
+typedef enum eGpPaint_Mode {
+ /* Affect to Stroke only. */
+ GPPAINT_MODE_STROKE = 0,
+ /* Affect to Fill only. */
+ GPPAINT_MODE_FILL = 1,
+ /* Affect to both. */
+ GPPAINT_MODE_BOTH = 2,
+} eGpPaint_Mode;
+
/* ------------------------------------------- */
/* Vertex Paint */
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c
index 937bb669501..fd6452ee144 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -884,16 +884,31 @@ static void rna_def_gp_paint(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
+ /* modes */
+ static EnumPropertyItem gppaint_mode_types_items[] = {
+ {GPPAINT_MODE_STROKE, "STROKE", 0, "Stroke", "Vertex Color affects to Stroke only"},
+ {GPPAINT_MODE_FILL, "FILL", 0, "Fill", "Vertex Color affects to Fill only"},
+ {GPPAINT_MODE_BOTH, "BOTH", 0, "Both", "Vertex Color affects to Stroke and Fill"},
+ {0, NULL, 0, NULL, NULL},
+ };
+
srna = RNA_def_struct(brna, "GpPaint", "Paint");
RNA_def_struct_path_func(srna, "rna_GpPaint_path");
RNA_def_struct_ui_text(srna, "Grease Pencil Paint", "");
- /* Use vertex color */
+ /* Use vertex color (main swith). */
prop = RNA_def_property(srna, "use_vertex_color", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GPPAINT_FLAG_USE_VERTEXCOLOR);
RNA_def_property_ui_text(prop, "Use Vertex Color", "Use Vertex Color to manage colors");
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+
+ /* Mode type. */
+ prop = RNA_def_property(srna, "use_vertex_mode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
+ RNA_def_property_enum_items(prop, gppaint_mode_types_items);
+ RNA_def_property_ui_text(prop, "Mode Type", "Defines how vertex color affect to the strokes");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
}
/* use for weight paint too */
More information about the Bf-blender-cvs
mailing list