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:
authorAntonio Vazquez <blendergit@gmail.com>2022-09-27 17:42:00 +0300
committerAntonio Vazquez <blendergit@gmail.com>2022-09-27 17:43:20 +0300
commit5f7259a0013bdfeff681b9e80202c0c281937bbd (patch)
tree83b4a0a8ea4d8642d88d161c764f2a1201c55701 /source/blender/makesdna
parent75a6d3abf75f3082adf5240ae34973844c0d9a09 (diff)
GPencil: New Outline modifier
This modifier converts any stroke (no fill strokes) into perimeter from camera view. Also, it's possible to define an alternative material for the outline. There is an option to include a target object to manipulate the start point of the strokes. The start point will be the nearest point to the target object. Reviewed By: mendio, frogstomp Maniphest Tasks: T100826 Differential Revision: https://developer.blender.org/D15882 Note: Icon will be updated in T101155
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r--source/blender/makesdna/DNA_gpencil_modifier_defaults.h13
-rw-r--r--source/blender/makesdna/DNA_gpencil_modifier_types.h33
-rw-r--r--source/blender/makesdna/intern/dna_defaults.c2
3 files changed, 48 insertions, 0 deletions
diff --git a/source/blender/makesdna/DNA_gpencil_modifier_defaults.h b/source/blender/makesdna/DNA_gpencil_modifier_defaults.h
index 324252ca369..56e317adca5 100644
--- a/source/blender/makesdna/DNA_gpencil_modifier_defaults.h
+++ b/source/blender/makesdna/DNA_gpencil_modifier_defaults.h
@@ -172,6 +172,19 @@
.curve_intensity = NULL, \
}
+#define _DNA_DEFAULT_OutlineGpencilModifierData \
+ { \
+ .material = NULL, \
+ .layername = "", \
+ .pass_index = 0, \
+ .flag = GP_OUTLINE_KEEP_SHAPE, \
+ .thickness = 1, \
+ .sample_length = 0.0f, \
+ .subdiv = 3, \
+ .layer_pass = 0, \
+ .outline_material = NULL, \
+ }
+
#define _DNA_DEFAULT_SimplifyGpencilModifierData \
{ \
.material = NULL, \
diff --git a/source/blender/makesdna/DNA_gpencil_modifier_types.h b/source/blender/makesdna/DNA_gpencil_modifier_types.h
index ca1eac0bde8..629be51893a 100644
--- a/source/blender/makesdna/DNA_gpencil_modifier_types.h
+++ b/source/blender/makesdna/DNA_gpencil_modifier_types.h
@@ -47,6 +47,7 @@ typedef enum GpencilModifierType {
eGpencilModifierType_WeightAngle = 23,
eGpencilModifierType_Shrinkwrap = 24,
eGpencilModifierType_Envelope = 25,
+ eGpencilModifierType_Outline = 26,
/* Keep last. */
NUM_GREASEPENCIL_MODIFIER_TYPES,
} GpencilModifierType;
@@ -313,6 +314,38 @@ typedef enum eOpacityGpencil_Flag {
GP_OPACITY_WEIGHT_FACTOR = (1 << 8),
} eOpacityGpencil_Flag;
+typedef struct OutlineGpencilModifierData {
+ GpencilModifierData modifier;
+ /** Target stroke origin. */
+ struct Object *object;
+ /** Material for filtering. */
+ struct Material *material;
+ /** Layer name. */
+ char layername[64];
+ /** Custom index for passes. */
+ int pass_index;
+ /** Flags. */
+ int flag;
+ /** Thickness. */
+ int thickness;
+ /** Sample Length. */
+ float sample_length;
+ /** Subdivisions. */
+ int subdiv;
+ /** Custom index for passes. */
+ int layer_pass;
+ /** Material for outline. */
+ struct Material *outline_material;
+} OutlineGpencilModifierData;
+
+typedef enum eOutlineGpencil_Flag {
+ GP_OUTLINE_INVERT_LAYER = (1 << 0),
+ GP_OUTLINE_INVERT_PASS = (1 << 1),
+ GP_OUTLINE_INVERT_LAYERPASS = (1 << 2),
+ GP_OUTLINE_INVERT_MATERIAL = (1 << 3),
+ GP_OUTLINE_KEEP_SHAPE = (1 << 4),
+} eOutlineGpencil_Flag;
+
typedef struct ArrayGpencilModifierData {
GpencilModifierData modifier;
struct Object *object;
diff --git a/source/blender/makesdna/intern/dna_defaults.c b/source/blender/makesdna/intern/dna_defaults.c
index 197a863db72..3cd0cbcc3d6 100644
--- a/source/blender/makesdna/intern/dna_defaults.c
+++ b/source/blender/makesdna/intern/dna_defaults.c
@@ -302,6 +302,7 @@ SDNA_DEFAULT_DECL_STRUCT(MultiplyGpencilModifierData);
SDNA_DEFAULT_DECL_STRUCT(NoiseGpencilModifierData);
SDNA_DEFAULT_DECL_STRUCT(OffsetGpencilModifierData);
SDNA_DEFAULT_DECL_STRUCT(OpacityGpencilModifierData);
+SDNA_DEFAULT_DECL_STRUCT(OutlineGpencilModifierData);
SDNA_DEFAULT_DECL_STRUCT(SimplifyGpencilModifierData);
SDNA_DEFAULT_DECL_STRUCT(SmoothGpencilModifierData);
SDNA_DEFAULT_DECL_STRUCT(SubdivGpencilModifierData);
@@ -542,6 +543,7 @@ const void *DNA_default_table[SDNA_TYPE_MAX] = {
SDNA_DEFAULT_DECL(NoiseGpencilModifierData),
SDNA_DEFAULT_DECL(OffsetGpencilModifierData),
SDNA_DEFAULT_DECL(OpacityGpencilModifierData),
+ SDNA_DEFAULT_DECL(OutlineGpencilModifierData),
SDNA_DEFAULT_DECL(SimplifyGpencilModifierData),
SDNA_DEFAULT_DECL(SmoothGpencilModifierData),
SDNA_DEFAULT_DECL(SubdivGpencilModifierData),