diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2022-05-02 18:28:24 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2022-05-02 18:36:58 +0300 |
commit | 0d9e22d43ca18d8326aed33fabe3177dcf0663b8 (patch) | |
tree | c8a7e49048142f2d15657cf0b4d9062f57f71338 /source/blender/makesrna/intern/rna_gpencil_modifier.c | |
parent | b1e0be0d2553742fcceda9cfe29ebb70f26b06a1 (diff) |
GPencil: New Noise modifier random in Keyframes only
This is for some animation styles that usually copy and paste keyframes and they want avoid that both frames look equal, but they don't want noise randomness changes in the inbetween frames.
The patch adds a new random `Mode` option to select when the noise change.
Reviewed By: pepeland
Maniphest Tasks: T97099
Differential Revision: https://developer.blender.org/D14566
Diffstat (limited to 'source/blender/makesrna/intern/rna_gpencil_modifier.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_gpencil_modifier.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_gpencil_modifier.c b/source/blender/makesrna/intern/rna_gpencil_modifier.c index 1f9bb972923..da2c404ac88 100644 --- a/source/blender/makesrna/intern/rna_gpencil_modifier.c +++ b/source/blender/makesrna/intern/rna_gpencil_modifier.c @@ -232,6 +232,11 @@ static const EnumPropertyItem gpencil_envelope_mode_items[] = { "Add fill segments to create the envelope. Don't keep the original stroke"}, {0, NULL, 0, NULL, NULL}, }; +static const EnumPropertyItem modifier_noise_random_mode_items[] = { + {GP_NOISE_RANDOM_STEP, "STEP", 0, "Steps", "Apply random every N steps"}, + {GP_NOISE_RANDOM_KEYFRAME, "KEYFRAME", 0, "On Keyframes", "Apply random every keyframe"}, + {0, NULL, 0, NULL, NULL}, +}; #endif #ifdef RNA_RUNTIME @@ -959,6 +964,12 @@ static void rna_def_modifier_gpencilnoise(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Inverse Pass", "Inverse filter"); RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); + prop = RNA_def_property(srna, "random_mode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "noise_mode"); + RNA_def_property_enum_items(prop, modifier_noise_random_mode_items); + RNA_def_property_ui_text(prop, "Mode", "How the random changes are applied"); + RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); + RNA_define_lib_overridable(false); } |