diff options
author | Antonioya <blendergit@gmail.com> | 2018-10-22 19:25:13 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2018-10-22 19:30:26 +0300 |
commit | e010d5e3b1b2110afd83c37d321b358692a478a8 (patch) | |
tree | 0b654df668a5b81693773764d2ac58263af1d9df /source/blender/makesrna/intern/rna_gpencil_modifier.c | |
parent | 4bf4da12de92989d5708be8b6f14c3536e872836 (diff) |
GP: New Time modifier
This modifier allows to offset the keyframe animated to get more variations in the animation when reuse the same datablock.
Diffstat (limited to 'source/blender/makesrna/intern/rna_gpencil_modifier.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_gpencil_modifier.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_gpencil_modifier.c b/source/blender/makesrna/intern/rna_gpencil_modifier.c index cb4e4b7ca02..032cf01c57d 100644 --- a/source/blender/makesrna/intern/rna_gpencil_modifier.c +++ b/source/blender/makesrna/intern/rna_gpencil_modifier.c @@ -74,6 +74,7 @@ const EnumPropertyItem rna_enum_object_greasepencil_modifier_type_items[] = { {eGpencilModifierType_Offset, "GP_OFFSET", ICON_MOD_DISPLACE, "Offset", "Change stroke location, rotation or scale"}, {eGpencilModifierType_Smooth, "GP_SMOOTH", ICON_MOD_SMOOTH, "Smooth", "Smooth stroke"}, {eGpencilModifierType_Thick, "GP_THICK", ICON_MAN_ROT, "Thickness", "Change stroke thickness"}, + {eGpencilModifierType_Time, "GP_TIME", ICON_MOD_DISPLACE, "Time", "Offset keyframes"}, {0, "", 0, N_("Color"), "" }, {eGpencilModifierType_Color, "GP_COLOR", ICON_GROUP_VCOL, "Hue/Saturation", "Apply changes to stroke colors"}, {eGpencilModifierType_Opacity, "GP_OPACITY", ICON_MOD_MASK, "Opacity", "Opacity of the strokes"}, @@ -142,6 +143,8 @@ static StructRNA *rna_GpencilModifier_refine(struct PointerRNA *ptr) return &RNA_ThickGpencilModifier; case eGpencilModifierType_Tint: return &RNA_TintGpencilModifier; + case eGpencilModifierType_Time: + return &RNA_TimeGpencilModifier; case eGpencilModifierType_Color: return &RNA_ColorGpencilModifier; case eGpencilModifierType_Instance: @@ -719,6 +722,40 @@ static void rna_def_modifier_gpenciltint(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); } +static void rna_def_modifier_gpenciltime(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna = RNA_def_struct(brna, "TimeGpencilModifier", "GpencilModifier"); + RNA_def_struct_ui_text(srna, "Time Modifier", "Time modifier"); + RNA_def_struct_sdna(srna, "TimeGpencilModifierData"); + RNA_def_struct_ui_icon(srna, ICON_MOD_DISPLACE); + + prop = RNA_def_property(srna, "layer", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "layername"); + RNA_def_property_ui_text(prop, "Layer", "Layer name"); + RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); + + prop = RNA_def_property(srna, "invert_layers", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_TIME_INVERT_LAYER); + RNA_def_property_ui_text(prop, "Inverse Layers", "Inverse filter"); + RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); + + prop = RNA_def_property(srna, "offset", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "offset"); + RNA_def_property_range(prop, -INT_MAX, INT_MAX); + RNA_def_property_ui_text(prop, "Offset", + "Number of frames to offset original keyframe number"); + RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); + + prop = RNA_def_property(srna, "use_keep_loop", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_TIME_KEEP_LOOP); + RNA_def_property_ui_text(prop, "Keep Loop", + "Retiming end frames and move to start of animation to keep loop"); + RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); +} + static void rna_def_modifier_gpencilcolor(BlenderRNA *brna) { StructRNA *srna; @@ -1392,6 +1429,7 @@ void RNA_def_greasepencil_modifier(BlenderRNA *brna) rna_def_modifier_gpencilthick(brna); rna_def_modifier_gpenciloffset(brna); rna_def_modifier_gpenciltint(brna); + rna_def_modifier_gpenciltime(brna); rna_def_modifier_gpencilcolor(brna); rna_def_modifier_gpencilinstance(brna); rna_def_modifier_gpencilbuild(brna); |