From e628b5ffe5f74e138df4e664641eda54804ad674 Mon Sep 17 00:00:00 2001 From: Almaz-Shinbay Date: Mon, 14 Aug 2023 17:07:00 +0200 Subject: [PATCH] Cleanup: remove unnecessary constraint code in pose base expand() Removes unnecessary lines, which are handled already by `TreeElementConstraintBase` and `TreeElementConstraint` constructors (see 02969de155), in `TreeElementPoseBase::expand()`. Pull Request: https://projects.blender.org/blender/blender/pulls/111118 --- .../editors/space_outliner/tree/tree_element_pose.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/source/blender/editors/space_outliner/tree/tree_element_pose.cc b/source/blender/editors/space_outliner/tree/tree_element_pose.cc index f1e52482fd9..bfbdb40dc21 100644 --- a/source/blender/editors/space_outliner/tree/tree_element_pose.cc +++ b/source/blender/editors/space_outliner/tree/tree_element_pose.cc @@ -47,14 +47,13 @@ void TreeElementPoseBase::expand(SpaceOutliner &space_outliner) const /* Object *target; */ TreeElement *tenla1 = outliner_add_element( &space_outliner, &ten->subtree, &object_, ten, TSE_CONSTRAINT_BASE, 0); - tenla1->name = IFACE_("Constraints"); /* char *str; */ LISTBASE_FOREACH (bConstraint *, con, &pchan->constraints) { - TreeElement *ten1 = outliner_add_element( - &space_outliner, &tenla1->subtree, &object_, tenla1, TSE_CONSTRAINT, const_index); - ten1->name = con->name; - ten1->directdata = con; + ConstraintElementCreateData con_data = {&object_, con}; + + outliner_add_element( + &space_outliner, &tenla1->subtree, &con_data, tenla1, TSE_CONSTRAINT, const_index); /* possible add all other types links? */ } const_index++;