From 1cf11c75f7057b2fb4c184b9a7fccc75c5d55887 Mon Sep 17 00:00:00 2001 From: Christoph Lendenfeld Date: Thu, 26 Jan 2023 12:49:28 +0100 Subject: [PATCH 1/8] move settings to preferences --- release/scripts/addons | 2 +- release/scripts/startup/bl_ui/space_graph.py | 3 +- .../scripts/startup/bl_ui/space_userpref.py | 2 + .../blender/editors/animation/anim_filter.c | 2 +- .../blender/editors/space_graph/graph_draw.c | 10 +++-- .../editors/space_graph/graph_select.c | 45 +++++++++---------- .../blender/editors/space_graph/graph_view.c | 3 +- .../blender/editors/space_graph/space_graph.c | 2 +- source/blender/makesdna/DNA_space_types.h | 4 -- source/blender/makesdna/DNA_userdef_types.h | 2 + source/blender/makesrna/intern/rna_space.c | 13 ------ source/blender/makesrna/intern/rna_userdef.c | 16 +++++++ 12 files changed, 54 insertions(+), 50 deletions(-) diff --git a/release/scripts/addons b/release/scripts/addons index d887a4ea6b2..9958ddb8799 160000 --- a/release/scripts/addons +++ b/release/scripts/addons @@ -1 +1 @@ -Subproject commit d887a4ea6b2a9d64b926034d4e78ecf7a48ca979 +Subproject commit 9958ddb879934718cc2b379b556f0bc3b861bee5 diff --git a/release/scripts/startup/bl_ui/space_graph.py b/release/scripts/startup/bl_ui/space_graph.py index b2c8822a75d..102d2961a33 100644 --- a/release/scripts/startup/bl_ui/space_graph.py +++ b/release/scripts/startup/bl_ui/space_graph.py @@ -116,8 +116,7 @@ class GRAPH_MT_view(Menu): layout.prop(st, "show_handles") - layout.prop(st, "use_only_selected_curves_handles") - layout.prop(st, "use_only_selected_keyframe_handles") + # layout.prop(st, "use_only_selected_keyframe_handles") layout.prop(st, "show_seconds") layout.prop(st, "show_locked_time") diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index 38db569915c..5e0f4da4602 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -559,6 +559,8 @@ class USERPREF_PT_animation_fcurves(AnimationPanel, CenterAlignMixIn, Panel): flow.prop(edit, "keyframe_new_handle_type", text="Default Handles") flow.prop(edit, "use_insertkey_xyz_to_rgb", text="XYZ to RGB") flow.prop(edit, "use_anim_channel_group_colors") + flow.prop(edit, "show_only_selected_curve_keyframes") + flow.prop(edit, "show_only_selected_keyframe_handles") # ----------------------------------------------------------------------------- diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index f619837a3c5..e899d473a88 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -284,7 +284,7 @@ static bool graphedit_get_context(bAnimContext *ac, SpaceGraph *sipo) ac->ads = sipo->ads; /* set settings for Graph Editor - "Selected = Editable" */ - if (sipo->flag & SIPO_SELCUVERTSONLY) { + if (U.animation_flag & USER_ANIM_ONLY_SHOW_SELECTED_CURVE_KEYS) { sipo->ads->filterflag |= ADS_FILTER_SELEDIT; } else { diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index b2ee1c99139..c1bf770aed0 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -428,7 +428,7 @@ static void draw_fcurve_handles(SpaceGraph *sipo, FCurve *fcu) /* if only selected keyframes can get their handles shown, * check that keyframe is selected */ - if (sipo->flag & SIPO_SELVHANDLESONLY) { + if (U.animation_flag & USER_ANIM_ONLY_SHOW_SELECTED_KEY_HANDLES) { if (BEZT_ISSEL_ANY(bezt) == 0) { continue; } @@ -1117,7 +1117,8 @@ static void draw_fcurve(bAnimContext *ac, SpaceGraph *sipo, ARegion *region, bAn * - If the option to only show controls if the F-Curve is selected is enabled, * we must obey this. */ - if (!(sipo->flag & SIPO_SELCUVERTSONLY) || (fcu->flag & FCURVE_SELECTED)) { + if (!(U.animation_flag & USER_ANIM_ONLY_SHOW_SELECTED_CURVE_KEYS) || + (fcu->flag & FCURVE_SELECTED)) { if (!BKE_fcurve_are_keyframes_usable(fcu) && !(fcu->fpt && fcu->totvert)) { /* only draw controls if this is the active modifier */ if ((fcu->flag & FCURVE_ACTIVE) && (fcm)) { @@ -1151,7 +1152,10 @@ static void draw_fcurve(bAnimContext *ac, SpaceGraph *sipo, ARegion *region, bAn draw_fcurve_handles(sipo, fcu); } - draw_fcurve_vertices(region, fcu, do_handles, (sipo->flag & SIPO_SELVHANDLESONLY)); + draw_fcurve_vertices(region, + fcu, + do_handles, + (U.animation_flag & USER_ANIM_ONLY_SHOW_SELECTED_KEY_HANDLES)); } else { /* samples: only draw two indicators at either end as indicators */ diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c index 3265dcbf0d1..635bc943d5e 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -83,7 +83,7 @@ static bool fcurve_handle_sel_check(SpaceGraph *sipo, BezTriple *bezt) if (sipo->flag & SIPO_NOHANDLES) { return false; } - if ((sipo->flag & SIPO_SELVHANDLESONLY) && BEZT_ISSEL_ANY(bezt) == 0) { + if ((U.animation_flag & USER_ANIM_ONLY_SHOW_SELECTED_KEY_HANDLES) && BEZT_ISSEL_ANY(bezt) == 0) { return false; } return true; @@ -174,8 +174,9 @@ static void get_nearest_fcurve_verts_list(bAnimContext *ac, const int mval[2], L */ filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_CURVE_VISIBLE | ANIMFILTER_FCURVESONLY | ANIMFILTER_NODUPLIS | ANIMFILTER_FCURVESONLY); - if (sipo->flag & - SIPO_SELCUVERTSONLY) { /* FIXME: this should really be check for by the filtering code... */ + if (U.animation_flag & + USER_ANIM_ONLY_SHOW_SELECTED_CURVE_KEYS) { /* FIXME: this should really be check for by the + filtering code... */ filter |= ANIMFILTER_SEL; } mapping_flag |= ANIM_get_normalization_flags(ac); @@ -338,7 +339,6 @@ void deselect_graph_keys(bAnimContext *ac, bool test, short sel, bool do_channel bAnimListElem *ale; int filter; - SpaceGraph *sipo = (SpaceGraph *)ac->sl; KeyframeEditData ked = {{NULL}}; KeyframeEditFunc test_cb, sel_cb; @@ -376,7 +376,7 @@ void deselect_graph_keys(bAnimContext *ac, bool test, short sel, bool do_channel if (do_channels) { /* Only change selection of channel when the visibility of keyframes * doesn't depend on this. */ - if ((sipo->flag & SIPO_SELCUVERTSONLY) == 0) { + if ((U.animation_flag & USER_ANIM_ONLY_SHOW_SELECTED_CURVE_KEYS) == 0) { /* deactivate the F-Curve, and deselect if deselecting keyframes. * otherwise select the F-Curve too since we've selected all the keyframes */ @@ -498,11 +498,11 @@ static rctf initialize_box_select_coords(const bAnimContext *ac, const rctf *rec return rectf; } -static int initialize_animdata_selection_filter(const SpaceGraph *sipo) +static int initialize_animdata_selection_filter(void) { int filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_CURVE_VISIBLE | ANIMFILTER_FCURVESONLY | ANIMFILTER_NODUPLIS); - if (sipo->flag & SIPO_SELCUVERTSONLY) { + if (U.animation_flag & USER_ANIM_ONLY_SHOW_SELECTED_CURVE_KEYS) { filter |= ANIMFILTER_FOREDIT | ANIMFILTER_SELEDIT; } return filter; @@ -515,8 +515,7 @@ static ListBase initialize_box_select_anim_data(const int filter, bAnimContext * return anim_data; } -static void initialize_box_select_key_editing_data(const SpaceGraph *sipo, - const bool incl_handles, +static void initialize_box_select_key_editing_data(const bool incl_handles, const short mode, bAnimContext *ac, void *data, @@ -543,7 +542,7 @@ static void initialize_box_select_key_editing_data(const SpaceGraph *sipo, break; } - if (sipo->flag & SIPO_SELVHANDLESONLY) { + if (U.animation_flag & USER_ANIM_ONLY_SHOW_SELECTED_KEY_HANDLES) { r_ked->iterflags |= KEYFRAME_ITER_HANDLES_DEFAULT_INVISIBLE; } @@ -576,14 +575,13 @@ static bool box_select_graphkeys(bAnimContext *ac, void *data) { const rctf rectf = initialize_box_select_coords(ac, rectf_view); - SpaceGraph *sipo = (SpaceGraph *)ac->sl; - const int filter = initialize_animdata_selection_filter(sipo); + const int filter = initialize_animdata_selection_filter(); ListBase anim_data = initialize_box_select_anim_data(filter, ac); rctf scaled_rectf; KeyframeEditData ked; int mapping_flag; initialize_box_select_key_editing_data( - sipo, incl_handles, mode, ac, data, &scaled_rectf, &ked, &mapping_flag); + incl_handles, mode, ac, data, &scaled_rectf, &ked, &mapping_flag); /* Get beztriple editing/validation functions. */ const KeyframeEditFunc select_cb = ANIM_editkeyframes_select(selectmode); @@ -635,7 +633,7 @@ static bool box_select_graphkeys(bAnimContext *ac, any_key_selection_changed = true; /* Only change selection of channel when the visibility of keyframes * doesn't depend on this. */ - if ((sipo->flag & SIPO_SELCUVERTSONLY) == 0) { + if ((U.animation_flag & USER_ANIM_ONLY_SHOW_SELECTED_CURVE_KEYS) == 0) { /* select the curve too now that curve will be touched */ if (selectmode == SELECT_ADD) { fcu->flag |= FCURVE_SELECTED; @@ -735,14 +733,13 @@ static void box_select_graphcurves(bAnimContext *ac, const bool incl_handles, void *data) { - const SpaceGraph *sipo = (SpaceGraph *)ac->sl; - const int filter = initialize_animdata_selection_filter(sipo); + const int filter = initialize_animdata_selection_filter(); ListBase anim_data = initialize_box_select_anim_data(filter, ac); rctf scaled_rectf; KeyframeEditData ked; int mapping_flag; initialize_box_select_key_editing_data( - sipo, incl_handles, mode, ac, data, &scaled_rectf, &ked, &mapping_flag); + incl_handles, mode, ac, data, &scaled_rectf, &ked, &mapping_flag); FCurve *last_selected_curve = NULL; @@ -955,7 +952,8 @@ static int graphkeys_lassoselect_exec(bContext *C, wmOperator *op) { SpaceGraph *sipo = (SpaceGraph *)ac.sl; if (selectmode == SELECT_ADD) { - incl_handles = ((sipo->flag & SIPO_SELVHANDLESONLY) || (sipo->flag & SIPO_NOHANDLES)) == 0; + incl_handles = ((U.animation_flag & USER_ANIM_ONLY_SHOW_SELECTED_KEY_HANDLES) || + (sipo->flag & SIPO_NOHANDLES)) == 0; } else { incl_handles = (sipo->flag & SIPO_NOHANDLES) == 0; @@ -1051,7 +1049,8 @@ static int graph_circle_select_exec(bContext *C, wmOperator *op) { SpaceGraph *sipo = (SpaceGraph *)ac.sl; if (selectmode == SELECT_ADD) { - incl_handles = ((sipo->flag & SIPO_SELVHANDLESONLY) || (sipo->flag & SIPO_NOHANDLES)) == 0; + incl_handles = ((U.animation_flag & USER_ANIM_ONLY_SHOW_SELECTED_KEY_HANDLES) || + (sipo->flag & SIPO_NOHANDLES)) == 0; } else { incl_handles = (sipo->flag & SIPO_NOHANDLES) == 0; @@ -1709,7 +1708,7 @@ static int mouse_graph_keys(bAnimContext *ac, /* Deselect other channels too, but only do this if selection of channel * when the visibility of keyframes doesn't depend on this. */ - if ((sipo->flag & SIPO_SELCUVERTSONLY) == 0) { + if ((U.animation_flag & USER_ANIM_ONLY_SHOW_SELECTED_CURVE_KEYS) == 0) { ANIM_anim_channels_select_set(ac, ACHANNEL_SETFLAG_CLEAR); } } @@ -1782,7 +1781,7 @@ static int mouse_graph_keys(bAnimContext *ac, } /* only change selection of channel when the visibility of keyframes doesn't depend on this */ - if ((sipo->flag & SIPO_SELCUVERTSONLY) == 0) { + if ((U.animation_flag & USER_ANIM_ONLY_SHOW_SELECTED_CURVE_KEYS) == 0) { /* select or deselect curve? */ if (bezt) { /* take selection status from item that got hit, to prevent flip/flop on channel @@ -1808,8 +1807,8 @@ static int mouse_graph_keys(bAnimContext *ac, } /* Set active F-Curve when something was actually selected (so not on a deselect), except when - * dragging the selected keys. Needs to be called with (sipo->flag & SIPO_SELCUVERTSONLY), - * otherwise the active flag won't be set T26452. */ + * dragging the selected keys. Needs to be called with (U.animation_flag & + * USER_ANIM_ONLY_SHOW_SELECTED_CURVE_KEYS), otherwise the active flag won't be set T26452. */ if (!run_modal && (nvi->fcu->flag & FCURVE_SELECTED) && something_was_selected) { /* NOTE: Sync the filter flags with findnearest_fcurve_vert. */ int filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_CURVE_VISIBLE | ANIMFILTER_FCURVESONLY | diff --git a/source/blender/editors/space_graph/graph_view.c b/source/blender/editors/space_graph/graph_view.c index f80c7c17c3a..f60e96f4362 100644 --- a/source/blender/editors/space_graph/graph_view.c +++ b/source/blender/editors/space_graph/graph_view.c @@ -49,7 +49,6 @@ void get_graph_keyframe_extents(bAnimContext *ac, const bool include_handles) { Scene *scene = ac->scene; - SpaceGraph *sipo = (SpaceGraph *)ac->sl; ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; @@ -58,7 +57,7 @@ void get_graph_keyframe_extents(bAnimContext *ac, /* Get data to filter, from Dopesheet. */ filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_CURVE_VISIBLE | ANIMFILTER_FCURVESONLY | ANIMFILTER_NODUPLIS); - if (sipo->flag & SIPO_SELCUVERTSONLY) { + if (U.animation_flag & USER_ANIM_ONLY_SHOW_SELECTED_CURVE_KEYS) { filter |= ANIMFILTER_SEL; } diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c index 1dc02fee59d..12739f2b1ca 100644 --- a/source/blender/editors/space_graph/space_graph.c +++ b/source/blender/editors/space_graph/space_graph.c @@ -68,7 +68,7 @@ static SpaceLink *graph_create(const ScrArea *UNUSED(area), const Scene *scene) /* settings for making it easier by default to just see what you're interested in tweaking */ sipo->ads->filterflag |= ADS_FILTER_ONLYSEL; - sipo->flag |= SIPO_SELVHANDLESONLY | SIPO_SHOW_MARKERS; + sipo->flag |= SIPO_SHOW_MARKERS; /* header */ region = MEM_callocN(sizeof(ARegion), "header for graphedit"); diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 54edf795e6c..33464c18947 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -484,8 +484,6 @@ typedef enum eGraphEdit_Flag { /* SIPO_NODRAWCFRANUM = (1 << 3), DEPRECATED */ /* show timing in seconds instead of frames */ SIPO_DRAWTIME = (1 << 4), - /* only show keyframes for selected F-Curves */ - SIPO_SELCUVERTSONLY = (1 << 5), /* draw names of F-Curves beside the respective curves */ /* NOTE: currently not used */ /* SIPO_DRAWNAMES = (1 << 6), */ /* UNUSED */ @@ -493,8 +491,6 @@ typedef enum eGraphEdit_Flag { SIPO_SLIDERS = (1 << 7), /* don't show the horizontal component of the cursor */ SIPO_NODRAWCURSOR = (1 << 8), - /* only show handles of selected keyframes */ - SIPO_SELVHANDLESONLY = (1 << 9), /* don't perform realtime updates */ SIPO_NOREALTIMEUPDATES = (1 << 11), /* don't draw curves with AA ("beauty-draw") for performance */ diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index d33272183bb..bea9b00fdfc 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -1213,6 +1213,8 @@ typedef enum eAutokey_Flag { */ typedef enum eUserpref_Anim_Flags { USER_ANIM_SHOW_CHANNEL_GROUP_COLORS = (1 << 0), + USER_ANIM_ONLY_SHOW_SELECTED_CURVE_KEYS = (1 << 1), + USER_ANIM_ONLY_SHOW_SELECTED_KEY_HANDLES = (1 << 2), } eUserpref_Anim_Flags; /** #UserDef.transopts */ diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 38625c7416a..b5935fb4536 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -6297,19 +6297,6 @@ static void rna_def_space_graph(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Show Handles", "Show handles of Bezier control points"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL); - prop = RNA_def_property(srna, "use_only_selected_curves_handles", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SELCUVERTSONLY); - RNA_def_property_ui_text(prop, - "Only Selected Curve Keyframes", - "Only keyframes of selected F-Curves are visible and editable"); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL); - - prop = RNA_def_property(srna, "use_only_selected_keyframe_handles", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SELVHANDLESONLY); - RNA_def_property_ui_text( - prop, "Only Selected Keyframes Handles", "Only show and edit handles of selected keyframes"); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL); - prop = RNA_def_property(srna, "use_beauty_drawing", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_BEAUTYDRAW_OFF); RNA_def_property_ui_text(prop, diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index ca2e2e436c3..d6d5cddb45f 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -5132,6 +5132,22 @@ static void rna_def_userdef_edit(BlenderRNA *brna) "background of the Graph Editor"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL); + /* FCurve keyframe visibility. */ + prop = RNA_def_property(srna, "show_only_selected_curve_keyframes", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna( + prop, NULL, "animation_flag", USER_ANIM_ONLY_SHOW_SELECTED_CURVE_KEYS); + RNA_def_property_ui_text(prop, + "Only Show Selected F-Curve Keyframes", + "Only keyframes of selected F-Curves are visible and editable"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL); + + prop = RNA_def_property(srna, "show_only_selected_keyframe_handles", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "animation_flag", USER_ANIM_ONLY_SHOW_SELECTED_KEY_HANDLES); + RNA_def_property_ui_text(prop, + "Only Show Selected Keyframes Handles", + "Only show and edit handles of selected keyframes"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL); + /* grease pencil */ prop = RNA_def_property(srna, "grease_pencil_manhattan_distance", PROP_INT, PROP_PIXEL); RNA_def_property_int_sdna(prop, NULL, "gp_manhattandist"); -- 2.30.2 From a1e15d0b01f775f3b69e5f6495cd29252e76bc57 Mon Sep 17 00:00:00 2001 From: Christoph Lendenfeld Date: Thu, 26 Jan 2023 13:03:54 +0100 Subject: [PATCH 2/8] remove comment --- release/scripts/startup/bl_ui/space_graph.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/release/scripts/startup/bl_ui/space_graph.py b/release/scripts/startup/bl_ui/space_graph.py index 102d2961a33..9859191d1a4 100644 --- a/release/scripts/startup/bl_ui/space_graph.py +++ b/release/scripts/startup/bl_ui/space_graph.py @@ -116,8 +116,6 @@ class GRAPH_MT_view(Menu): layout.prop(st, "show_handles") - # layout.prop(st, "use_only_selected_keyframe_handles") - layout.prop(st, "show_seconds") layout.prop(st, "show_locked_time") -- 2.30.2 From 8828733b43c97727323d033a5d6b1c401bbb4b45 Mon Sep 17 00:00:00 2001 From: Christoph Lendenfeld Date: Thu, 16 Feb 2023 17:54:21 +0100 Subject: [PATCH 3/8] move "use_only_selected_keyframe_handles" back to view settings --- release/scripts/startup/bl_ui/space_graph.py | 1 + release/scripts/startup/bl_ui/space_userpref.py | 1 - source/blender/editors/space_graph/graph_draw.c | 7 ++----- source/blender/editors/space_graph/graph_select.c | 12 +++++------- source/blender/makesdna/DNA_space_types.h | 2 ++ source/blender/makesdna/DNA_userdef_types.h | 1 - source/blender/makesrna/intern/rna_space.c | 6 ++++++ source/blender/makesrna/intern/rna_userdef.c | 7 ------- 8 files changed, 16 insertions(+), 21 deletions(-) diff --git a/release/scripts/startup/bl_ui/space_graph.py b/release/scripts/startup/bl_ui/space_graph.py index 2c811d7d3f2..fbe816bdaec 100644 --- a/release/scripts/startup/bl_ui/space_graph.py +++ b/release/scripts/startup/bl_ui/space_graph.py @@ -115,6 +115,7 @@ class GRAPH_MT_view(Menu): layout.prop(st, "show_extrapolation") layout.prop(st, "show_handles") + layout.prop(st, "use_only_selected_keyframe_handles") layout.prop(st, "show_seconds") layout.prop(st, "show_locked_time") diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index 803f83df524..9696e09827c 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -560,7 +560,6 @@ class USERPREF_PT_animation_fcurves(AnimationPanel, CenterAlignMixIn, Panel): flow.prop(edit, "use_insertkey_xyz_to_rgb", text="XYZ to RGB") flow.prop(edit, "use_anim_channel_group_colors") flow.prop(edit, "show_only_selected_curve_keyframes") - flow.prop(edit, "show_only_selected_keyframe_handles") # ----------------------------------------------------------------------------- diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index 900206ff654..424cb65f7e6 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -425,7 +425,7 @@ static void draw_fcurve_handles(SpaceGraph *sipo, FCurve *fcu) /* if only selected keyframes can get their handles shown, * check that keyframe is selected */ - if (U.animation_flag & USER_ANIM_ONLY_SHOW_SELECTED_KEY_HANDLES) { + if (sipo->flag & SIPO_SELVHANDLESONLY) { if (BEZT_ISSEL_ANY(bezt) == 0) { continue; } @@ -1150,10 +1150,7 @@ static void draw_fcurve(bAnimContext *ac, SpaceGraph *sipo, ARegion *region, bAn draw_fcurve_handles(sipo, fcu); } - draw_fcurve_vertices(region, - fcu, - do_handles, - (U.animation_flag & USER_ANIM_ONLY_SHOW_SELECTED_KEY_HANDLES)); + draw_fcurve_vertices(region, fcu, do_handles, (sipo->flag & SIPO_SELVHANDLESONLY)); } else { /* samples: only draw two indicators at either end as indicators */ diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c index 1fd0feaf453..d89fa2b9d6c 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -83,7 +83,7 @@ static bool fcurve_handle_sel_check(SpaceGraph *sipo, BezTriple *bezt) if (sipo->flag & SIPO_NOHANDLES) { return false; } - if ((U.animation_flag & USER_ANIM_ONLY_SHOW_SELECTED_KEY_HANDLES) && BEZT_ISSEL_ANY(bezt) == 0) { + if ((sipo->flag & SIPO_SELVHANDLESONLY) && BEZT_ISSEL_ANY(bezt) == 0) { return false; } return true; @@ -541,8 +541,8 @@ static void initialize_box_select_key_editing_data(const bool incl_handles, r_ked->data = scaled_rectf; break; } - - if (U.animation_flag & USER_ANIM_ONLY_SHOW_SELECTED_KEY_HANDLES) { + SpaceGraph *sipo = (SpaceGraph *)ac->sl; + if (sipo->flag & SIPO_SELVHANDLESONLY) { r_ked->iterflags |= KEYFRAME_ITER_HANDLES_DEFAULT_INVISIBLE; } @@ -952,8 +952,7 @@ static int graphkeys_lassoselect_exec(bContext *C, wmOperator *op) { SpaceGraph *sipo = (SpaceGraph *)ac.sl; if (selectmode == SELECT_ADD) { - incl_handles = ((U.animation_flag & USER_ANIM_ONLY_SHOW_SELECTED_KEY_HANDLES) || - (sipo->flag & SIPO_NOHANDLES)) == 0; + incl_handles = ((sipo->flag & SIPO_SELVHANDLESONLY) || (sipo->flag & SIPO_NOHANDLES)) == 0; } else { incl_handles = (sipo->flag & SIPO_NOHANDLES) == 0; @@ -1049,8 +1048,7 @@ static int graph_circle_select_exec(bContext *C, wmOperator *op) { SpaceGraph *sipo = (SpaceGraph *)ac.sl; if (selectmode == SELECT_ADD) { - incl_handles = ((U.animation_flag & USER_ANIM_ONLY_SHOW_SELECTED_KEY_HANDLES) || - (sipo->flag & SIPO_NOHANDLES)) == 0; + incl_handles = ((sipo->flag & SIPO_SELVHANDLESONLY) || (sipo->flag & SIPO_NOHANDLES)) == 0; } else { incl_handles = (sipo->flag & SIPO_NOHANDLES) == 0; diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 9e02148beb9..e0bd5715714 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -492,6 +492,8 @@ typedef enum eGraphEdit_Flag { SIPO_SLIDERS = (1 << 7), /* don't show the horizontal component of the cursor */ SIPO_NODRAWCURSOR = (1 << 8), + /* only show handles of selected keyframes */ + SIPO_SELVHANDLESONLY = (1 << 9), /* don't perform realtime updates */ SIPO_NOREALTIMEUPDATES = (1 << 11), /* don't draw curves with AA ("beauty-draw") for performance */ diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 2c2230bf9da..aef2a7d57d7 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -1221,7 +1221,6 @@ typedef enum eAutokey_Flag { typedef enum eUserpref_Anim_Flags { USER_ANIM_SHOW_CHANNEL_GROUP_COLORS = (1 << 0), USER_ANIM_ONLY_SHOW_SELECTED_CURVE_KEYS = (1 << 1), - USER_ANIM_ONLY_SHOW_SELECTED_KEY_HANDLES = (1 << 2), } eUserpref_Anim_Flags; /** #UserDef.transopts */ diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index dd8cd130320..4a0f0e0a37b 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -6310,6 +6310,12 @@ static void rna_def_space_graph(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Show Handles", "Show handles of Bezier control points"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL); + prop = RNA_def_property(srna, "use_only_selected_keyframe_handles", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SELVHANDLESONLY); + RNA_def_property_ui_text( + prop, "Only Selected Keyframes Handles", "Only show and edit handles of selected keyframes"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL); + prop = RNA_def_property(srna, "use_beauty_drawing", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_BEAUTYDRAW_OFF); RNA_def_property_ui_text(prop, diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 77940c8eb25..cad752c0317 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -5155,13 +5155,6 @@ static void rna_def_userdef_edit(BlenderRNA *brna) "Only keyframes of selected F-Curves are visible and editable"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL); - prop = RNA_def_property(srna, "show_only_selected_keyframe_handles", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "animation_flag", USER_ANIM_ONLY_SHOW_SELECTED_KEY_HANDLES); - RNA_def_property_ui_text(prop, - "Only Show Selected Keyframes Handles", - "Only show and edit handles of selected keyframes"); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL); - /* grease pencil */ prop = RNA_def_property(srna, "grease_pencil_manhattan_distance", PROP_INT, PROP_PIXEL); RNA_def_property_int_sdna(prop, NULL, "gp_manhattandist"); -- 2.30.2 From 73cff751ee0a2edfee4d919a0583119ea0423e08 Mon Sep 17 00:00:00 2001 From: Christoph Lendenfeld Date: Thu, 23 Feb 2023 11:40:11 +0100 Subject: [PATCH 4/8] move "high quality drawing to user prefs" --- release/datafiles/userdef/userdef_default.c | 1 + scripts/startup/bl_ui/space_graph.py | 5 ---- scripts/startup/bl_ui/space_userpref.py | 1 + .../blender/editors/space_graph/graph_draw.c | 23 +++++++++---------- source/blender/makesdna/DNA_space_types.h | 2 -- source/blender/makesdna/DNA_userdef_types.h | 1 + source/blender/makesrna/intern/rna_space.c | 8 ------- source/blender/makesrna/intern/rna_userdef.c | 9 ++++++++ 8 files changed, 23 insertions(+), 27 deletions(-) diff --git a/release/datafiles/userdef/userdef_default.c b/release/datafiles/userdef/userdef_default.c index cbcd99d4b3f..fdd648ab110 100644 --- a/release/datafiles/userdef/userdef_default.c +++ b/release/datafiles/userdef/userdef_default.c @@ -157,6 +157,7 @@ const UserDef U_default = { .glalphaclip = 0.004, .autokey_mode = (AUTOKEY_MODE_NORMAL & ~AUTOKEY_ON), .autokey_flag = AUTOKEY_FLAG_XYZ2RGB, + .animation_flag = USER_ANIM_HIGH_QUALITY_DRAWING, .text_render = 0, .navigation_mode = VIEW_NAVIGATION_WALK, .view_rotate_sensitivity_turntable = DEG2RAD(0.4), diff --git a/scripts/startup/bl_ui/space_graph.py b/scripts/startup/bl_ui/space_graph.py index c4ca961c642..9f016f0dfc3 100644 --- a/scripts/startup/bl_ui/space_graph.py +++ b/scripts/startup/bl_ui/space_graph.py @@ -107,11 +107,6 @@ class GRAPH_MT_view(Menu): layout.separator() layout.prop(st, "show_markers") - layout.separator() - layout.prop(st, "use_beauty_drawing") - - layout.separator() - layout.prop(st, "show_extrapolation") layout.prop(st, "show_handles") diff --git a/scripts/startup/bl_ui/space_userpref.py b/scripts/startup/bl_ui/space_userpref.py index 9696e09827c..87205ea3c1a 100644 --- a/scripts/startup/bl_ui/space_userpref.py +++ b/scripts/startup/bl_ui/space_userpref.py @@ -560,6 +560,7 @@ class USERPREF_PT_animation_fcurves(AnimationPanel, CenterAlignMixIn, Panel): flow.prop(edit, "use_insertkey_xyz_to_rgb", text="XYZ to RGB") flow.prop(edit, "use_anim_channel_group_colors") flow.prop(edit, "show_only_selected_curve_keyframes") + flow.prop(edit, "fcurve_high_quality_drawing") # ----------------------------------------------------------------------------- diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index 424cb65f7e6..e232f37d45c 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -406,7 +406,7 @@ static void draw_fcurve_handles(SpaceGraph *sipo, FCurve *fcu) uint color = GPU_vertformat_attr_add( format, "color", GPU_COMP_U8, 4, GPU_FETCH_INT_TO_FLOAT_UNIT); immBindBuiltinProgram(GPU_SHADER_3D_FLAT_COLOR); - if ((sipo->flag & SIPO_BEAUTYDRAW_OFF) == 0) { + if (U.animation_flag & USER_ANIM_HIGH_QUALITY_DRAWING) { GPU_line_smooth(true); } GPU_blend(GPU_BLEND_ALPHA); @@ -482,7 +482,7 @@ static void draw_fcurve_handles(SpaceGraph *sipo, FCurve *fcu) immEnd(); immUnbindProgram(); GPU_blend(GPU_BLEND_NONE); - if ((sipo->flag & SIPO_BEAUTYDRAW_OFF) == 0) { + if (U.animation_flag & USER_ANIM_HIGH_QUALITY_DRAWING) { GPU_line_smooth(false); } } @@ -515,7 +515,7 @@ static void draw_fcurve_sample_control( } /* helper func - draw keyframe vertices only for an F-Curve */ -static void draw_fcurve_samples(SpaceGraph *sipo, ARegion *region, FCurve *fcu) +static void draw_fcurve_samples(ARegion *region, FCurve *fcu) { FPoint *first, *last; float hsize, xscale, yscale; @@ -531,7 +531,7 @@ static void draw_fcurve_samples(SpaceGraph *sipo, ARegion *region, FCurve *fcu) /* draw */ if (first && last) { /* anti-aliased lines for more consistent appearance */ - if ((sipo->flag & SIPO_BEAUTYDRAW_OFF) == 0) { + if (U.animation_flag & USER_ANIM_HIGH_QUALITY_DRAWING) { GPU_line_smooth(true); } GPU_blend(GPU_BLEND_ALPHA); @@ -547,7 +547,7 @@ static void draw_fcurve_samples(SpaceGraph *sipo, ARegion *region, FCurve *fcu) immUnbindProgram(); GPU_blend(GPU_BLEND_NONE); - if ((sipo->flag & SIPO_BEAUTYDRAW_OFF) == 0) { + if (U.animation_flag & USER_ANIM_HIGH_QUALITY_DRAWING) { GPU_line_smooth(false); } } @@ -565,7 +565,6 @@ static void draw_fcurve_curve(bAnimContext *ac, const bool use_nla_remap, const bool draw_extrapolation) { - SpaceGraph *sipo = (SpaceGraph *)ac->sl; short mapping_flag = ANIM_get_normalization_flags(ac); /* when opening a blend file on a different sized screen or while dragging the toolbar this can @@ -601,7 +600,7 @@ static void draw_fcurve_curve(bAnimContext *ac, float pixels_per_sample = 1.5f; float samplefreq = pixels_per_sample / UI_view2d_scale_get_x(v2d); - if (sipo->flag & SIPO_BEAUTYDRAW_OFF) { + if (!(U.animation_flag & USER_ANIM_HIGH_QUALITY_DRAWING)) { /* Low Precision = coarse lower-bound clamping * * Although the "Beauty Draw" flag was originally for AA'd @@ -1030,7 +1029,7 @@ static void draw_fcurve(bAnimContext *ac, SpaceGraph *sipo, ARegion *region, bAn } /* anti-aliased lines for less jagged appearance */ - if ((sipo->flag & SIPO_BEAUTYDRAW_OFF) == 0) { + if (U.animation_flag & USER_ANIM_HIGH_QUALITY_DRAWING) { GPU_line_smooth(true); } GPU_blend(GPU_BLEND_ALPHA); @@ -1105,7 +1104,7 @@ static void draw_fcurve(bAnimContext *ac, SpaceGraph *sipo, ARegion *region, bAn immUnbindProgram(); - if ((sipo->flag & SIPO_BEAUTYDRAW_OFF) == 0) { + if (U.animation_flag & USER_ANIM_HIGH_QUALITY_DRAWING) { GPU_line_smooth(false); } GPU_blend(GPU_BLEND_NONE); @@ -1154,7 +1153,7 @@ static void draw_fcurve(bAnimContext *ac, SpaceGraph *sipo, ARegion *region, bAn } else { /* samples: only draw two indicators at either end as indicators */ - draw_fcurve_samples(sipo, region, fcu); + draw_fcurve_samples(region, fcu); } GPU_matrix_pop(); @@ -1301,7 +1300,7 @@ void graph_draw_ghost_curves(bAnimContext *ac, SpaceGraph *sipo, ARegion *region GPU_line_width(3.0f); /* anti-aliased lines for less jagged appearance */ - if ((sipo->flag & SIPO_BEAUTYDRAW_OFF) == 0) { + if (U.animation_flag & USER_ANIM_HIGH_QUALITY_DRAWING) { GPU_line_smooth(true); } GPU_blend(GPU_BLEND_ALPHA); @@ -1334,7 +1333,7 @@ void graph_draw_ghost_curves(bAnimContext *ac, SpaceGraph *sipo, ARegion *region immUnbindProgram(); - if ((sipo->flag & SIPO_BEAUTYDRAW_OFF) == 0) { + if (U.animation_flag & USER_ANIM_HIGH_QUALITY_DRAWING) { GPU_line_smooth(false); } GPU_blend(GPU_BLEND_NONE); diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index e0bd5715714..a292a56bc00 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -496,8 +496,6 @@ typedef enum eGraphEdit_Flag { SIPO_SELVHANDLESONLY = (1 << 9), /* don't perform realtime updates */ SIPO_NOREALTIMEUPDATES = (1 << 11), - /* don't draw curves with AA ("beauty-draw") for performance */ - SIPO_BEAUTYDRAW_OFF = (1 << 12), /* draw grouped channels with colors set in group */ /* SIPO_NODRAWGCOLORS = (1 << 13), DEPRECATED */ /* normalize curves on display */ diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index d3be9880631..6e6cc6f779c 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -1221,6 +1221,7 @@ typedef enum eAutokey_Flag { typedef enum eUserpref_Anim_Flags { USER_ANIM_SHOW_CHANNEL_GROUP_COLORS = (1 << 0), USER_ANIM_ONLY_SHOW_SELECTED_CURVE_KEYS = (1 << 1), + USER_ANIM_HIGH_QUALITY_DRAWING = (1 << 2), } eUserpref_Anim_Flags; /** #UserDef.transopts */ diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 4a0f0e0a37b..ed7c2921c18 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -6316,14 +6316,6 @@ static void rna_def_space_graph(BlenderRNA *brna) prop, "Only Selected Keyframes Handles", "Only show and edit handles of selected keyframes"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL); - prop = RNA_def_property(srna, "use_beauty_drawing", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_BEAUTYDRAW_OFF); - RNA_def_property_ui_text(prop, - "Use High Quality Display", - "Display F-Curves using Anti-Aliasing and other fancy effects " - "(disable for better performance)"); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL); - prop = RNA_def_property(srna, "show_markers", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SHOW_MARKERS); RNA_def_property_ui_text( diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index cad752c0317..b7d024c4b96 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -5155,6 +5155,15 @@ static void rna_def_userdef_edit(BlenderRNA *brna) "Only keyframes of selected F-Curves are visible and editable"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL); + /* Graph Editor line drawing quality. */ + prop = RNA_def_property(srna, "fcurve_high_quality_drawing", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "animation_flag", USER_ANIM_HIGH_QUALITY_DRAWING); + RNA_def_property_ui_text(prop, + "FCurve High Quality Display", + "Display F-Curves using Anti-Aliasing and other fancy effects " + "(disable for better performance)"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL); + /* grease pencil */ prop = RNA_def_property(srna, "grease_pencil_manhattan_distance", PROP_INT, PROP_PIXEL); RNA_def_property_int_sdna(prop, NULL, "gp_manhattandist"); -- 2.30.2 From 44e4dbe09514d60c28cfad571f9223d6beb01d29 Mon Sep 17 00:00:00 2001 From: Christoph Lendenfeld Date: Thu, 2 Mar 2023 13:27:53 +0100 Subject: [PATCH 5/8] add versioning code --- source/blender/blenloader/intern/versioning_userdef.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c index 4b2acfa7205..fc34a7cea72 100644 --- a/source/blender/blenloader/intern/versioning_userdef.c +++ b/source/blender/blenloader/intern/versioning_userdef.c @@ -794,6 +794,7 @@ void blo_do_versions_userdef(UserDef *userdef) */ { /* Keep this block, even when empty. */ + userdef->animation_flag |= USER_ANIM_HIGH_QUALITY_DRAWING; } LISTBASE_FOREACH (bTheme *, btheme, &userdef->themes) { -- 2.30.2 From fd30ab4e46a7bad4cdabef55552ec749b47a7580 Mon Sep 17 00:00:00 2001 From: Christoph Lendenfeld Date: Fri, 3 Mar 2023 16:19:47 +0100 Subject: [PATCH 6/8] add hyphen to F-Curve --- source/blender/makesrna/intern/rna_userdef.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 9b7921022e8..bdc51e770e4 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -5183,7 +5183,7 @@ static void rna_def_userdef_edit(BlenderRNA *brna) prop = RNA_def_property(srna, "fcurve_high_quality_drawing", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "animation_flag", USER_ANIM_HIGH_QUALITY_DRAWING); RNA_def_property_ui_text(prop, - "FCurve High Quality Display", + "F-Curve High Quality Display", "Display F-Curves using Anti-Aliasing and other fancy effects " "(disable for better performance)"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL); -- 2.30.2 From 69afd15465eb79d4d232188f80dcf074adf60802 Mon Sep 17 00:00:00 2001 From: Christoph Lendenfeld Date: Fri, 3 Mar 2023 16:43:54 +0100 Subject: [PATCH 7/8] implement pablos comments --- scripts/startup/bl_ui/space_userpref.py | 2 +- source/blender/makesrna/intern/rna_userdef.c | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/startup/bl_ui/space_userpref.py b/scripts/startup/bl_ui/space_userpref.py index 87205ea3c1a..da738a7fc15 100644 --- a/scripts/startup/bl_ui/space_userpref.py +++ b/scripts/startup/bl_ui/space_userpref.py @@ -560,7 +560,7 @@ class USERPREF_PT_animation_fcurves(AnimationPanel, CenterAlignMixIn, Panel): flow.prop(edit, "use_insertkey_xyz_to_rgb", text="XYZ to RGB") flow.prop(edit, "use_anim_channel_group_colors") flow.prop(edit, "show_only_selected_curve_keyframes") - flow.prop(edit, "fcurve_high_quality_drawing") + flow.prop(edit, "use_fcurve_high_quality_drawing") # ----------------------------------------------------------------------------- diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index bdc51e770e4..7c91bc45cf9 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -5180,12 +5180,11 @@ static void rna_def_userdef_edit(BlenderRNA *brna) RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL); /* Graph Editor line drawing quality. */ - prop = RNA_def_property(srna, "fcurve_high_quality_drawing", PROP_BOOLEAN, PROP_NONE); + prop = RNA_def_property(srna, "use_fcurve_high_quality_drawing", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "animation_flag", USER_ANIM_HIGH_QUALITY_DRAWING); RNA_def_property_ui_text(prop, - "F-Curve High Quality Display", - "Display F-Curves using Anti-Aliasing and other fancy effects " - "(disable for better performance)"); + "F-Curve High Quality Drawing", + "Draw F-Curves using Anti-Aliasing (disable for better performance)"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL); /* grease pencil */ -- 2.30.2 From cb5b1d86face753fbd63112ea7233b38df8c81d9 Mon Sep 17 00:00:00 2001 From: Christoph Lendenfeld Date: Thu, 9 Mar 2023 10:28:13 +0100 Subject: [PATCH 8/8] move versioning code --- source/blender/blenkernel/BKE_blender_version.h | 2 +- source/blender/blenloader/intern/versioning_userdef.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h index 6f33219c7f6..e7888c0d3dc 100644 --- a/source/blender/blenkernel/BKE_blender_version.h +++ b/source/blender/blenkernel/BKE_blender_version.h @@ -25,7 +25,7 @@ extern "C" { /* Blender file format version. */ #define BLENDER_FILE_VERSION BLENDER_VERSION -#define BLENDER_FILE_SUBVERSION 1 +#define BLENDER_FILE_SUBVERSION 2 /* Minimum Blender version that supports reading file written with the current * version. Older Blender versions will test this and show a warning if the file diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c index fc34a7cea72..cfb3a4e5043 100644 --- a/source/blender/blenloader/intern/versioning_userdef.c +++ b/source/blender/blenloader/intern/versioning_userdef.c @@ -783,6 +783,10 @@ void blo_do_versions_userdef(UserDef *userdef) } } + if (!USER_VERSION_ATLEAST(306, 2)) { + userdef->animation_flag |= USER_ANIM_HIGH_QUALITY_DRAWING; + } + /** * Versioning code until next subversion bump goes here. * @@ -794,7 +798,6 @@ void blo_do_versions_userdef(UserDef *userdef) */ { /* Keep this block, even when empty. */ - userdef->animation_flag |= USER_ANIM_HIGH_QUALITY_DRAWING; } LISTBASE_FOREACH (bTheme *, btheme, &userdef->themes) { -- 2.30.2