diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2018-01-26 13:40:11 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2018-01-26 13:43:17 +0300 |
commit | 13238ee991ad9ec72330b7a23bfc1173f3a57e0f (patch) | |
tree | ce893b0e68a14e3f03dbc38b3c8387eaedb41925 /source/blender/editors/space_outliner/outliner_ops.c | |
parent | bd7060a87fd9f46c2bdd141e26934e8573c6e3f8 (diff) |
Revert "Fix crash on Collada exporter"
This reverts commit bd7060a87fd9f46c2bdd141e26934e8573c6e3f8.
I mixed two commits together (a fixup for outliner tooltips and a collada fix).
Re-committing them individually.
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_ops.c')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_ops.c | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/source/blender/editors/space_outliner/outliner_ops.c b/source/blender/editors/space_outliner/outliner_ops.c index ff322b49a27..599096c0ee9 100644 --- a/source/blender/editors/space_outliner/outliner_ops.c +++ b/source/blender/editors/space_outliner/outliner_ops.c @@ -250,36 +250,21 @@ static int outliner_item_drag_drop_modal(bContext *C, wmOperator *op, const wmEv return retval; } -/** - * Check if the given TreeElement is a collection - * - * This test is mainly used to see if next/prev TreeElement is a collection. - * It will fail when there is no next/prev TreeElement, or when the - * element is an Override or something else in the future. - */ -static bool tree_element_is_collection_get(const TreeElement *te) { - if (te == NULL) { - return false; - } - - TreeStoreElem *tselem = TREESTORE(te); - return ELEM(tselem->type, TSE_LAYER_COLLECTION, TSE_SCENE_COLLECTION); -} - static const char *outliner_drag_drop_tooltip_get( const TreeElement *te_float) { const char *name = NULL; + TreeStoreElem *tselem = TREESTORE(te_float); const TreeElement *te_insert = te_float->drag_data->insert_handle; - if (tree_element_is_collection_get(te_float)) { + if (ELEM(tselem->type, TSE_LAYER_COLLECTION, TSE_SCENE_COLLECTION)) { if (te_insert == NULL) { name = TIP_("Move collection"); } else { switch (te_float->drag_data->insert_type) { case TE_INSERT_BEFORE: - if (tree_element_is_collection_get(te_insert->prev)) { + if (te_insert->prev) { name = TIP_("Move between collections"); } else { @@ -287,7 +272,7 @@ static const char *outliner_drag_drop_tooltip_get( } break; case TE_INSERT_AFTER: - if (tree_element_is_collection_get(te_insert->next)) { + if (te_insert->next) { name = TIP_("Move between collections"); } else { @@ -300,7 +285,7 @@ static const char *outliner_drag_drop_tooltip_get( } } } - else if ((TREESTORE(te_float)->type == 0) && (te_float->idcode == ID_OB)) { + else if ((tselem->type == 0) && (te_float->idcode == ID_OB)) { name = TIP_("Move to collection (Ctrl to add)"); } |