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:
authorCody Winchester <CodyWinch>2020-04-19 18:25:36 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-04-19 18:29:35 +0300
commita39a6517af6603fcb16728daed88b642c88aa6eb (patch)
treeccb82a3966c6d7bef20acf618f5f4ff345d94e77 /source/blender/makesdna/DNA_gpencil_modifier_types.h
parenta0a59972e7e526ce3c49878f4607acbae8508e7a (diff)
GPencil: Add Texture modifier
This patch aims to add a new modifier for grease pencil objects that gives more control over the strokes texture UVs. There are 3 modes. 1 Control the stroke texture UVs alone 2 Control the fill texture UVs alone 3 Control both the fill and stroke texture UVs For the stroke texture UVs there are 2 options for fitting the texture to the stroke. 1 The texture uvs are kept a consistent length how it currently is set by default. 2 The uvs are normalized to fit the length of the stroke regardless of how long or short it gets allowing the texture to fit the length of the stroke. There are then 2 controls to scale up and down the uvs and an offset value that allows moving the texture along the stroke. For the fill texture UVs it includes all of the transformational controls. Location offset, scale, and rotation. Reviewed By: antoniov, mendio Differential Revision: https://developer.blender.org/D7439
Diffstat (limited to 'source/blender/makesdna/DNA_gpencil_modifier_types.h')
-rw-r--r--source/blender/makesdna/DNA_gpencil_modifier_types.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/source/blender/makesdna/DNA_gpencil_modifier_types.h b/source/blender/makesdna/DNA_gpencil_modifier_types.h
index c3425826d36..1265ce0983c 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_Armature = 15,
eGpencilModifierType_Time = 16,
eGpencilModifierType_Multiply = 17,
+ eGpencilModifierType_Texture = 18,
NUM_GREASEPENCIL_MODIFIER_TYPES,
} GpencilModifierType;
@@ -713,4 +714,50 @@ typedef enum eTintGpencil_Flag {
GP_TINT_CUSTOM_CURVE = (1 << 6),
} eTintGpencil_Flag;
+typedef struct TextureGpencilModifierData {
+ GpencilModifierData modifier;
+ /** Layer name. */
+ char layername[64];
+ /** Material name. */
+ char materialname[64];
+ /** Optional vertexgroup name, MAX_VGROUP_NAME. */
+ char vgname[64];
+ /** Custom index for passes. */
+ int pass_index;
+ /** Flags. */
+ int flag;
+ /** Offset value to add to uv_fac. */
+ float uv_offset;
+ float uv_scale;
+ float fill_rotation;
+ float fill_offset[2];
+ float fill_scale;
+ /** Custom index for passes. */
+ int layer_pass;
+ /** Texture fit options. */
+ short fit_method;
+ short mode;
+} TextureGpencilModifierData;
+
+typedef enum eTextureGpencil_Flag {
+ GP_TEX_INVERT_LAYER = (1 << 0),
+ GP_TEX_INVERT_PASS = (1 << 1),
+ GP_TEX_INVERT_VGROUP = (1 << 2),
+ GP_TEX_INVERT_LAYERPASS = (1 << 3),
+ GP_TEX_INVERT_MATERIAL = (1 << 4),
+} eTextureGpencil_Flag;
+
+/* Texture->fit_method */
+typedef enum eTextureGpencil_Fit {
+ GP_TEX_FIT_STROKE = 0,
+ GP_TEX_CONSTANT_LENGTH = 1,
+} eTextureGpencil_Fit;
+
+/* Texture->mode */
+typedef enum eTextureGpencil_Mode {
+ STROKE = 0,
+ FILL = 1,
+ STROKE_AND_FILL = 2,
+} eTextureGpencil_Mode;
+
#endif /* __DNA_GPENCIL_MODIFIER_TYPES_H__ */