Fix crash when showing NLA actions in the Outliner
Caused by2e221de4ce
in combination with4292bb060d
. In the former I forgot to set the name for NLA actions in the new code design, in the latter I made it an assumtion that tree element types using the new design set the name. The following commit will make this assumption explicit with an assert.
This commit is contained in:
parent
018fffbe77
commit
f59ff9e03a
|
@ -52,7 +52,7 @@ static AbstractTreeElement *tree_element_create(int type, TreeElement &legacy_te
|
|||
case TSE_NLA_TRACK:
|
||||
return new TreeElementNLATrack(legacy_te, *static_cast<NlaTrack *>(idv));
|
||||
case TSE_NLA_ACTION:
|
||||
return new TreeElementNLAAction(legacy_te);
|
||||
return new TreeElementNLAAction(legacy_te, *static_cast<bAction *>(idv));
|
||||
case TSE_GP_LAYER:
|
||||
return new TreeElementGPencilLayer(legacy_te, *static_cast<bGPDlayer *>(idv));
|
||||
case TSE_R_LAYER_BASE:
|
||||
|
|
|
@ -70,9 +70,11 @@ void TreeElementNLATrack::expand(SpaceOutliner &space_outliner) const
|
|||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
TreeElementNLAAction::TreeElementNLAAction(TreeElement &legacy_te) : AbstractTreeElement(legacy_te)
|
||||
TreeElementNLAAction::TreeElementNLAAction(TreeElement &legacy_te, const bAction &action)
|
||||
: AbstractTreeElement(legacy_te)
|
||||
{
|
||||
BLI_assert(legacy_te.store_elem->type == TSE_NLA_ACTION);
|
||||
legacy_te.name = action.id.name + 2;
|
||||
}
|
||||
|
||||
} // namespace blender::ed::outliner
|
||||
|
|
|
@ -46,7 +46,7 @@ class TreeElementNLATrack final : public AbstractTreeElement {
|
|||
|
||||
class TreeElementNLAAction final : public AbstractTreeElement {
|
||||
public:
|
||||
TreeElementNLAAction(TreeElement &legacy_te);
|
||||
TreeElementNLAAction(TreeElement &legacy_te, const bAction &action);
|
||||
};
|
||||
|
||||
} // namespace blender::ed::outliner
|
||||
|
|
Loading…
Reference in New Issue