Remove redundant workaround for removing collections in outliner
Collections are now identified by their pointer. Also had to correct TSE_IS_REAL_ID to fix undefined behavior on undo.
This commit is contained in:
@@ -320,7 +320,6 @@ struct CollectionDeleteData {
|
||||
static TreeTraversalAction collection_delete_cb(TreeElement *te, void *customdata)
|
||||
{
|
||||
struct CollectionDeleteData *data = customdata;
|
||||
TreeStoreElem *tselem = TREESTORE(te);
|
||||
SceneCollection *scene_collection = outliner_scene_collection_from_tree_element(te);
|
||||
|
||||
if (!scene_collection) {
|
||||
@@ -332,13 +331,6 @@ static TreeTraversalAction collection_delete_cb(TreeElement *te, void *customdat
|
||||
* when deleting multiple collections, so just do nothing */
|
||||
}
|
||||
else {
|
||||
/* XXX removing the treestore element shouldn't be done, it makes us loose information after
|
||||
* undo/file-read. We do need it here however, because non-ID elements don't have an ID pointer
|
||||
* that can be used to lookup the TreeStoreElem when recreating the TreeElement. This index
|
||||
* won't be correct after removing a collection from the list though.
|
||||
* This works as workaround, but having a proper way to find the TreeStoreElem for a recreated
|
||||
* TreeElement would be better. It could use an idname or the directdata pointer for that. */
|
||||
outliner_remove_treestore_element(data->soops, tselem);
|
||||
BKE_collection_remove(data->scene, scene_collection);
|
||||
}
|
||||
|
||||
|
||||
@@ -111,7 +111,8 @@ enum {
|
||||
(!ELEM((_tse)->type, TSE_NLA, TSE_NLA_TRACK, TSE_DRIVER_BASE, \
|
||||
TSE_SEQUENCE, TSE_SEQ_STRIP, TSE_SEQUENCE_DUP, \
|
||||
TSE_RNA_STRUCT, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM, \
|
||||
TSE_KEYMAP, TSE_KEYMAP_ITEM, TSE_ID_BASE, TSE_GP_LAYER))
|
||||
TSE_KEYMAP, TSE_KEYMAP_ITEM, TSE_ID_BASE, TSE_GP_LAYER, \
|
||||
TSE_SCENE_COLLECTION, TSE_LAYER_COLLECTION))
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user