diff options
-rw-r--r-- | release/datafiles/userdef/userdef_default.c | 2 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_userpref.py | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/BKE_blender_version.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/nla.c | 4 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_userdef.c | 14 | ||||
-rw-r--r-- | source/blender/collada/AnimationImporter.cpp | 2 | ||||
-rw-r--r-- | source/blender/collada/BCAnimationCurve.cpp | 2 | ||||
-rw-r--r-- | source/blender/editors/animation/drivers.c | 2 | ||||
-rw-r--r-- | source/blender/editors/animation/keyframing.c | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_userdef_types.h | 4 | ||||
-rw-r--r-- | source/blender/makesrna/RNA_enum_types.h | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_fcurve.c | 31 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 7 |
13 files changed, 48 insertions, 26 deletions
diff --git a/release/datafiles/userdef/userdef_default.c b/release/datafiles/userdef/userdef_default.c index 7785c9d2962..dc35187ab7e 100644 --- a/release/datafiles/userdef/userdef_default.c +++ b/release/datafiles/userdef/userdef_default.c @@ -22,6 +22,7 @@ #include "DNA_userdef_types.h" #include "DNA_curve_types.h" #include "DNA_space_types.h" +#include "DNA_anim_types.h" #include "BLI_math_rotation.h" @@ -138,6 +139,7 @@ const UserDef U_default = { .glreslimit = 0, .curssize = 0, .color_picker_type = USER_CP_CIRCLE_HSV, + .auto_smoothing_new = FCURVE_SMOOTH_CONT_ACCEL, .ipo_new = BEZT_IPO_BEZ, .keyhandles_new = HD_AUTO_ANIM, .view_frame_type = ZOOM_FRAME_MODE_KEEP_RANGE, diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index 8ccd8b57357..4c90f987c50 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -569,6 +569,7 @@ class USERPREF_PT_animation_fcurves(PreferencePanel, Panel): flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False) flow.prop(edit, "fcurve_unselected_alpha", text="F-Curve Visibility") + flow.prop(edit, "fcurve_new_auto_smoothing", text="Default Smoothing Mode") flow.prop(edit, "keyframe_new_interpolation_type", text="Default Interpolation") flow.prop(edit, "keyframe_new_handle_type", text="Default Handles") flow.prop(edit, "use_insertkey_xyz_to_rgb", text="XYZ to RGB") diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h index 21ef70b7bcd..7b879cc1a15 100644 --- a/source/blender/blenkernel/BKE_blender_version.h +++ b/source/blender/blenkernel/BKE_blender_version.h @@ -27,7 +27,7 @@ * \note Use #STRINGIFY() rather than defining with quotes. */ #define BLENDER_VERSION 281 -#define BLENDER_SUBVERSION 12 +#define BLENDER_SUBVERSION 13 /** Several breakages with 280, e.g. collections vs layers. */ #define BLENDER_MINVERSION 280 #define BLENDER_MINSUBVERSION 0 diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 2cc1083aba3..09581debd99 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -1488,7 +1488,7 @@ void BKE_nlastrip_validate_fcurves(NlaStrip *strip) /* set default flags */ fcu->flag = (FCURVE_VISIBLE | FCURVE_SELECTED); - fcu->auto_smoothing = FCURVE_SMOOTH_CONT_ACCEL; + fcu->auto_smoothing = U.auto_smoothing_new; /* store path - make copy, and store that */ fcu->rna_path = BLI_strdupn("influence", 9); @@ -1515,7 +1515,7 @@ void BKE_nlastrip_validate_fcurves(NlaStrip *strip) /* set default flags */ fcu->flag = (FCURVE_VISIBLE | FCURVE_SELECTED); - fcu->auto_smoothing = FCURVE_SMOOTH_CONT_ACCEL; + fcu->auto_smoothing = U.auto_smoothing_new; /* store path - make copy, and store that */ fcu->rna_path = BLI_strdupn("strip_time", 10); diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c index e769e72d8e1..3eaf45954f3 100644 --- a/source/blender/blenloader/intern/versioning_userdef.c +++ b/source/blender/blenloader/intern/versioning_userdef.c @@ -30,6 +30,7 @@ #include "DNA_windowmanager_types.h" #include "DNA_scene_types.h" #include "DNA_space_types.h" +#include "DNA_anim_types.h" #include "BKE_addon.h" #include "BKE_colorband.h" @@ -624,15 +625,20 @@ void BLO_version_defaults_userpref_blend(Main *bmain, UserDef *userdef) userdef->filebrowser_display_type = USER_TEMP_SPACE_DISPLAY_WINDOW; } + if (!USER_VERSION_ATLEAST(281, 13)) { + userdef->auto_smoothing_new = FCURVE_SMOOTH_CONT_ACCEL; + + if (userdef->file_space_data.display_type == FILE_DEFAULTDISPLAY) { + memcpy( + &userdef->file_space_data, &U_default.file_space_data, sizeof(userdef->file_space_data)); + } + } + /** * Include next version bump. */ { /* pass */ - if (userdef->file_space_data.display_type == FILE_DEFAULTDISPLAY) { - memcpy( - &userdef->file_space_data, &U_default.file_space_data, sizeof(userdef->file_space_data)); - } } if (userdef->pixelsize == 0.0f) { diff --git a/source/blender/collada/AnimationImporter.cpp b/source/blender/collada/AnimationImporter.cpp index 79593f07383..47325c4dece 100644 --- a/source/blender/collada/AnimationImporter.cpp +++ b/source/blender/collada/AnimationImporter.cpp @@ -104,7 +104,7 @@ void AnimationImporter::animation_to_fcurves(COLLADAFW::AnimationCurve *curve) fcu->flag = (FCURVE_VISIBLE | FCURVE_AUTO_HANDLES | FCURVE_SELECTED); fcu->array_index = 0; - fcu->auto_smoothing = FCURVE_SMOOTH_CONT_ACCEL; + fcu->auto_smoothing = U.auto_smoothing_new; for (unsigned int j = 0; j < curve->getKeyCount(); j++) { BezTriple bez; diff --git a/source/blender/collada/BCAnimationCurve.cpp b/source/blender/collada/BCAnimationCurve.cpp index bf32ec9148c..f944a77196c 100644 --- a/source/blender/collada/BCAnimationCurve.cpp +++ b/source/blender/collada/BCAnimationCurve.cpp @@ -383,7 +383,7 @@ void BCAnimationCurve::adjust_range(const int frame_index) void BCAnimationCurve::add_value(const float val, const int frame_index) { FCurve *fcu = get_edit_fcurve(); - fcu->auto_smoothing = FCURVE_SMOOTH_CONT_ACCEL; + fcu->auto_smoothing = U.auto_smoothing_new; insert_vert_fcurve(fcu, frame_index, val, BEZT_KEYTYPE_KEYFRAME, INSERTKEY_NOFLAGS); if (fcu->totvert == 1) { diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c index 61c8da08954..64f7fe034dc 100644 --- a/source/blender/editors/animation/drivers.c +++ b/source/blender/editors/animation/drivers.c @@ -111,7 +111,7 @@ struct FCurve *alloc_driver_fcurve(const char rna_path[], FCurve *fcu = MEM_callocN(sizeof(FCurve), "FCurve"); fcu->flag = (FCURVE_VISIBLE | FCURVE_SELECTED); - fcu->auto_smoothing = FCURVE_SMOOTH_CONT_ACCEL; + fcu->auto_smoothing = U.auto_smoothing_new; /* store path - make copy, and store that */ if (rna_path) { diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 0f8b8742659..8203a9131fa 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -202,7 +202,7 @@ FCurve *verify_fcurve(Main *bmain, fcu = MEM_callocN(sizeof(FCurve), "FCurve"); fcu->flag = (FCURVE_VISIBLE | FCURVE_SELECTED); - fcu->auto_smoothing = FCURVE_SMOOTH_CONT_ACCEL; + fcu->auto_smoothing = U.auto_smoothing_new; if (BLI_listbase_is_empty(&act->curves)) { fcu->flag |= FCURVE_ACTIVE; /* first one added active */ } diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 75f29695eb3..b9f43c0e579 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -728,11 +728,13 @@ typedef struct UserDef { short curssize; /** #eColorPicker_Types. */ short color_picker_type; + /** Curve smoothing type for newly added F-Curves. */ + char auto_smoothing_new; /** Interpolation mode for newly added F-Curves. */ char ipo_new; /** Handle types for newly added keyframes. */ char keyhandles_new; - char _pad11[3]; + char _pad11[2]; /** #eZoomFrame_Mode. */ char view_frame_type; diff --git a/source/blender/makesrna/RNA_enum_types.h b/source/blender/makesrna/RNA_enum_types.h index e72a55b5a9e..458f031ceae 100644 --- a/source/blender/makesrna/RNA_enum_types.h +++ b/source/blender/makesrna/RNA_enum_types.h @@ -90,6 +90,7 @@ extern const EnumPropertyItem rna_enum_color_sets_items[]; extern const EnumPropertyItem rna_enum_beztriple_keyframe_type_items[]; extern const EnumPropertyItem rna_enum_beztriple_interpolation_mode_items[]; extern const EnumPropertyItem rna_enum_beztriple_interpolation_easing_items[]; +extern const EnumPropertyItem rna_enum_fcurve_auto_smoothing_items[]; extern const EnumPropertyItem rna_enum_keyframe_handle_type_items[]; extern const EnumPropertyItem rna_enum_driver_target_rotation_mode_items[]; diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index 254f3bc3710..424bb4a492f 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -76,6 +76,22 @@ const EnumPropertyItem rna_enum_fmodifier_type_items[] = { {0, NULL, 0, NULL, NULL}, }; +const EnumPropertyItem rna_enum_fcurve_auto_smoothing_items[] = { + {FCURVE_SMOOTH_NONE, + "NONE", + 0, + "None", + "Automatic handles only take immediately adjacent keys into account"}, + {FCURVE_SMOOTH_CONT_ACCEL, + "CONT_ACCEL", + 0, + "Continuous Acceleration", + "Automatic handles are adjusted to avoid jumps in acceleration, resulting " + "in smoother curves. However, key changes may affect interpolation over a " + "larger stretch of the curve"}, + {0, NULL, 0, NULL, NULL}, +}; + const EnumPropertyItem rna_enum_beztriple_keyframe_type_items[] = { {BEZT_KEYTYPE_KEYFRAME, "KEYFRAME", @@ -2258,19 +2274,6 @@ static void rna_def_fcurve(BlenderRNA *brna) "Use custom hand-picked color for F-Curve"}, {0, NULL, 0, NULL, NULL}, }; - static EnumPropertyItem prop_mode_smoothing_items[] = { - {FCURVE_SMOOTH_NONE, - "NONE", - 0, - "None", - "Auto handles only take adjacent keys into account (legacy mode)"}, - {FCURVE_SMOOTH_CONT_ACCEL, - "CONT_ACCEL", - 0, - "Continuous Acceleration", - "Auto handles are placed to avoid jumps in acceleration"}, - {0, NULL, 0, NULL, NULL}, - }; srna = RNA_def_struct(brna, "FCurve", NULL); RNA_def_struct_ui_text(srna, "F-Curve", "F-Curve defining values of a period of time"); @@ -2350,7 +2353,7 @@ static void rna_def_fcurve(BlenderRNA *brna) RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL); prop = RNA_def_property(srna, "auto_smoothing", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_items(prop, prop_mode_smoothing_items); + RNA_def_property_enum_items(prop, rna_enum_fcurve_auto_smoothing_items); RNA_def_property_ui_text( prop, "Auto Handle Smoothing", "Algorithm used to compute automatic handles"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_FCurve_update_data"); diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index f08a3ce93a1..07ce07710b1 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -4657,6 +4657,13 @@ static void rna_def_userdef_edit(BlenderRNA *brna) "Color for newly added transformation F-Curves (Location, Rotation, Scale) " "and also Color is based on the transform axis"); + prop = RNA_def_property(srna, "fcurve_new_auto_smoothing", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, rna_enum_fcurve_auto_smoothing_items); + RNA_def_property_enum_sdna(prop, NULL, "auto_smoothing_new"); + RNA_def_property_ui_text(prop, + "New Curve Smoothing Mode", + "Auto Handle Smoothing mode used for newly added F-Curves"); + prop = RNA_def_property(srna, "keyframe_new_interpolation_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, rna_enum_beztriple_interpolation_mode_items); RNA_def_property_enum_sdna(prop, NULL, "ipo_new"); |