diff options
author | Julian Eisel <julian@blender.org> | 2022-06-30 19:36:42 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2022-06-30 19:38:44 +0300 |
commit | 65166e145b4d6292abc289b71894c53b25c186ba (patch) | |
tree | 707513038d00a964d7a400ac8e7e22251fffb02d /source/blender/editors/animation/anim_channels_defines.c | |
parent | 66de653784ab06ccea46413de6b2f086b5a69d30 (diff) |
Cleanup: Remove scene frame macros (`CFRA` et al.)
Removes the following macros for scene/render frame values:
- `CFRA`
- `SUBFRA`
- `SFRA`
- `EFRA`
These macros don't add much, other than saving a few characters when typing.
It's not immediately clear what they refer to, they just hide what they
actually access. Just be explicit and clear about that.
Plus these macros gave read and write access to the variables, so eyesores like
this would be done (eyesore because it looks like assigning to a constant):
```
CFRA = some_frame_nbr;
```
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D15311
Diffstat (limited to 'source/blender/editors/animation/anim_channels_defines.c')
-rw-r--r-- | source/blender/editors/animation/anim_channels_defines.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index 7dac1286526..729e8533d50 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -4747,13 +4747,13 @@ static void achannel_setting_slider_cb(bContext *C, void *id_poin, void *fcu_poi RNA_id_pointer_create(id, &id_ptr); /* Get NLA context for value remapping */ - const AnimationEvalContext anim_eval_context = BKE_animsys_eval_context_construct(depsgraph, - (float)CFRA); + const AnimationEvalContext anim_eval_context = BKE_animsys_eval_context_construct( + depsgraph, (float)scene->r.cfra); NlaKeyframingContext *nla_context = BKE_animsys_get_nla_keyframing_context( &nla_cache, &id_ptr, adt, &anim_eval_context); /* get current frame and apply NLA-mapping to it (if applicable) */ - cfra = BKE_nla_tweakedit_remap(adt, (float)CFRA, NLATIME_CONVERT_UNMAP); + cfra = BKE_nla_tweakedit_remap(adt, (float)scene->r.cfra, NLATIME_CONVERT_UNMAP); /* Get flags for keyframing. */ flag = ANIM_get_keyframing_flags(scene, true); @@ -4803,8 +4803,8 @@ static void achannel_setting_slider_shapekey_cb(bContext *C, void *key_poin, voi RNA_id_pointer_create((ID *)key, &id_ptr); /* Get NLA context for value remapping */ - const AnimationEvalContext anim_eval_context = BKE_animsys_eval_context_construct(depsgraph, - (float)CFRA); + const AnimationEvalContext anim_eval_context = BKE_animsys_eval_context_construct( + depsgraph, (float)scene->r.cfra); NlaKeyframingContext *nla_context = BKE_animsys_get_nla_keyframing_context( &nla_cache, &id_ptr, key->adt, &anim_eval_context); @@ -4872,7 +4872,7 @@ static void achannel_setting_slider_nla_curve_cb(bContext *C, float cfra; /* get current frame - *no* NLA mapping should be done */ - cfra = (float)CFRA; + cfra = (float)scene->r.cfra; /* get flags for keyframing */ flag = ANIM_get_keyframing_flags(scene, true); |