Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_outliner/outliner_sync.c
| Show All 24 Lines | |||||
| #include "DNA_armature_types.h" | #include "DNA_armature_types.h" | ||||
| #include "DNA_layer_types.h" | #include "DNA_layer_types.h" | ||||
| #include "DNA_outliner_types.h" | #include "DNA_outliner_types.h" | ||||
| #include "DNA_screen_types.h" | #include "DNA_screen_types.h" | ||||
| #include "DNA_sequence_types.h" | #include "DNA_sequence_types.h" | ||||
| #include "DNA_space_types.h" | #include "DNA_space_types.h" | ||||
| #include "BLI_listbase.h" | |||||
| #include "BLI_compiler_compat.h" | #include "BLI_compiler_compat.h" | ||||
| #include "BLI_ghash.h" | #include "BLI_ghash.h" | ||||
| #include "BKE_armature.h" | #include "BKE_armature.h" | ||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_layer.h" | #include "BKE_layer.h" | ||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| #include "BKE_object.h" | #include "BKE_object.h" | ||||
| ▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | |||||
| /* Copy sync select dirty flag from window manager to all outliners to be synced lazily on draw */ | /* Copy sync select dirty flag from window manager to all outliners to be synced lazily on draw */ | ||||
| void ED_outliner_select_sync_flag_outliners(const bContext *C) | void ED_outliner_select_sync_flag_outliners(const bContext *C) | ||||
| { | { | ||||
| Main *bmain = CTX_data_main(C); | Main *bmain = CTX_data_main(C); | ||||
| wmWindowManager *wm = CTX_wm_manager(C); | wmWindowManager *wm = CTX_wm_manager(C); | ||||
| for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { | for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { | ||||
| for (ScrArea *area = screen->areabase.first; area; area = area->next) { | LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { | ||||
| for (SpaceLink *sl = area->spacedata.first; sl; sl = sl->next) { | LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) { | ||||
| if (sl->spacetype == SPACE_OUTLINER) { | if (sl->spacetype == SPACE_OUTLINER) { | ||||
| SpaceOutliner *soutliner = (SpaceOutliner *)sl; | SpaceOutliner *soutliner = (SpaceOutliner *)sl; | ||||
| soutliner->sync_select_dirty |= wm->outliner_sync_select_dirty; | soutliner->sync_select_dirty |= wm->outliner_sync_select_dirty; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 205 Lines • ▼ Show 20 Lines | |||||
| /** Sync select and active flags from outliner to active view layer, bones, and sequencer. */ | /** Sync select and active flags from outliner to active view layer, bones, and sequencer. */ | ||||
| static void outliner_sync_selection_from_outliner(Scene *scene, | static void outliner_sync_selection_from_outliner(Scene *scene, | ||||
| ViewLayer *view_layer, | ViewLayer *view_layer, | ||||
| ListBase *tree, | ListBase *tree, | ||||
| const SyncSelectTypes *sync_types, | const SyncSelectTypes *sync_types, | ||||
| SelectedItems *selected_items) | SelectedItems *selected_items) | ||||
| { | { | ||||
| for (TreeElement *te = tree->first; te; te = te->next) { | LISTBASE_FOREACH (TreeElement *, te, tree) { | ||||
| TreeStoreElem *tselem = TREESTORE(te); | TreeStoreElem *tselem = TREESTORE(te); | ||||
| if (tselem->type == 0 && te->idcode == ID_OB) { | if (tselem->type == 0 && te->idcode == ID_OB) { | ||||
| if (sync_types->object) { | if (sync_types->object) { | ||||
| outliner_select_sync_to_object(view_layer, te, tselem, selected_items->objects); | outliner_select_sync_to_object(view_layer, te, tselem, selected_items->objects); | ||||
| } | } | ||||
| } | } | ||||
| else if (tselem->type == TSE_EBONE) { | else if (tselem->type == TSE_EBONE) { | ||||
| ▲ Show 20 Lines • Show All 164 Lines • ▼ Show 20 Lines | |||||
| /** Sync select and active flags from active view layer, bones, and sequences to the outliner. */ | /** Sync select and active flags from active view layer, bones, and sequences to the outliner. */ | ||||
| static void outliner_sync_selection_to_outliner(ViewLayer *view_layer, | static void outliner_sync_selection_to_outliner(ViewLayer *view_layer, | ||||
| SpaceOutliner *soops, | SpaceOutliner *soops, | ||||
| ListBase *tree, | ListBase *tree, | ||||
| SyncSelectActiveData *active_data, | SyncSelectActiveData *active_data, | ||||
| const SyncSelectTypes *sync_types) | const SyncSelectTypes *sync_types) | ||||
| { | { | ||||
| for (TreeElement *te = tree->first; te; te = te->next) { | LISTBASE_FOREACH (TreeElement *, te, tree) { | ||||
| TreeStoreElem *tselem = TREESTORE(te); | TreeStoreElem *tselem = TREESTORE(te); | ||||
| if (tselem->type == 0 && te->idcode == ID_OB) { | if (tselem->type == 0 && te->idcode == ID_OB) { | ||||
| if (sync_types->object) { | if (sync_types->object) { | ||||
| outliner_select_sync_from_object(view_layer, soops, active_data->object, te, tselem); | outliner_select_sync_from_object(view_layer, soops, active_data->object, te, tselem); | ||||
| } | } | ||||
| } | } | ||||
| else if (tselem->type == TSE_EBONE) { | else if (tselem->type == TSE_EBONE) { | ||||
| ▲ Show 20 Lines • Show All 66 Lines • Show Last 20 Lines | |||||