mirror of
https://github.com/blender/blender
synced 2026-09-26 16:15:47 +03:00
Refactor: reduce indentation in ANIM_nla_mapping_get()
Flip conditions and use early returns to simplify `ANIM_nla_mapping_get()`. No functional changes. Pull Request: https://projects.blender.org/blender/blender/pulls/119463
This commit is contained in:
parent
0ac7dd966c
commit
af7a68d31f
1 changed files with 21 additions and 18 deletions
|
|
@ -221,27 +221,30 @@ AnimData *ANIM_nla_mapping_get(bAnimContext *ac, bAnimListElem *ale)
|
|||
|
||||
/* apart from strictly keyframe-related contexts, this shouldn't even happen */
|
||||
/* XXX: nla and channel here may not be necessary... */
|
||||
if (ELEM(ac->datatype,
|
||||
ANIMCONT_ACTION,
|
||||
ANIMCONT_SHAPEKEY,
|
||||
ANIMCONT_DOPESHEET,
|
||||
ANIMCONT_FCURVES,
|
||||
ANIMCONT_NLA,
|
||||
ANIMCONT_CHANNEL,
|
||||
ANIMCONT_TIMELINE))
|
||||
if (!ELEM(ac->datatype,
|
||||
ANIMCONT_ACTION,
|
||||
ANIMCONT_SHAPEKEY,
|
||||
ANIMCONT_DOPESHEET,
|
||||
ANIMCONT_FCURVES,
|
||||
ANIMCONT_NLA,
|
||||
ANIMCONT_CHANNEL,
|
||||
ANIMCONT_TIMELINE))
|
||||
{
|
||||
/* handling depends on the type of animation-context we've got */
|
||||
if (ale) {
|
||||
/* NLA Control Curves occur on NLA strips,
|
||||
* and shouldn't be subjected to this kind of mapping. */
|
||||
if (ale->type != ANIMTYPE_NLACURVE) {
|
||||
return ale->adt;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* cannot handle... */
|
||||
return nullptr;
|
||||
/* handling depends on the type of animation-context we've got */
|
||||
if (!ale) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* NLA Control Curves occur on NLA strips,
|
||||
* and shouldn't be subjected to this kind of mapping. */
|
||||
if (ale->type == ANIMTYPE_NLACURVE) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return ale->adt;
|
||||
}
|
||||
|
||||
/* ------------------- */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue