Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_outliner/outliner_tree.c
| Show First 20 Lines • Show All 1,446 Lines • ▼ Show 20 Lines | static void outliner_layer_collections_reorder( | ||||
| TreeElement *insert_element, TreeElement *insert_handle, TreeElementInsertType action, | TreeElement *insert_element, TreeElement *insert_handle, TreeElementInsertType action, | ||||
| const wmEvent *UNUSED(event)) | const wmEvent *UNUSED(event)) | ||||
| { | { | ||||
| LayerCollection *lc_insert = insert_element->directdata; | LayerCollection *lc_insert = insert_element->directdata; | ||||
| LayerCollection *lc_handle = insert_handle->directdata; | LayerCollection *lc_handle = insert_handle->directdata; | ||||
| ID *id = insert_element->store_elem->id; | ID *id = insert_element->store_elem->id; | ||||
| if (action == TE_INSERT_BEFORE) { | if (action == TE_INSERT_BEFORE) { | ||||
| BKE_layer_collection_move_above(id, lc_handle, lc_insert); | BKE_layer_collection_move_above(id, lc_handle, lc_insert, bmain); | ||||
| } | } | ||||
| else if (action == TE_INSERT_AFTER) { | else if (action == TE_INSERT_AFTER) { | ||||
| BKE_layer_collection_move_below(id, lc_handle, lc_insert); | BKE_layer_collection_move_below(id, lc_handle, lc_insert, bmain); | ||||
| } | } | ||||
| else if (action == TE_INSERT_INTO) { | else if (action == TE_INSERT_INTO) { | ||||
| BKE_layer_collection_move_into(id, lc_handle, lc_insert); | BKE_layer_collection_move_into(id, lc_handle, lc_insert, bmain); | ||||
| } | } | ||||
| else { | else { | ||||
| BLI_assert(0); | BLI_assert(0); | ||||
| } | } | ||||
| DEG_relations_tag_update(bmain); | DEG_relations_tag_update(bmain); | ||||
| } | } | ||||
| static bool outliner_layer_collections_reorder_poll( | static bool outliner_layer_collections_reorder_poll( | ||||
| ▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| SceneCollection *sc_insert = insert_element->directdata; | SceneCollection *sc_insert = insert_element->directdata; | ||||
| SceneCollection *sc_handle = insert_handle->directdata; | SceneCollection *sc_handle = insert_handle->directdata; | ||||
| ID *id = insert_handle->store_elem->id; | ID *id = insert_handle->store_elem->id; | ||||
| BLI_assert(id == insert_element->store_elem->id); | BLI_assert(id == insert_element->store_elem->id); | ||||
| BLI_assert((action == TE_INSERT_INTO) || (sc_handle != BKE_collection_master(id))); | BLI_assert((action == TE_INSERT_INTO) || (sc_handle != BKE_collection_master(id))); | ||||
| if (action == TE_INSERT_BEFORE) { | if (action == TE_INSERT_BEFORE) { | ||||
| BKE_collection_move_above(id, sc_handle, sc_insert); | BKE_collection_move_above(id, sc_handle, sc_insert, bmain); | ||||
| } | } | ||||
| else if (action == TE_INSERT_AFTER) { | else if (action == TE_INSERT_AFTER) { | ||||
| BKE_collection_move_below(id, sc_handle, sc_insert); | BKE_collection_move_below(id, sc_handle, sc_insert, bmain); | ||||
| } | } | ||||
| else if (action == TE_INSERT_INTO) { | else if (action == TE_INSERT_INTO) { | ||||
| BKE_collection_move_into(id, sc_handle, sc_insert); | BKE_collection_move_into(id, sc_handle, sc_insert, bmain); | ||||
| } | } | ||||
| else { | else { | ||||
| BLI_assert(0); | BLI_assert(0); | ||||
| } | } | ||||
| DEG_relations_tag_update(bmain); | DEG_relations_tag_update(bmain); | ||||
| } | } | ||||
| static bool outliner_scene_collections_reorder_poll( | static bool outliner_scene_collections_reorder_poll( | ||||
| ▲ Show 20 Lines • Show All 813 Lines • Show Last 20 Lines | |||||