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:
authorYimingWu <NicksBest>2021-04-28 17:46:46 +0300
committerAntonio Vazquez <blendergit@gmail.com>2021-04-28 17:53:19 +0300
commitf8f7c0ca6db87e5f2613896156e595d2bea5fdde (patch)
tree369d08a6f78d4de271e7e1aaf35f0475fb6d7a74 /source/blender/makesdna/DNA_gpencil_modifier_types.h
parent67a52c8a4065f32a57d946524a4fab1d2ba92512 (diff)
GPencil: Fading based on distance to reference object in Opacity and Thickness modifiers
This patch allows you to dynamically control stroke's opacity and thickness using an object for distance reference in the modifier. Fading range is adjustable, and it is compatible with current curve/vertex group selection. Reviewed By: #grease_pencil, antoniov, mendio Maniphest Tasks: T82177, T80194 Differential Revision: https://developer.blender.org/D9091
Diffstat (limited to 'source/blender/makesdna/DNA_gpencil_modifier_types.h')
-rw-r--r--source/blender/makesdna/DNA_gpencil_modifier_types.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/source/blender/makesdna/DNA_gpencil_modifier_types.h b/source/blender/makesdna/DNA_gpencil_modifier_types.h
index 8d7b3896ef9..668ddae098a 100644
--- a/source/blender/makesdna/DNA_gpencil_modifier_types.h
+++ b/source/blender/makesdna/DNA_gpencil_modifier_types.h
@@ -187,7 +187,12 @@ typedef struct ThickGpencilModifierData {
int thickness;
/** Custom index for passes. */
int layer_pass;
- char _pad[4];
+ /** Start/end distances of the fading effect. */
+ float fading_start;
+ float fading_end;
+ float fading_end_factor;
+ /** Fading reference object */
+ struct Object *object;
struct CurveMapping *curve_thickness;
} ThickGpencilModifierData;
@@ -199,6 +204,7 @@ typedef enum eThickGpencil_Flag {
GP_THICK_NORMALIZE = (1 << 4),
GP_THICK_INVERT_LAYERPASS = (1 << 5),
GP_THICK_INVERT_MATERIAL = (1 << 6),
+ GP_THICK_FADING = (1 << 7),
} eThickGpencil_Flag;
typedef struct TimeGpencilModifierData {
@@ -291,9 +297,16 @@ typedef struct OpacityGpencilModifierData {
int flag;
/** Main Opacity factor. */
float factor;
+ /** Fading controlling object */
+ int _pad0;
+ struct Object *object;
+ /** Start/end distances of the fading effect. */
+ float fading_start;
+ float fading_end;
+ float fading_end_factor;
/** Modify stroke, fill or both. */
char modify_color;
- char _pad[3];
+ char _pad1[3];
/** Custom index for passes. */
int layer_pass;
@@ -309,6 +322,7 @@ typedef enum eOpacityGpencil_Flag {
GP_OPACITY_INVERT_MATERIAL = (1 << 5),
GP_OPACITY_CUSTOM_CURVE = (1 << 6),
GP_OPACITY_NORMALIZE = (1 << 7),
+ GP_OPACITY_FADING = (1 << 8),
} eOpacityGpencil_Flag;
typedef struct ArrayGpencilModifierData {