diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-03-08 19:21:43 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-03-09 01:35:54 +0300 |
commit | d9f42e5fab6a13ce200665b9a89291aa34ff6c09 (patch) | |
tree | 9e5be3ff1a2bf30b9456bd26aaa795e5eac6a6ff /source/blender/editors/space_outliner | |
parent | 3a1748146bcdb0d99d9620b3a52b77110e2eb5f1 (diff) |
Layers: move LayerCollection
This is to be used from the Outliner, when dragging and dropping
collections from the Active Render Layer
It also includes a cleanup on the outliner so it calls the new
functions. Note: the outliner still needs fix to allow all the
functionality here exposed.
But this will be tackled by Julian Eisel later.
Diffstat (limited to 'source/blender/editors/space_outliner')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_tree.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c index 1db530804b7..870c34a1ee7 100644 --- a/source/blender/editors/space_outliner/outliner_tree.c +++ b/source/blender/editors/space_outliner/outliner_tree.c @@ -1290,15 +1290,23 @@ static void outliner_add_orphaned_datablocks(Main *mainvar, SpaceOops *soops) static void outliner_layer_collections_reorder(const Scene *scene, TreeElement *insert_element, TreeElement *insert_handle, TreeElementInsertType action) { - SceneLayer *sl = BKE_scene_layer_render_active(scene); - LayerCollection *insert_coll = insert_element->directdata; - LayerCollection *insert_handle_coll = insert_handle ? insert_handle->directdata : NULL; + LayerCollection *sc_src = insert_element->directdata; + LayerCollection *sc_dst = insert_handle ? insert_handle->directdata : NULL; if (action == TE_INSERT_AFTER) { - BKE_layer_collection_reinsert_after(scene, sl, insert_coll, insert_handle_coll); + if (sc_dst == NULL) { + /* It needs a LayerCollection 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_layer_collection_move_after(scene, sc_dst, sc_src); */ + } + else { + BKE_layer_collection_move_below(scene, sc_dst, sc_src); + } } else if (action == TE_INSERT_INTO) { - BKE_layer_collection_move_into(scene, insert_coll, insert_handle_coll); + BKE_layer_collection_move_into(scene, sc_src, sc_dst); } } @@ -1312,7 +1320,7 @@ static void outliner_scene_collections_reorder(const Scene *scene, TreeElement * 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*/ + * that don't belong to the same hierarchical level */ TODO_LAYER_OPERATORS; /* BKE_collection_move_after(scene, sc_dst, sc_src); */ } |