[Bf-blender-cvs] [95734e32bfb] master: Cleanup: Avoid setting (unsafe) Outliner tree element data that won't be used
Julian Eisel
noreply at git.blender.org
Mon Dec 7 14:36:05 CET 2020
Commit: 95734e32bfb9d4309e05a69e41aa1b1676d42447
Author: Julian Eisel
Date: Mon Dec 7 14:06:40 2020 +0100
Branches: master
https://developer.blender.org/rB95734e32bfb9d4309e05a69e41aa1b1676d42447
Cleanup: Avoid setting (unsafe) Outliner tree element data that won't be used
I carefully checked and am quite sure for `TSE_ANIMATION_DATA` and
`TSE_NLA_ACTION` the direct-data isn't used at all. This data is stored and
accessed in unsafe ways based on conventions anyway (`void *`). We should aim
for a safer design but it will be difficult to get there. Any removed
complexity will help.
===================================================================
M source/blender/editors/space_outliner/outliner_tree.c
===================================================================
diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c
index 811aaa1ba2e..a02a8441620 100644
--- a/source/blender/editors/space_outliner/outliner_tree.c
+++ b/source/blender/editors/space_outliner/outliner_tree.c
@@ -1008,7 +1008,6 @@ TreeElement *outliner_add_element(SpaceOutliner *space_outliner,
/* this element's info */
te->name = IFACE_("Animation");
- te->directdata = adt;
/* Action */
outliner_add_element(space_outliner, &te->subtree, adt->action, te, 0, 0);
@@ -1055,17 +1054,13 @@ TreeElement *outliner_add_element(SpaceOutliner *space_outliner,
TreeElement *tenlt = outliner_add_element(
space_outliner, &tenla->subtree, nlt, tenla, TSE_NLA_TRACK, a);
NlaStrip *strip;
- TreeElement *ten;
int b = 0;
tenlt->name = nlt->name;
for (strip = nlt->strips.first; strip; strip = strip->next, b++) {
- ten = outliner_add_element(
+ outliner_add_element(
space_outliner, &tenlt->subtree, strip->act, tenlt, TSE_NLA_ACTION, b);
- if (ten) {
- ten->directdata = strip;
- }
}
}
}
More information about the Bf-blender-cvs
mailing list