diff options
-rw-r--r-- | release/scripts/startup/bl_ui/space_userpref.py | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/gpencil.c | 3 | ||||
-rw-r--r-- | source/blender/editors/interface/resources.c | 10 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_userdef_types.h | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 8 |
5 files changed, 24 insertions, 4 deletions
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index 1e9c9e7ff7e..697c070ffad 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -268,12 +268,16 @@ class USERPREF_PT_edit(Panel): col = row.column() col.label(text="Grease Pencil:") + col.prop(edit, "grease_pencil_eraser_radius", text="Eraser Radius") + col.separator() col.prop(edit, "grease_pencil_manhattan_distance", text="Manhattan Distance") col.prop(edit, "grease_pencil_euclidean_distance", text="Euclidean Distance") - col.prop(edit, "grease_pencil_eraser_radius", text="Eraser Radius") + col.separator() col.prop(edit, "use_grease_pencil_smooth_stroke", text="Smooth Stroke") col.prop(edit, "use_grease_pencil_simplify_stroke", text="Simplify Stroke") col.separator() + col.prop(edit, "grease_pencil_default_color", text="Default Color") + col.separator() col.separator() col.separator() col.label(text="Playback:") diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index 4d17bd286b4..42e146301a2 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -38,6 +38,7 @@ #include "BLI_blenlib.h" #include "BLI_utildefines.h" +#include "BLI_math_vector.h" #include "BLF_translation.h" @@ -182,7 +183,7 @@ bGPDlayer *gpencil_layer_addnew(bGPdata *gpd, const char *name, int setactive) BLI_addtail(&gpd->layers, gpl); /* set basic settings */ - gpl->color[3] = 0.9f; + copy_v4_v4(gpl->color, U.gpencil_new_layer_col); gpl->thickness = 3; /* auto-name */ diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index ace35f0276e..55b353b1031 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -1406,6 +1406,7 @@ void init_userdef_do_versions(void) } if (U.pad_rot_angle == 0) U.pad_rot_angle = 15; + /* graph editor - unselected F-Curve visibility */ if (U.fcu_inactive_alpha == 0) { U.fcu_inactive_alpha = 0.25f; @@ -2224,7 +2225,14 @@ void init_userdef_do_versions(void) rgba_char_args_test_set(btheme->tima.uv_shadow, 112, 112, 112, 255); } } - + + if (U.versionfile < 270) { + /* grease pencil - new layer color */ + if (U.gpencil_new_layer_col[3] < 0.1f) { + /* defaults to black, but must at least be visible! */ + U.gpencil_new_layer_col[3] = 0.9f; + } + } if (U.pixelsize == 0.0f) U.pixelsize = 1.0f; diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 1621f7c6cb6..ae01536eebe 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -474,6 +474,7 @@ typedef struct UserDef { struct ColorBand coba_weight; /* from texture.h */ float sculpt_paint_overlay_col[3]; + float gpencil_new_layer_col[3]; /* default color for newly created Grease Pencil layers */ short tweak_threshold; short pad3; diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 5221e8de7ce..0e45d6d4aea 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -3266,7 +3266,13 @@ static void rna_def_userdef_edit(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "gp_eraser"); RNA_def_property_range(prop, 0, 100); RNA_def_property_ui_text(prop, "Grease Pencil Eraser Radius", "Radius of eraser 'brush'"); - + + + prop = RNA_def_property(srna, "grease_pencil_default_color", PROP_FLOAT, PROP_COLOR); + RNA_def_property_float_sdna(prop, NULL, "gpencil_new_layer_col"); + RNA_def_property_array(prop, 4); + RNA_def_property_ui_text(prop, "Grease Pencil Default Color", "Color of new Grease Pencil layers"); + /* sculpt and paint */ prop = RNA_def_property(srna, "sculpt_paint_overlay_color", PROP_FLOAT, PROP_COLOR_GAMMA); |