Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2017-03-03 18:14:21 +0300
committerDalai Felinto <dfelinto@gmail.com>2017-03-09 01:35:54 +0300
commit3a1748146bcdb0d99d9620b3a52b77110e2eb5f1 (patch)
treede2812110ce27e2f0f7e33ce15edd1c47dbd58d8 /source/blender/editors/space_outliner/outliner_tree.c
parent9b2877ad88baaeb30f858359479554320c19448d (diff)
Layers: move SceneCollection
This is to be used from the Outliner, when dragging and dropping. It does not include moving LayerCollection (from Active Render Layer)
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_tree.c')
-rw-r--r--source/blender/editors/space_outliner/outliner_tree.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c
index afd9610b6bf..1db530804b7 100644
--- a/source/blender/editors/space_outliner/outliner_tree.c
+++ b/source/blender/editors/space_outliner/outliner_tree.c
@@ -1298,21 +1298,30 @@ static void outliner_layer_collections_reorder(const Scene *scene, TreeElement *
BKE_layer_collection_reinsert_after(scene, sl, insert_coll, insert_handle_coll);
}
else if (action == TE_INSERT_INTO) {
- BKE_layer_collection_reinsert_into(insert_coll, insert_handle_coll);
+ BKE_layer_collection_move_into(scene, insert_coll, insert_handle_coll);
}
}
static void outliner_scene_collections_reorder(const Scene *scene, TreeElement *insert_element, TreeElement *insert_handle,
TreeElementInsertType action)
{
- SceneCollection *insert_coll = insert_element->directdata;
- SceneCollection *insert_handle_coll = insert_handle ? insert_handle->directdata : NULL;
+ SceneCollection *sc_src = insert_element->directdata;
+ SceneCollection *sc_dst = insert_handle ? insert_handle->directdata : NULL;
if (action == TE_INSERT_AFTER) {
- BKE_collection_reinsert_after(scene, insert_coll, insert_handle_coll);
+ if (sc_dst == NULL) {
+ /* It needs a SceneCollection to use as reference,
+ * specially now that we are to allow insert in collections
+ * that don't belong to the same hierarchical level*/
+ TODO_LAYER_OPERATORS;
+ /* BKE_collection_move_after(scene, sc_dst, sc_src); */
+ }
+ else {
+ BKE_collection_move_below(scene, sc_dst, sc_src);
+ }
}
else if (action == TE_INSERT_INTO) {
- BKE_collection_reinsert_into(insert_coll, insert_handle_coll);
+ BKE_collection_move_into(scene, sc_dst, sc_src);
}
}