diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2020-06-12 16:44:46 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2020-06-12 16:44:58 +0300 |
commit | 326db1b7cd4e627f1f8a2f90c3898d23a1ca69c9 (patch) | |
tree | 4954f343ae9b03407d0d2bfbaf1c7318fdbbd45a /source/blender/makesrna/intern | |
parent | 9cc059755699f49e2bd7b4e722aecc00d535113d (diff) |
GPencil: Make accessible via python to keyframe type
This can be requiered for some add-ons and for some reason this prop was missing in RNA.
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_gpencil.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c index a52811a9a9a..c707ad9b84e 100644 --- a/source/blender/makesrna/intern/rna_gpencil.c +++ b/source/blender/makesrna/intern/rna_gpencil.c @@ -76,6 +76,35 @@ static EnumPropertyItem rna_enum_gpencil_onion_modes_items[] = { {0, NULL, 0, NULL, NULL}, }; +static const EnumPropertyItem rna_enum_keyframe_type_items[] = { + {BEZT_KEYTYPE_KEYFRAME, + "KEYFRAME", + ICON_KEYTYPE_KEYFRAME_VEC, + "Keyframe", + "Normal keyframe - e.g. for key poses"}, + {BEZT_KEYTYPE_BREAKDOWN, + "BREAKDOWN", + ICON_KEYTYPE_BREAKDOWN_VEC, + "Breakdown", + "A breakdown pose - e.g. for transitions between key poses"}, + {BEZT_KEYTYPE_MOVEHOLD, + "MOVING_HOLD", + ICON_KEYTYPE_MOVING_HOLD_VEC, + "Moving Hold", + "A keyframe that is part of a moving hold"}, + {BEZT_KEYTYPE_EXTREME, + "EXTREME", + ICON_KEYTYPE_EXTREME_VEC, + "Extreme", + "An 'extreme' pose, or some other purpose as needed"}, + {BEZT_KEYTYPE_JITTER, + "JITTER", + ICON_KEYTYPE_JITTER_VEC, + "Jitter", + "A filler or baked keyframe for keying on ones, or some other purpose as needed"}, + {0, NULL, 0, NULL, NULL}, +}; + static const EnumPropertyItem rna_enum_onion_keyframe_type_items[] = { {-1, "ALL", ICON_ACTION, "All Types", "Include all Keyframe types"}, {BEZT_KEYTYPE_KEYFRAME, @@ -1324,6 +1353,13 @@ static void rna_def_gpencil_frame(BlenderRNA *brna) RNA_def_property_range(prop, -MAXFRAME, MAXFRAME); RNA_def_property_ui_text(prop, "Frame Number", "The frame on which this sketch appears"); + prop = RNA_def_property(srna, "keyframe_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "key_type"); + RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); + RNA_def_property_enum_items(prop, rna_enum_keyframe_type_items); + RNA_def_property_ui_text(prop, "Keyframe Type", "Type of keyframe"); + RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); + /* Flags */ prop = RNA_def_property(srna, "is_edited", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna( |