Blender Git Commit Log

Git Commits -> Revision 52f318b

Revision 52f318b by Bastien Montagne (master)
March 2, 2019, 21:00 (GMT)
Refactor duplicate code for collections.

* Fix incorrect handling of children collections being linked more than
once in the hierarchy (previous code would make a new copy for each
link, instead of just re-linking the first copy for each extra link).

* Simplify some aspects of it (we do not need a GHash for new objects,
we can use ID->newid pointer instead, and some iterations can be done
directly on existing linked lists of old collection, instead of making
temp local copies of them).

* Move all copy logic into a single private recursive function (it was a
bit odd/disturbing to see calling function being indirectly called again
by the recursive helper one - not wrong, but that kind of code path can
quickly become problematic in recursive patterns).

* Added some comments about expected behavior of
`BKE_collection_duplicate()` depending on its booleans options.

Commit Details:

Full Hash: 52f318b9142ba5600b56e4797f77ca04a87c4fab
Parent Commit: dcbc09e
Lines Changed: +72, -53

By: Miika HämäläinenLast update: Nov-07-2014 14:18 MiikaHweb | 2003-2020