Blender Git Commit Log

Git Commits -> Revision edff789

Revision edff789 by Dalai Felinto (master)
April 25, 2019, 04:23 (GMT)
Fix T63869: Crash in new outliner show parenting hierarchy

As known as outliner parenting hierarchy take two.
Implemented suggestion by Brecht Van Lommel:

```
The problem is that it's iterating over te_parent->subtree,
while at the same time removing elements from it as tree_to_remove_objects_from.

Further there is a linear lookup to find tree elements corresponding to a child
object, which causes O(n^2) time complexity overall and so poor scaling for many
objects in a collection.

The more efficient solution that also fixes the crash could be:

* Build a map from Object* to a list of TreeElement* matching the object.
* For all objects in the tree lookup the parent in this map, and move or add
tree elements as needed.
```

I removed the grouping of the children not in collection in the end of
the children list when sorting was not enabled. If we think we really
need it back it can be tackled separately.

That said, despite due to performance reasons, I can't see why would
someone not have the a-z sorting enabled. And if they do, it is not the
end of the world to have interleaved children that are in the collection
or not in the parent subtree.

Commit Details:

Full Hash: edff78929276753b32e8df060d3f5f2755631288
Parent Commit: fbb03f6
Lines Changed: +77, -86

1 Modified Path:

/source/blender/editors/space_outliner/outliner_tree.c (+77, -86) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021