diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2019-10-01 21:38:44 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2019-10-02 20:42:37 +0300 |
commit | aabd8701e98595bae57d59344ed5d127b8b0f7db (patch) | |
tree | 5f4bc9ecb2f5b23dfbcb2ab6556b22b3970556cf /source/blender/makesrna/intern/rna_fcurve.c | |
parent | d1a1302b01f445f9c877d6b8c51f6c561e0fda16 (diff) |
Implement a user preference for the default Auto Handle Smoothing mode.
The default was changed with an initial implementation of the feature.
With the feedback from animators, having a behavior which affects curves
outside of a changing range is not convenient for professional animators
working on high quality character animation. On the other hand, automatic
smoothing is better for casual animation of object motion.
This change adds an ability to change the default via User Preferences.
Differential Revision: https://developer.blender.org/D5875
Diffstat (limited to 'source/blender/makesrna/intern/rna_fcurve.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_fcurve.c | 31 |
1 files changed, 17 insertions, 14 deletions
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"); |