diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2017-03-02 19:11:09 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2017-03-02 19:15:30 +0300 |
commit | 0322700d875a1d518a730512531a881f1278124b (patch) | |
tree | b668e69e366d6621256603c3ef7f8dc4219ab3af /source/blender/editors/space_outliner/outliner_tree.c | |
parent | 146a88dd60aa20b526ecae2f3f4c2512e1f4d4f0 (diff) |
Get UI ready for using drag & drop to nest a collection into another one
Nothing happen yet when it's supposed to insert the collection into
another one, that part will be handled by @dfelinto.
See gif for demo of how it works UI wise: {F500337}
Also fixed off-by-one error in utility function.
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_tree.c')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_tree.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c index 8a024e0cc82..0cf76a671a4 100644 --- a/source/blender/editors/space_outliner/outliner_tree.c +++ b/source/blender/editors/space_outliner/outliner_tree.c @@ -1287,13 +1287,19 @@ static void outliner_add_orphaned_datablocks(Main *mainvar, SpaceOops *soops) } } -static void outliner_collections_reorder(const Scene *scene, TreeElement *insert_element, TreeElement *insert_after) +static void outliner_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_after_coll = insert_after ? insert_after->directdata : NULL; + LayerCollection *insert_handle_coll = insert_handle ? insert_handle->directdata : NULL; - BKE_layer_collection_reinsert_after(scene, sl, insert_coll, insert_after_coll); + if (action == TE_INSERT_AFTER) { + 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); + } } static void outliner_add_layer_collections_recursive(SpaceOops *soops, ListBase *tree, Scene *scene, |