diff options
author | Julian Eisel <julian@blender.org> | 2021-03-11 15:39:06 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2021-03-11 15:49:16 +0300 |
commit | 0f60dbe4bf5227c2f8f21026f11ffd9703101687 (patch) | |
tree | 94e104e58fb66ca8238842b79238bc55819f1280 /source/blender/editors/space_outliner/tree/tree_element.cc | |
parent | d4d03f736b85f9db0d738428cf9521b2084232db (diff) |
Cleanup: Pass anim-data directly to Outliner anim-data tree element constructor
Rather than letting the `TreeElementAnimData` constructor take an ID from which
we get the animation-data based on an assumption on how it's stored, let the
constructor take the animation-data directly. That way we further centralize
the assumptions on the data passed to the element creation to
`tree_element_create()`.
The following commit will add a comment explaining the plan to entirely get rid
of those assumptions in the future.
Diffstat (limited to 'source/blender/editors/space_outliner/tree/tree_element.cc')
-rw-r--r-- | source/blender/editors/space_outliner/tree/tree_element.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/editors/space_outliner/tree/tree_element.cc b/source/blender/editors/space_outliner/tree/tree_element.cc index 116a2e4d3c3..d537bdfc99c 100644 --- a/source/blender/editors/space_outliner/tree/tree_element.cc +++ b/source/blender/editors/space_outliner/tree/tree_element.cc @@ -18,6 +18,7 @@ * \ingroup spoutliner */ +#include "DNA_anim_types.h" #include "DNA_listBase.h" #include "tree_element_anim_data.hh" @@ -44,7 +45,7 @@ static AbstractTreeElement *tree_element_create(int type, TreeElement &legacy_te case TSE_SOME_ID: return TreeElementID::createFromID(legacy_te, id); case TSE_ANIM_DATA: - return new TreeElementAnimData(legacy_te, id); + return new TreeElementAnimData(legacy_te, *reinterpret_cast<IdAdtTemplate &>(id).adt); case TSE_DRIVER_BASE: return new TreeElementDriverBase(legacy_te, *static_cast<AnimData *>(idv)); case TSE_NLA: |