[Bf-blender-cvs] [b90ad0ded7d] blender2.8: Remove redundant workaround for removing collections in outliner

Julian Eisel noreply at git.blender.org
Fri May 19 16:02:41 CEST 2017


Commit: b90ad0ded7d3fdcd52131122b53765bac59890cd
Author: Julian Eisel
Date:   Fri May 19 15:47:47 2017 +0200
Branches: blender2.8
https://developer.blender.org/rBb90ad0ded7d3fdcd52131122b53765bac59890cd

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.

===================================================================

M	source/blender/editors/space_outliner/outliner_collections.c
M	source/blender/makesdna/DNA_outliner_types.h

===================================================================

diff --git a/source/blender/editors/space_outliner/outliner_collections.c b/source/blender/editors/space_outliner/outliner_collections.c
index b3d52da26d5..97b03693ca6 100644
--- a/source/blender/editors/space_outliner/outliner_collections.c
+++ b/source/blender/editors/space_outliner/outliner_collections.c
@@ -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);
 	}
 
diff --git a/source/blender/makesdna/DNA_outliner_types.h b/source/blender/makesdna/DNA_outliner_types.h
index cb868ceb98e..81575beaac8 100644
--- a/source/blender/makesdna/DNA_outliner_types.h
+++ b/source/blender/makesdna/DNA_outliner_types.h
@@ -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




More information about the Bf-blender-cvs mailing list