diff options
author | Henrik Dick <hen-di@web.de> | 2022-03-24 15:01:46 +0300 |
---|---|---|
committer | Henrik Dick <hen-di@web.de> | 2022-03-24 15:01:46 +0300 |
commit | cee6af00567f454983d0bd3f6508e0213c91fb1c (patch) | |
tree | bf4846a5d38c83047460c78a2c28ef0edbff5d86 /source/blender/makesdna | |
parent | dd161ff7a40c721c16bf43c34e172c9fcf9cddf7 (diff) |
GPencil: New Envelope Modifier
This new modifier creates a shape known as envelope. It connects all
points that are n points apart. There is also a mode which fits a
single stroke to the envelope shape that is determined by that rule.
For more details, refer to the patch.
Reviewed By: NicksBest, antoniov, frogstomp, mendio
Differential Revision: http://developer.blender.org/D14341
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_gpencil_modifier_defaults.h | 9 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_gpencil_modifier_types.h | 41 | ||||
-rw-r--r-- | source/blender/makesdna/intern/dna_defaults.c | 2 |
3 files changed, 52 insertions, 0 deletions
diff --git a/source/blender/makesdna/DNA_gpencil_modifier_defaults.h b/source/blender/makesdna/DNA_gpencil_modifier_defaults.h index 3e06259dfd5..a87e7a7c397 100644 --- a/source/blender/makesdna/DNA_gpencil_modifier_defaults.h +++ b/source/blender/makesdna/DNA_gpencil_modifier_defaults.h @@ -366,5 +366,14 @@ .smooth_step = 1, \ } +#define _DNA_DEFAULT_EnvelopeGpencilModifierData \ + { \ + .spread = 10, \ + .mode = GP_ENVELOPE_SEGMENTS, \ + .mat_nr = -1, \ + .thickness = 1.0f, \ + .strength = 1.0f, \ + } + /* clang-format off */ diff --git a/source/blender/makesdna/DNA_gpencil_modifier_types.h b/source/blender/makesdna/DNA_gpencil_modifier_types.h index 0539b84e093..1054c309ee5 100644 --- a/source/blender/makesdna/DNA_gpencil_modifier_types.h +++ b/source/blender/makesdna/DNA_gpencil_modifier_types.h @@ -46,6 +46,7 @@ typedef enum GpencilModifierType { eGpencilModifierType_Dash = 22, eGpencilModifierType_WeightAngle = 23, eGpencilModifierType_Shrinkwrap = 24, + eGpencilModifierType_Envelope = 25, /* Keep last. */ NUM_GREASEPENCIL_MODIFIER_TYPES, } GpencilModifierType; @@ -1127,6 +1128,46 @@ typedef enum eShrinkwrapGpencil_Flag { GP_SHRINKWRAP_INVERT_VGROUP = (1 << 6), } eShrinkwrapGpencil_Flag; +typedef struct EnvelopeGpencilModifierData { + GpencilModifierData modifier; + /** Material for filtering. */ + struct Material *material; + /** Layer name. */ + char layername[64]; + /** Optional vertexgroup name, MAX_VGROUP_NAME. */ + char vgname[64]; + /** Custom index for passes. */ + int pass_index; + /** Several flags. */ + int flag; + int mode; + /** Material for the new strokes. */ + int mat_nr; + /** Thickness multiplier for the new strokes. */ + float thickness; + /** Strength multiplier for the new strokes. */ + float strength; + /** Custom index for passes. */ + int layer_pass; + /* Length of the envelope effect. */ + int spread; +} EnvelopeGpencilModifierData; + +typedef enum eEnvelopeGpencil_Flag { + GP_ENVELOPE_INVERT_LAYER = (1 << 0), + GP_ENVELOPE_INVERT_PASS = (1 << 1), + GP_ENVELOPE_INVERT_VGROUP = (1 << 2), + GP_ENVELOPE_INVERT_LAYERPASS = (1 << 3), + GP_ENVELOPE_INVERT_MATERIAL = (1 << 4), +} eEnvelopeGpencil_Flag; + +/* Texture->mode */ +typedef enum eEnvelopeGpencil_Mode { + GP_ENVELOPE_DEFORM = 0, + GP_ENVELOPE_SEGMENTS = 1, + GP_ENVELOPE_FILLS = 2, +} eEnvelopeGpencil_Mode; + #ifdef __cplusplus } #endif diff --git a/source/blender/makesdna/intern/dna_defaults.c b/source/blender/makesdna/intern/dna_defaults.c index b7f942e2502..197a863db72 100644 --- a/source/blender/makesdna/intern/dna_defaults.c +++ b/source/blender/makesdna/intern/dna_defaults.c @@ -316,6 +316,7 @@ SDNA_DEFAULT_DECL_STRUCT(LengthGpencilModifierData); SDNA_DEFAULT_DECL_STRUCT(DashGpencilModifierData); SDNA_DEFAULT_DECL_STRUCT(DashGpencilModifierSegment); SDNA_DEFAULT_DECL_STRUCT(ShrinkwrapGpencilModifierData); +SDNA_DEFAULT_DECL_STRUCT(EnvelopeGpencilModifierData); #undef SDNA_DEFAULT_DECL_STRUCT @@ -555,6 +556,7 @@ const void *DNA_default_table[SDNA_TYPE_MAX] = { SDNA_DEFAULT_DECL(DashGpencilModifierData), SDNA_DEFAULT_DECL(DashGpencilModifierSegment), SDNA_DEFAULT_DECL(ShrinkwrapGpencilModifierData), + SDNA_DEFAULT_DECL(EnvelopeGpencilModifierData), }; #undef SDNA_DEFAULT_DECL #undef SDNA_DEFAULT_DECL_EX |