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:
Diffstat (limited to 'source/blender/makesrna/intern/rna_gpencil_modifier.c')
-rw-r--r--source/blender/makesrna/intern/rna_gpencil_modifier.c232
1 files changed, 78 insertions, 154 deletions
diff --git a/source/blender/makesrna/intern/rna_gpencil_modifier.c b/source/blender/makesrna/intern/rna_gpencil_modifier.c
index 0caa93940c8..00188ac0887 100644
--- a/source/blender/makesrna/intern/rna_gpencil_modifier.c
+++ b/source/blender/makesrna/intern/rna_gpencil_modifier.c
@@ -129,11 +129,6 @@ const EnumPropertyItem rna_enum_object_greasepencil_modifier_type_items[] = {
"Opacity",
"Opacity of the strokes"},
{eGpencilModifierType_Tint, "GP_TINT", ICON_MOD_TINT, "Tint", "Tint strokes with new color"},
- {eGpencilModifierType_Vertexcolor,
- "GP_VERTEXCOLOR",
- ICON_MOD_NORMALEDIT,
- "Vertex Color",
- "Apply color changes to Vertex Color"},
{0, NULL, 0, NULL, NULL},
};
@@ -170,6 +165,11 @@ static const EnumPropertyItem gpencil_subdivision_type_items[] = {
{GP_SUBDIV_SIMPLE, "SIMPLE", 0, "Simple", ""},
{0, NULL, 0, NULL, NULL},
};
+static const EnumPropertyItem gpencil_tint_type_items[] = {
+ {GP_TINT_UNIFORM, "UNIFORM", 0, "Uniform", ""},
+ {GP_TINT_GRADIENT, "GRADIENT", 0, "Gradient", ""},
+ {0, NULL, 0, NULL, NULL},
+};
#endif
#ifdef RNA_RUNTIME
@@ -226,8 +226,6 @@ static StructRNA *rna_GpencilModifier_refine(struct PointerRNA *ptr)
return &RNA_ArmatureGpencilModifier;
case eGpencilModifierType_Multiply:
return &RNA_MultiplyGpencilModifier;
- case eGpencilModifierType_Vertexcolor:
- return &RNA_VertexcolorGpencilModifier;
/* Default */
case eGpencilModifierType_None:
case NUM_GREASEPENCIL_MODIFIER_TYPES:
@@ -342,11 +340,11 @@ static void rna_HookGpencilModifier_object_set(PointerRNA *ptr,
BKE_object_modifier_gpencil_hook_reset(ob, hmd);
}
-static void rna_VertexcolorGpencilModifier_object_set(PointerRNA *ptr,
- PointerRNA value,
- struct ReportList *UNUSED(reports))
+static void rna_TintGpencilModifier_object_set(PointerRNA *ptr,
+ PointerRNA value,
+ struct ReportList *UNUSED(reports))
{
- VertexcolorGpencilModifierData *hmd = ptr->data;
+ TintGpencilModifierData *hmd = ptr->data;
Object *ob = (Object *)value.data;
hmd->object = ob;
@@ -480,12 +478,6 @@ static void rna_def_modifier_gpencilnoise(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Seed", "Random seed");
RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
- prop = RNA_def_property(srna, "use_edit_position", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_NOISE_MOD_LOCATION);
- RNA_def_property_ui_text(
- prop, "Affect Position", "The modifier affects the position of the point");
- RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
-
prop = RNA_def_property(srna, "noise_scale", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "noise_scale");
RNA_def_property_range(prop, 0.0, 1.0);
@@ -1018,15 +1010,25 @@ static void rna_def_modifier_gpenciltint(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
+ /* modes */
+ static EnumPropertyItem tint_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, "TintGpencilModifier", "GpencilModifier");
- RNA_def_struct_ui_text(srna, "Tint Modifier", "Tint Stroke Color modifier");
+ RNA_def_struct_ui_text(srna, "Tint Modifier", "Tint modifier");
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, "object", PROP_POINTER, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Object", "Parent object to define the center of the effect");
+ RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK);
+ RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
+ RNA_def_property_pointer_funcs(prop, NULL, "rna_TintGpencilModifier_object_set", NULL, NULL);
+ RNA_def_property_update(prop, 0, "rna_GpencilModifier_dependency_update");
prop = RNA_def_property(srna, "layer", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "layername");
@@ -1038,17 +1040,10 @@ static void rna_def_modifier_gpenciltint(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Material", "Material name");
RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
- prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
- RNA_def_property_range(prop, 0.0, 1.0);
- RNA_def_property_float_sdna(prop, NULL, "rgb");
- RNA_def_property_array(prop, 3);
- RNA_def_property_ui_text(prop, "Color", "Color used for tinting");
- RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
-
- prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "factor");
- RNA_def_property_ui_range(prop, 0, 2.0, 0.1, 2);
- RNA_def_property_ui_text(prop, "Factor", "Factor for mixing color");
+ prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "vgname");
+ RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name for modulating the deform");
+ RNA_def_property_string_funcs(prop, NULL, NULL, "rna_HookGpencilModifier_vgname_set");
RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
prop = RNA_def_property(srna, "pass_index", PROP_INT, PROP_NONE);
@@ -1072,6 +1067,11 @@ static void rna_def_modifier_gpenciltint(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Inverse Pass", "Inverse filter");
RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
+ prop = RNA_def_property(srna, "invert_vertex", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_TINT_INVERT_VGROUP);
+ RNA_def_property_ui_text(prop, "Inverse Vertex Group", "Inverse filter");
+ RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
+
prop = RNA_def_property(srna, "layer_pass", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "layer_pass");
RNA_def_property_range(prop, 0, 100);
@@ -1083,10 +1083,54 @@ static void rna_def_modifier_gpenciltint(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Inverse Pass", "Inverse filter");
RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
+ prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "factor");
+ RNA_def_property_range(prop, 0, 2.0);
+ RNA_def_property_ui_range(prop, 0, 2.0, 0.1, 2);
+ RNA_def_property_ui_text(prop, "Strength", "Factor for tinting");
+ RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
+
+ prop = RNA_def_property(srna, "radius", PROP_FLOAT, PROP_DISTANCE);
+ RNA_def_property_float_sdna(prop, NULL, "radius");
+ RNA_def_property_range(prop, 1e-6f, FLT_MAX);
+ RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 1, 3);
+ RNA_def_property_ui_text(prop, "Radius", "Defines the maximum distance of the effect");
+ RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
+
+ /* Mode type. */
+ prop = RNA_def_property(srna, "vertex_mode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
+ RNA_def_property_enum_items(prop, tint_mode_types_items);
+ RNA_def_property_ui_text(prop, "Mode", "Defines how vertex color affect to the strokes");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+ RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
+
+ /* Type of Tint. */
+ prop = RNA_def_property(srna, "tint_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "type");
+ RNA_def_property_enum_items(prop, gpencil_tint_type_items);
+ RNA_def_property_ui_text(prop, "Tint Type", "Select type of tinting algorithm");
+ RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
+
+ /* Simple Color. */
+ prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
+ RNA_def_property_range(prop, 0.0, 1.0);
+ RNA_def_property_float_sdna(prop, NULL, "rgb");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Color", "Color used for tinting");
+ RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
+
+ /* Color band. */
+ prop = RNA_def_property(srna, "colors", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "colorband");
+ RNA_def_property_struct_type(prop, "ColorRamp");
+ RNA_def_property_ui_text(prop, "Colors", "Color ramp used to define tinting colors");
+ RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
+
prop = RNA_def_property(srna, "use_custom_curve", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_TINT_CUSTOM_CURVE);
RNA_def_property_ui_text(
- prop, "Custom Curve", "Use a custom curve to define tint effect along the strokes");
+ prop, "Custom Curve", "Use a custom curve to define vertex color effect along the strokes");
RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
prop = RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
@@ -2078,125 +2122,6 @@ static void rna_def_modifier_gpencilmultiply(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
}
-static void rna_def_modifier_gpencilvertexcolor(BlenderRNA *brna)
-{
- StructRNA *srna;
- PropertyRNA *prop;
-
- /* modes */
- static EnumPropertyItem vertexcol_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, "VertexcolorGpencilModifier", "GpencilModifier");
- RNA_def_struct_ui_text(srna, "Vertexcolor Modifier", "Vertex color modifier");
- RNA_def_struct_sdna(srna, "VertexcolorGpencilModifierData");
- RNA_def_struct_ui_icon(srna, ICON_MOD_NORMALEDIT);
-
- prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
- RNA_def_property_ui_text(prop, "Object", "Parent object to define the center of the effect");
- RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK);
- RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
- RNA_def_property_pointer_funcs(
- prop, NULL, "rna_VertexcolorGpencilModifier_object_set", NULL, NULL);
- RNA_def_property_update(prop, 0, "rna_GpencilModifier_dependency_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");
- RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
-
- prop = RNA_def_property(srna, "material", PROP_STRING, PROP_NONE);
- RNA_def_property_string_sdna(prop, NULL, "materialname");
- RNA_def_property_ui_text(prop, "Material", "Material name");
- RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
-
- prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
- RNA_def_property_string_sdna(prop, NULL, "vgname");
- RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name for modulating the deform");
- RNA_def_property_string_funcs(prop, NULL, NULL, "rna_HookGpencilModifier_vgname_set");
- RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
-
- prop = RNA_def_property(srna, "pass_index", PROP_INT, PROP_NONE);
- RNA_def_property_int_sdna(prop, NULL, "pass_index");
- RNA_def_property_range(prop, 0, 100);
- RNA_def_property_ui_text(prop, "Pass", "Pass index");
- RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
-
- prop = RNA_def_property(srna, "invert_layers", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_VERTEXCOL_INVERT_LAYER);
- RNA_def_property_ui_text(prop, "Inverse Layers", "Inverse filter");
- RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
-
- prop = RNA_def_property(srna, "invert_materials", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_VERTEXCOL_INVERT_MATERIAL);
- RNA_def_property_ui_text(prop, "Inverse Materials", "Inverse filter");
- RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
-
- prop = RNA_def_property(srna, "invert_material_pass", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_VERTEXCOL_INVERT_PASS);
- RNA_def_property_ui_text(prop, "Inverse Pass", "Inverse filter");
- RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
-
- prop = RNA_def_property(srna, "invert_vertex", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_VERTEXCOL_INVERT_VGROUP);
- RNA_def_property_ui_text(prop, "Inverse Vertex Group", "Inverse filter");
- RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
-
- prop = RNA_def_property(srna, "layer_pass", PROP_INT, PROP_NONE);
- RNA_def_property_int_sdna(prop, NULL, "layer_pass");
- RNA_def_property_range(prop, 0, 100);
- RNA_def_property_ui_text(prop, "Pass", "Layer pass index");
- RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
-
- prop = RNA_def_property(srna, "invert_layer_pass", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_VERTEXCOL_INVERT_LAYERPASS);
- RNA_def_property_ui_text(prop, "Inverse Pass", "Inverse filter");
- RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
-
- prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_FACTOR);
- RNA_def_property_float_sdna(prop, NULL, "factor");
- RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_ui_text(prop, "Factor", "Factor of tinting");
- RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
-
- prop = RNA_def_property(srna, "radius", PROP_FLOAT, PROP_DISTANCE);
- RNA_def_property_float_sdna(prop, NULL, "radius");
- RNA_def_property_range(prop, 1e-6f, FLT_MAX);
- RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 1, 3);
- RNA_def_property_ui_text(prop, "Radius", "Defines the maximum distance of the effect");
- RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
-
- /* Mode type. */
- prop = RNA_def_property(srna, "vertex_mode", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
- RNA_def_property_enum_items(prop, vertexcol_mode_types_items);
- RNA_def_property_ui_text(prop, "Mode", "Defines how vertex color affect to the strokes");
- RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
- RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
-
- /* Color band */
- prop = RNA_def_property(srna, "colors", PROP_POINTER, PROP_NONE);
- RNA_def_property_pointer_sdna(prop, NULL, "colorband");
- RNA_def_property_struct_type(prop, "ColorRamp");
- RNA_def_property_ui_text(prop, "Colors", "Color ramp used to define tinting colors");
- RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
-
- prop = RNA_def_property(srna, "use_custom_curve", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_VERTEXCOL_CUSTOM_CURVE);
- RNA_def_property_ui_text(
- prop, "Custom Curve", "Use a custom curve to define vertex color effect along the strokes");
- RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
-
- prop = RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
- RNA_def_property_pointer_sdna(prop, NULL, "curve_intensity");
- RNA_def_property_ui_text(prop, "Curve", "Custom curve to apply effect");
- RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
-}
-
void RNA_def_greasepencil_modifier(BlenderRNA *brna)
{
StructRNA *srna;
@@ -2270,7 +2195,6 @@ void RNA_def_greasepencil_modifier(BlenderRNA *brna)
rna_def_modifier_gpencilhook(brna);
rna_def_modifier_gpencilarmature(brna);
rna_def_modifier_gpencilmultiply(brna);
- rna_def_modifier_gpencilvertexcolor(brna);
}
#endif