Animation: Move Snapping to Scene #109015

Merged
Christoph Lendenfeld merged 35 commits from ChrisLend/blender:frame_snapping into main 2023-09-05 10:07:02 +02:00
2 changed files with 3 additions and 11 deletions
Showing only changes of commit 65dd24f3b1 - Show all commits

View File

@ -27,8 +27,7 @@ DEF_ENUM(rna_enum_proportional_falloff_curve_only_items)
DEF_ENUM(rna_enum_snap_source_items)
DEF_ENUM(rna_enum_snap_element_items)
DEF_ENUM(rna_enum_snap_node_element_items)
DEF_ENUM(rna_enum_snap_action_element_items)
DEF_ENUM(rna_enum_snap_graph_element_items)
DEF_ENUM(rna_enum_snap_animation_element_items)
nathanvegdahl marked this conversation as resolved Outdated

Is rna_enum_snap_action_element_items used anywhere? I couldn't find it. Then again, RNA stuff still seems a little magical to me sometimes, so I easily could have just missed it.

Is `rna_enum_snap_action_element_items` used anywhere? I couldn't find it. Then again, RNA stuff still seems a little magical to me sometimes, so I easily could have just missed it.

No you are right. I removed this one and renamed the other to rna_enum_snap_animation_element_items to indicate they are used in animation in general.

No you are right. I removed this one and renamed the other to `rna_enum_snap_animation_element_items` to indicate they are used in animation in general.
DEF_ENUM(rna_enum_curve_fit_method_items)
DEF_ENUM(rna_enum_mesh_select_mode_items)
DEF_ENUM(rna_enum_mesh_select_mode_uv_items)

View File

@ -201,14 +201,7 @@ const EnumPropertyItem rna_enum_snap_node_element_items[] = {
{0, nullptr, 0, nullptr, nullptr},
};
const EnumPropertyItem rna_enum_snap_graph_element_items[] = {
{SCE_SNAP_TO_FRAME, "FRAME", 0, "Frame", "Snap to frame"},
{SCE_SNAP_TO_SECOND, "SECOND", 0, "Second", "Snap to seconds"},
{SCE_SNAP_TO_MARKERS, "MARKER", 0, "Nearest Marker", "Snap to nearest marker"},
{0, nullptr, 0, nullptr, nullptr},
};
const EnumPropertyItem rna_enum_snap_action_element_items[] = {
const EnumPropertyItem rna_enum_snap_animation_element_items[] = {
{SCE_SNAP_TO_FRAME, "FRAME", 0, "Frame", "Snap to frame"},
{SCE_SNAP_TO_SECOND, "SECOND", 0, "Second", "Snap to seconds"},
{SCE_SNAP_TO_MARKERS, "MARKER", 0, "Nearest Marker", "Snap to nearest marker"},
@ -3472,7 +3465,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
prop = RNA_def_property(srna, "snap_anim_element", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, nullptr, "snap_anim_mode");
RNA_def_property_enum_items(prop, rna_enum_snap_graph_element_items);
RNA_def_property_enum_items(prop, rna_enum_snap_animation_element_items);
RNA_def_property_ui_text(prop, "Snap Anim Element", "Type of element to snap to");
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */