Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_gpencil_modifier.c
| Show All 17 Lines | |||||
| * \ingroup RNA | * \ingroup RNA | ||||
| */ | */ | ||||
| #include <float.h> | #include <float.h> | ||||
| #include <limits.h> | #include <limits.h> | ||||
| #include <stdlib.h> | #include <stdlib.h> | ||||
| #include "DNA_armature_types.h" | #include "DNA_armature_types.h" | ||||
| #include "DNA_brush_types.h" | |||||
| #include "DNA_cachefile_types.h" | #include "DNA_cachefile_types.h" | ||||
| #include "DNA_mesh_types.h" | #include "DNA_mesh_types.h" | ||||
| #include "DNA_gpencil_modifier_types.h" | #include "DNA_gpencil_modifier_types.h" | ||||
| #include "DNA_object_types.h" | #include "DNA_object_types.h" | ||||
| #include "DNA_object_force_types.h" | #include "DNA_object_force_types.h" | ||||
| #include "DNA_scene_types.h" | #include "DNA_scene_types.h" | ||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| ▲ Show 20 Lines • Show All 88 Lines • ▼ Show 20 Lines | const EnumPropertyItem rna_enum_object_greasepencil_modifier_type_items[] = { | ||||
| "Hue/Saturation", | "Hue/Saturation", | ||||
| "Apply changes to stroke colors"}, | "Apply changes to stroke colors"}, | ||||
| {eGpencilModifierType_Opacity, | {eGpencilModifierType_Opacity, | ||||
| "GP_OPACITY", | "GP_OPACITY", | ||||
| ICON_MOD_OPACITY, | ICON_MOD_OPACITY, | ||||
| "Opacity", | "Opacity", | ||||
| "Opacity of the strokes"}, | "Opacity of the strokes"}, | ||||
| {eGpencilModifierType_Tint, "GP_TINT", ICON_MOD_TINT, "Tint", "Tint strokes with new color"}, | {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}, | {0, NULL, 0, NULL, NULL}, | ||||
| }; | }; | ||||
| #ifndef RNA_RUNTIME | #ifndef RNA_RUNTIME | ||||
| static const EnumPropertyItem modifier_modify_color_items[] = { | static const EnumPropertyItem modifier_modify_color_items[] = { | ||||
| {GP_MODIFY_COLOR_BOTH, "BOTH", 0, "Both", "Modify fill and stroke colors"}, | {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_STROKE, "STROKE", 0, "Stroke", "Modify stroke color only"}, | ||||
| {GP_MODIFY_COLOR_FILL, "FILL", 0, "Fill", "Modify fill color only"}, | {GP_MODIFY_COLOR_FILL, "FILL", 0, "Fill", "Modify fill color only"}, | ||||
| {0, NULL, 0, NULL, NULL}, | {0, NULL, 0, NULL, NULL}, | ||||
| }; | }; | ||||
| static const EnumPropertyItem modifier_opacity_mode_items[] = { | |||||
| {GP_OPACITY_MODE_MATERIAL, | |||||
| "MATERIAL", | |||||
| 0, | |||||
| "Material", | |||||
| "Modify opacity using alpha channel of material"}, | |||||
| {GP_OPACITY_MODE_STRENGTH, "STRENGTH", 0, "Strength", "Modify opacity using point strength"}, | |||||
| {0, NULL, 0, NULL, NULL}, | |||||
| }; | |||||
| static const EnumPropertyItem modifier_gphook_falloff_items[] = { | static const EnumPropertyItem modifier_gphook_falloff_items[] = { | ||||
| {eGPHook_Falloff_None, "NONE", 0, "No Falloff", ""}, | {eGPHook_Falloff_None, "NONE", 0, "No Falloff", ""}, | ||||
| {eGPHook_Falloff_Curve, "CURVE", 0, "Curve", ""}, | {eGPHook_Falloff_Curve, "CURVE", 0, "Curve", ""}, | ||||
| {eGPHook_Falloff_Smooth, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", ""}, | {eGPHook_Falloff_Smooth, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", ""}, | ||||
| {eGPHook_Falloff_Sphere, "SPHERE", ICON_SPHERECURVE, "Sphere", ""}, | {eGPHook_Falloff_Sphere, "SPHERE", ICON_SPHERECURVE, "Sphere", ""}, | ||||
| {eGPHook_Falloff_Root, "ROOT", ICON_ROOTCURVE, "Root", ""}, | {eGPHook_Falloff_Root, "ROOT", ICON_ROOTCURVE, "Root", ""}, | ||||
| {eGPHook_Falloff_InvSquare, "INVERSE_SQUARE", ICON_ROOTCURVE, "Inverse Square", ""}, | {eGPHook_Falloff_InvSquare, "INVERSE_SQUARE", ICON_ROOTCURVE, "Inverse Square", ""}, | ||||
| {eGPHook_Falloff_Sharp, "SHARP", ICON_SHARPCURVE, "Sharp", ""}, | {eGPHook_Falloff_Sharp, "SHARP", ICON_SHARPCURVE, "Sharp", ""}, | ||||
| ▲ Show 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | switch ((GpencilModifierType)md->type) { | ||||
| case eGpencilModifierType_Hook: | case eGpencilModifierType_Hook: | ||||
| return &RNA_HookGpencilModifier; | return &RNA_HookGpencilModifier; | ||||
| case eGpencilModifierType_Offset: | case eGpencilModifierType_Offset: | ||||
| return &RNA_OffsetGpencilModifier; | return &RNA_OffsetGpencilModifier; | ||||
| case eGpencilModifierType_Armature: | case eGpencilModifierType_Armature: | ||||
| return &RNA_ArmatureGpencilModifier; | return &RNA_ArmatureGpencilModifier; | ||||
| case eGpencilModifierType_Multiply: | case eGpencilModifierType_Multiply: | ||||
| return &RNA_MultiplyGpencilModifier; | return &RNA_MultiplyGpencilModifier; | ||||
| case eGpencilModifierType_Vertexcolor: | |||||
| return &RNA_VertexcolorGpencilModifier; | |||||
| /* Default */ | /* Default */ | ||||
| case eGpencilModifierType_None: | case eGpencilModifierType_None: | ||||
| case NUM_GREASEPENCIL_MODIFIER_TYPES: | case NUM_GREASEPENCIL_MODIFIER_TYPES: | ||||
| return &RNA_GpencilModifier; | return &RNA_GpencilModifier; | ||||
| } | } | ||||
| return &RNA_GpencilModifier; | return &RNA_GpencilModifier; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 98 Lines • ▼ Show 20 Lines | static void rna_HookGpencilModifier_object_set(PointerRNA *ptr, | ||||
| HookGpencilModifierData *hmd = ptr->data; | HookGpencilModifierData *hmd = ptr->data; | ||||
| Object *ob = (Object *)value.data; | Object *ob = (Object *)value.data; | ||||
| hmd->object = ob; | hmd->object = ob; | ||||
| id_lib_extern((ID *)ob); | id_lib_extern((ID *)ob); | ||||
| BKE_object_modifier_gpencil_hook_reset(ob, hmd); | BKE_object_modifier_gpencil_hook_reset(ob, hmd); | ||||
| } | } | ||||
| static void rna_VertexcolorGpencilModifier_object_set(PointerRNA *ptr, | |||||
| PointerRNA value, | |||||
| struct ReportList *UNUSED(reports)) | |||||
| { | |||||
| VertexcolorGpencilModifierData *hmd = ptr->data; | |||||
| Object *ob = (Object *)value.data; | |||||
| hmd->object = ob; | |||||
| id_lib_extern((ID *)ob); | |||||
| } | |||||
| static void rna_TimeModifier_start_frame_set(PointerRNA *ptr, int value) | static void rna_TimeModifier_start_frame_set(PointerRNA *ptr, int value) | ||||
| { | { | ||||
| TimeGpencilModifierData *tmd = ptr->data; | TimeGpencilModifierData *tmd = ptr->data; | ||||
| CLAMP(value, MINFRAME, MAXFRAME); | CLAMP(value, MINFRAME, MAXFRAME); | ||||
| tmd->sfra = value; | tmd->sfra = value; | ||||
| if (tmd->sfra >= tmd->efra) { | if (tmd->sfra >= tmd->efra) { | ||||
| tmd->efra = MIN2(tmd->sfra, MAXFRAME); | tmd->efra = MIN2(tmd->sfra, MAXFRAME); | ||||
| ▲ Show 20 Lines • Show All 596 Lines • ▼ Show 20 Lines | static void rna_def_modifier_gpenciltint(BlenderRNA *brna) | ||||
| RNA_def_property_ui_text(prop, "Layer", "Layer name"); | RNA_def_property_ui_text(prop, "Layer", "Layer name"); | ||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | ||||
| prop = RNA_def_property(srna, "material", PROP_STRING, PROP_NONE); | prop = RNA_def_property(srna, "material", PROP_STRING, PROP_NONE); | ||||
| RNA_def_property_string_sdna(prop, NULL, "materialname"); | RNA_def_property_string_sdna(prop, NULL, "materialname"); | ||||
| RNA_def_property_ui_text(prop, "Material", "Material name"); | RNA_def_property_ui_text(prop, "Material", "Material name"); | ||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | ||||
| prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA); | prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); | ||||
| RNA_def_property_range(prop, 0.0, 1.0); | RNA_def_property_range(prop, 0.0, 1.0); | ||||
| RNA_def_property_float_sdna(prop, NULL, "rgb"); | RNA_def_property_float_sdna(prop, NULL, "rgb"); | ||||
| RNA_def_property_array(prop, 3); | RNA_def_property_array(prop, 3); | ||||
| RNA_def_property_ui_text(prop, "Color", "Color used for tinting"); | RNA_def_property_ui_text(prop, "Color", "Color used for tinting"); | ||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | ||||
| prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE); | prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE); | ||||
| RNA_def_property_float_sdna(prop, NULL, "factor"); | RNA_def_property_float_sdna(prop, NULL, "factor"); | ||||
| RNA_def_property_ui_range(prop, 0, 2.0, 0.1, 3); | RNA_def_property_ui_range(prop, 0, 2.0, 0.1, 3); | ||||
fclem: Same for this one. | |||||
| RNA_def_property_ui_text(prop, "Factor", "Factor for mixing color"); | RNA_def_property_ui_text(prop, "Factor", "Factor for mixing color"); | ||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | ||||
| prop = RNA_def_property(srna, "create_materials", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_TINT_CREATE_COLORS); | |||||
| RNA_def_property_ui_text(prop, "Create Materials", "When apply modifier, create new material"); | |||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | |||||
| prop = RNA_def_property(srna, "pass_index", PROP_INT, PROP_NONE); | prop = RNA_def_property(srna, "pass_index", PROP_INT, PROP_NONE); | ||||
| RNA_def_property_int_sdna(prop, NULL, "pass_index"); | RNA_def_property_int_sdna(prop, NULL, "pass_index"); | ||||
| RNA_def_property_range(prop, 0, 100); | RNA_def_property_range(prop, 0, 100); | ||||
| RNA_def_property_ui_text(prop, "Pass", "Pass index"); | RNA_def_property_ui_text(prop, "Pass", "Pass index"); | ||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | ||||
| prop = RNA_def_property(srna, "invert_layers", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "invert_layers", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_TINT_INVERT_LAYER); | RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_TINT_INVERT_LAYER); | ||||
| ▲ Show 20 Lines • Show All 144 Lines • ▼ Show 20 Lines | static void rna_def_modifier_gpencilcolor(BlenderRNA *brna) | ||||
| prop = RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE); | prop = RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE); | ||||
| RNA_def_property_range(prop, 0.0, 2.0); | RNA_def_property_range(prop, 0.0, 2.0); | ||||
| RNA_def_property_ui_range(prop, 0.0, 2.0, 0.1, 3); | RNA_def_property_ui_range(prop, 0.0, 2.0, 0.1, 3); | ||||
| RNA_def_property_float_sdna(prop, NULL, "hsv[2]"); | RNA_def_property_float_sdna(prop, NULL, "hsv[2]"); | ||||
| RNA_def_property_ui_text(prop, "Value", "Color Value"); | RNA_def_property_ui_text(prop, "Value", "Color Value"); | ||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | ||||
| prop = RNA_def_property(srna, "create_materials", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_COLOR_CREATE_COLORS); | |||||
| RNA_def_property_ui_text(prop, "Create Materials", "When apply modifier, create new material"); | |||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | |||||
| prop = RNA_def_property(srna, "pass_index", PROP_INT, PROP_NONE); | prop = RNA_def_property(srna, "pass_index", PROP_INT, PROP_NONE); | ||||
| RNA_def_property_int_sdna(prop, NULL, "pass_index"); | RNA_def_property_int_sdna(prop, NULL, "pass_index"); | ||||
| RNA_def_property_range(prop, 0, 100); | RNA_def_property_range(prop, 0, 100); | ||||
| RNA_def_property_ui_text(prop, "Pass", "Pass index"); | RNA_def_property_ui_text(prop, "Pass", "Pass index"); | ||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | ||||
| prop = RNA_def_property(srna, "invert_layers", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "invert_layers", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_COLOR_INVERT_LAYER); | RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_COLOR_INVERT_LAYER); | ||||
| Show All 32 Lines | static void rna_def_modifier_gpencilopacity(BlenderRNA *brna) | ||||
| RNA_def_struct_sdna(srna, "OpacityGpencilModifierData"); | RNA_def_struct_sdna(srna, "OpacityGpencilModifierData"); | ||||
| RNA_def_struct_ui_icon(srna, ICON_MOD_OPACITY); | RNA_def_struct_ui_icon(srna, ICON_MOD_OPACITY); | ||||
| prop = RNA_def_property(srna, "modify_color", PROP_ENUM, PROP_NONE); | 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_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_ui_text(prop, "Mode", "Set what colors of the stroke are affected"); | ||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | ||||
| prop = RNA_def_property(srna, "opacity_mode", PROP_ENUM, PROP_NONE); | |||||
| RNA_def_property_enum_items(prop, modifier_opacity_mode_items); | |||||
| RNA_def_property_ui_text(prop, "Opacity Mode", "Set what mode used to define opacity"); | |||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | |||||
| prop = RNA_def_property(srna, "layer", PROP_STRING, PROP_NONE); | prop = RNA_def_property(srna, "layer", PROP_STRING, PROP_NONE); | ||||
| RNA_def_property_string_sdna(prop, NULL, "layername"); | RNA_def_property_string_sdna(prop, NULL, "layername"); | ||||
| RNA_def_property_ui_text(prop, "Layer", "Layer name"); | RNA_def_property_ui_text(prop, "Layer", "Layer name"); | ||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | ||||
| prop = RNA_def_property(srna, "material", PROP_STRING, PROP_NONE); | prop = RNA_def_property(srna, "material", PROP_STRING, PROP_NONE); | ||||
| RNA_def_property_string_sdna(prop, NULL, "materialname"); | RNA_def_property_string_sdna(prop, NULL, "materialname"); | ||||
| RNA_def_property_ui_text(prop, "Material", "Material name"); | RNA_def_property_ui_text(prop, "Material", "Material name"); | ||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | ||||
| prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); | prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); | ||||
| RNA_def_property_string_sdna(prop, NULL, "vgname"); | 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_ui_text(prop, "Vertex Group", "Vertex group name for modulating the deform"); | ||||
| RNA_def_property_string_funcs(prop, NULL, NULL, "rna_OpacityGpencilModifier_vgname_set"); | RNA_def_property_string_funcs(prop, NULL, NULL, "rna_OpacityGpencilModifier_vgname_set"); | ||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | ||||
| prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE); | prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE); | ||||
Not Done Inline ActionsUse PROP_FACTOR here. fclem: Use `PROP_FACTOR` here. | |||||
| RNA_def_property_float_sdna(prop, NULL, "factor"); | RNA_def_property_float_sdna(prop, NULL, "factor"); | ||||
| RNA_def_property_ui_range(prop, 0, 2.0, 0.1, 3); | RNA_def_property_ui_range(prop, 0, 2.0, 0.1, 3); | ||||
| RNA_def_property_ui_text(prop, "Factor", "Factor of Opacity"); | RNA_def_property_ui_text(prop, "Factor", "Factor of Opacity"); | ||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | ||||
| prop = RNA_def_property(srna, "create_materials", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_OPACITY_CREATE_COLORS); | |||||
| RNA_def_property_ui_text(prop, "Create Materials", "When apply modifier, create new material"); | |||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | |||||
| prop = RNA_def_property(srna, "pass_index", PROP_INT, PROP_NONE); | prop = RNA_def_property(srna, "pass_index", PROP_INT, PROP_NONE); | ||||
Not Done Inline ActionsAfter testing it's better to have increments to 0.1. fclem: After testing it's better to have increments to 0.1. | |||||
| RNA_def_property_int_sdna(prop, NULL, "pass_index"); | RNA_def_property_int_sdna(prop, NULL, "pass_index"); | ||||
| RNA_def_property_range(prop, 0, 100); | RNA_def_property_range(prop, 0, 100); | ||||
| RNA_def_property_ui_text(prop, "Pass", "Pass index"); | RNA_def_property_ui_text(prop, "Pass", "Pass index"); | ||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | ||||
| prop = RNA_def_property(srna, "invert_layers", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "invert_layers", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_OPACITY_INVERT_LAYER); | RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_OPACITY_INVERT_LAYER); | ||||
| RNA_def_property_ui_text(prop, "Inverse Layers", "Inverse filter"); | RNA_def_property_ui_text(prop, "Inverse Layers", "Inverse filter"); | ||||
| ▲ Show 20 Lines • Show All 618 Lines • ▼ Show 20 Lines | static void rna_def_modifier_gpencilarmature(BlenderRNA *brna) | ||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_dependency_update"); | RNA_def_property_update(prop, 0, "rna_GpencilModifier_dependency_update"); | ||||
| prop = RNA_def_property(srna, "use_deform_preserve_volume", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_deform_preserve_volume", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_QUATERNION); | RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_QUATERNION); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| prop, "Preserve Volume", "Deform rotation interpolation with quaternions"); | prop, "Preserve Volume", "Deform rotation interpolation with quaternions"); | ||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_dependency_update"); | RNA_def_property_update(prop, 0, "rna_GpencilModifier_dependency_update"); | ||||
| # if 0 /* GPXX keep disabled now */ | |||||
| prop = RNA_def_property(srna, "use_multi_modifier", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "multi", 0); | |||||
| RNA_def_property_ui_text( | |||||
| prop, | |||||
| "Multi Modifier", | |||||
| "Use same input as previous modifier, and mix results using overall vgroup"); | |||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_dependency_update"); | |||||
| # endif | |||||
| prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); | prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); | ||||
| RNA_def_property_string_sdna(prop, NULL, "vgname"); | RNA_def_property_string_sdna(prop, NULL, "vgname"); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| prop, | prop, | ||||
| "Vertex Group", | "Vertex Group", | ||||
| "Name of Vertex Group which determines influence of modifier per point"); | "Name of Vertex Group which determines influence of modifier per point"); | ||||
| RNA_def_property_string_funcs(prop, NULL, NULL, "rna_ArmatureGpencilModifier_vgname_set"); | RNA_def_property_string_funcs(prop, NULL, NULL, "rna_ArmatureGpencilModifier_vgname_set"); | ||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_dependency_update"); | RNA_def_property_update(prop, 0, "rna_GpencilModifier_dependency_update"); | ||||
| ▲ Show 20 Lines • Show All 99 Lines • ▼ Show 20 Lines | static void rna_def_modifier_gpencilmultiply(BlenderRNA *brna) | ||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | ||||
| prop = RNA_def_property(srna, "fading_center", PROP_FLOAT, PROP_NONE); | prop = RNA_def_property(srna, "fading_center", PROP_FLOAT, PROP_NONE); | ||||
| RNA_def_property_range(prop, 0, 1); | RNA_def_property_range(prop, 0, 1); | ||||
| RNA_def_property_ui_text(prop, "Center", "Fade center"); | RNA_def_property_ui_text(prop, "Center", "Fade center"); | ||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | 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 for define 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, "use_decay_color", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_VERTEXCOL_DECAY_COLOR); | |||||
| RNA_def_property_ui_text(prop, "Decay", "The tinting decrease with the distance"); | |||||
| 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, 0, FLT_MAX); | |||||
| RNA_def_property_ui_range(prop, 0, 100, 100, 2); | |||||
| 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"); | |||||
| } | |||||
| void RNA_def_greasepencil_modifier(BlenderRNA *brna) | void RNA_def_greasepencil_modifier(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| /* data */ | /* data */ | ||||
| srna = RNA_def_struct(brna, "GpencilModifier", NULL); | srna = RNA_def_struct(brna, "GpencilModifier", NULL); | ||||
| RNA_def_struct_ui_text(srna, "GpencilModifier", "Modifier affecting the grease pencil object"); | RNA_def_struct_ui_text(srna, "GpencilModifier", "Modifier affecting the grease pencil object"); | ||||
| ▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | void RNA_def_greasepencil_modifier(BlenderRNA *brna) | ||||
| rna_def_modifier_gpencilinstance(brna); | rna_def_modifier_gpencilinstance(brna); | ||||
| rna_def_modifier_gpencilbuild(brna); | rna_def_modifier_gpencilbuild(brna); | ||||
| rna_def_modifier_gpencilopacity(brna); | rna_def_modifier_gpencilopacity(brna); | ||||
| rna_def_modifier_gpencillattice(brna); | rna_def_modifier_gpencillattice(brna); | ||||
| rna_def_modifier_gpencilmirror(brna); | rna_def_modifier_gpencilmirror(brna); | ||||
| rna_def_modifier_gpencilhook(brna); | rna_def_modifier_gpencilhook(brna); | ||||
| rna_def_modifier_gpencilarmature(brna); | rna_def_modifier_gpencilarmature(brna); | ||||
| rna_def_modifier_gpencilmultiply(brna); | rna_def_modifier_gpencilmultiply(brna); | ||||
| rna_def_modifier_gpencilvertexcolor(brna); | |||||
| } | } | ||||
| #endif | #endif | ||||
Same for this one.