diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2019-09-27 17:33:48 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2019-09-27 18:02:39 +0300 |
commit | b22afef72c5cab001b7458defc3d042742803b9d (patch) | |
tree | 65fe64463c91008ab36d2d180679c453f262842b /source/blender/editors/include/ED_keyframing.h | |
parent | 3c7707b49fc634f4850c1b3f0e3a439a91bde891 (diff) |
Cleanup: Replace 'add mode' short for driver FCurve creation with an enum
The 'add mode' was a `short` between -1 and 2 inclusive, and magic numbers
sprinkled throughout the code. It's now an enum with descriptive names.
No functional changes.
Diffstat (limited to 'source/blender/editors/include/ED_keyframing.h')
-rw-r--r-- | source/blender/editors/include/ED_keyframing.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h index 42e5add2ef0..16b3c9c240a 100644 --- a/source/blender/editors/include/ED_keyframing.h +++ b/source/blender/editors/include/ED_keyframing.h @@ -310,15 +310,24 @@ extern EnumPropertyItem prop_driver_create_mapping_types[]; /* -------- */ +typedef enum eDriverFCurveCreationMode { + DRIVER_FCURVE_LOOKUP_ONLY = 0, /* Don't add anything if not found. */ + DRIVER_FCURVE_KEYFRAMES = 1, /* Add with keyframes, for visual tweaking. */ + DRIVER_FCURVE_GENERATOR = 2, /* Add with generator, for script backwards compatibility. */ + DRIVER_FCURVE_EMPTY = 3 /* Add without data, for pasting. */ +} eDriverFCurveCreationMode; + /* Low-level call to add a new driver F-Curve. This shouldn't be used directly for most tools, * although there are special cases where this approach is preferable. */ struct FCurve *verify_driver_fcurve(struct ID *id, const char rna_path[], const int array_index, - short add); + eDriverFCurveCreationMode creation_mode); -struct FCurve *alloc_driver_fcurve(const char rna_path[], const int array_index, short add); +struct FCurve *alloc_driver_fcurve(const char rna_path[], + const int array_index, + eDriverFCurveCreationMode creation_mode); /* -------- */ |