Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharlie Jolly <mistajolly@gmail.com>2018-08-09 14:42:02 +0300
committerAntonioya <blendergit@gmail.com>2018-08-09 14:43:21 +0300
commit2e10c658f42a842404f16a1b03ff4844e41d538c (patch)
treeefde511079a2e4537477c1da3f5b202982bc4780 /source/blender/makesrna
parentf284821bf714cca98d86ede1e2a9713094d1d686 (diff)
GP: Add option to select color affected in modifiers
Now it's possible to define if the Tint, Hue and OPacity modifier affect the stroke color, fill color or both.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_gpencil_modifier.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_gpencil_modifier.c b/source/blender/makesrna/intern/rna_gpencil_modifier.c
index 4f29ed58ba7..c137eec7568 100644
--- a/source/blender/makesrna/intern/rna_gpencil_modifier.c
+++ b/source/blender/makesrna/intern/rna_gpencil_modifier.c
@@ -82,6 +82,13 @@ const EnumPropertyItem rna_enum_object_greasepencil_modifier_type_items[] = {
};
#ifndef RNA_RUNTIME
+static const EnumPropertyItem modifier_modify_color_items[] = {
+ { GP_MODIFY_COLOR_BOTH, "BOTH", 0, "Both", "Modify fill and stroke colors" },
+ { GP_MODIFY_COLOR_STROKE, "STROKE", 0, "Stroke", "Modify stroke color only" },
+ { GP_MODIFY_COLOR_FILL, "FILL", 0, "Fill", "Modify fill color only" },
+ { 0, NULL, 0, NULL, NULL }
+};
+
static const EnumPropertyItem modifier_gphook_falloff_items[] = {
{ eGPHook_Falloff_None, "NONE", 0, "No Falloff", "" },
{ eGPHook_Falloff_Curve, "CURVE", 0, "Curve", "" },
@@ -663,6 +670,11 @@ static void rna_def_modifier_gpenciltint(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "TintGpencilModifierData");
RNA_def_struct_ui_icon(srna, ICON_COLOR);
+ prop = RNA_def_property(srna, "modify_color", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, modifier_modify_color_items); /* share the enum */
+ RNA_def_property_ui_text(prop, "Mode", "Set what colors of the stroke are affected");
+ RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
+
prop = RNA_def_property(srna, "layer", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "layername");
RNA_def_property_ui_text(prop, "Layer", "Layer name");
@@ -713,6 +725,11 @@ static void rna_def_modifier_gpencilcolor(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "ColorGpencilModifierData");
RNA_def_struct_ui_icon(srna, ICON_GROUP_VCOL);
+ prop = RNA_def_property(srna, "modify_color", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, modifier_modify_color_items); /* share the enum */
+ RNA_def_property_ui_text(prop, "Mode", "Set what colors of the stroke are affected");
+ RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
+
prop = RNA_def_property(srna, "layer", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "layername");
RNA_def_property_ui_text(prop, "Layer", "Layer name");
@@ -771,6 +788,11 @@ static void rna_def_modifier_gpencilopacity(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "OpacityGpencilModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_MASK);
+ prop = RNA_def_property(srna, "modify_color", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, modifier_modify_color_items); /* share the enum */
+ RNA_def_property_ui_text(prop, "Mode", "Set what colors of the stroke are affected");
+ RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
+
prop = RNA_def_property(srna, "layer", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "layername");
RNA_def_property_ui_text(prop, "Layer", "Layer name");