diff options
author | Colin Marmond <Kdaf> | 2022-04-26 13:29:22 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2022-04-26 13:33:35 +0300 |
commit | 4e57b6ce77b15709d7a76382c2d185f9c845532c (patch) | |
tree | 2ba2d7c1ef368799779fbd3fd484f72077101e36 /source/blender/makesrna | |
parent | 6cf148227b220dd5087241ad01b6d2d6fe9afb80 (diff) |
Animation: Sensible frame range for motion paths
Motion paths can now be initialised to more sensible frame ranges,
rather than simply 1-250:
- Scene Frame Range
- Selected Keyframes
- All Keyframes
Reviewed By: sybren, looch, dfelinto, pablico
Maniphest Tasks: T93047
Differential Revision: https://developer.blender.org/D13687
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/RNA_enum_items.h | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_animviz.c | 47 |
2 files changed, 34 insertions, 15 deletions
diff --git a/source/blender/makesrna/RNA_enum_items.h b/source/blender/makesrna/RNA_enum_items.h index 6539d636697..74f8e2487a4 100644 --- a/source/blender/makesrna/RNA_enum_items.h +++ b/source/blender/makesrna/RNA_enum_items.h @@ -87,6 +87,8 @@ DEF_ENUM(rna_enum_keying_flag_items_api) DEF_ENUM(rna_enum_fmodifier_type_items) DEF_ENUM(rna_enum_motionpath_bake_location_items) +DEF_ENUM(rna_enum_motionpath_display_type_items) +DEF_ENUM(rna_enum_motionpath_range_items) DEF_ENUM(rna_enum_event_value_items) DEF_ENUM(rna_enum_event_direction_items) diff --git a/source/blender/makesrna/intern/rna_animviz.c b/source/blender/makesrna/intern/rna_animviz.c index cb993931296..96332788abe 100644 --- a/source/blender/makesrna/intern/rna_animviz.c +++ b/source/blender/makesrna/intern/rna_animviz.c @@ -36,6 +36,31 @@ const EnumPropertyItem rna_enum_motionpath_bake_location_items[] = { {0, NULL, 0, NULL, NULL}, }; +const EnumPropertyItem rna_enum_motionpath_display_type_items[] = { + {MOTIONPATH_TYPE_ACFRA, + "CURRENT_FRAME", + 0, + "Around Frame", + "Display Paths of poses within a fixed number of frames around the current frame"}, + {MOTIONPATH_TYPE_RANGE, + "RANGE", + 0, + "In Range", + "Display Paths of poses within specified range"}, + {0, NULL, 0, NULL, NULL}, +}; + +const EnumPropertyItem rna_enum_motionpath_range_items[] = { + {MOTIONPATH_RANGE_KEYS_ALL, "KEYS_ALL", 0, "All Keys", "From the first keyframe to the last"}, + {MOTIONPATH_RANGE_KEYS_SELECTED, + "KEYS_SELECTED", + 0, + "Selected Keys", + "From the first selected keyframe to the last"}, + {MOTIONPATH_RANGE_SCENE, "SCENE", 0, "Scene Frame Range", "The entire Scene / Preview range"}, + {0, NULL, 0, NULL, NULL}, +}; + #ifdef RNA_RUNTIME static PointerRNA rna_AnimViz_motion_paths_get(PointerRNA *ptr) @@ -173,20 +198,6 @@ static void rna_def_animviz_paths(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; - static const EnumPropertyItem prop_type_items[] = { - {MOTIONPATH_TYPE_ACFRA, - "CURRENT_FRAME", - 0, - "Around Frame", - "Display Paths of poses within a fixed number of frames around the current frame"}, - {MOTIONPATH_TYPE_RANGE, - "RANGE", - 0, - "In Range", - "Display Paths of poses within specified range"}, - {0, NULL, 0, NULL, NULL}, - }; - srna = RNA_def_struct(brna, "AnimVizMotionPaths", NULL); RNA_def_struct_sdna(srna, "bAnimVizSettings"); RNA_def_struct_nested(brna, srna, "AnimViz"); @@ -198,10 +209,16 @@ static void rna_def_animviz_paths(BlenderRNA *brna) /* Enums */ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "path_type"); - RNA_def_property_enum_items(prop, prop_type_items); + RNA_def_property_enum_items(prop, rna_enum_motionpath_display_type_items); RNA_def_property_ui_text(prop, "Paths Type", "Type of range to show for Motion Paths"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW_ANIMVIZ, NULL); + prop = RNA_def_property(srna, "range", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "path_range"); + RNA_def_property_enum_items(prop, rna_enum_motionpath_range_items); + RNA_def_property_ui_text(prop, "Paths Range", "Type of range to calculate for Motion Paths"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW_ANIMVIZ, NULL); + prop = RNA_def_property(srna, "bake_location", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "path_bakeflag"); RNA_def_property_enum_items(prop, rna_enum_motionpath_bake_location_items); |