Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_outliner/outliner_edit.c
| Show First 20 Lines • Show All 1,286 Lines • ▼ Show 20 Lines | static void outliner_show_active(SpaceOutliner *so, ARegion *region, TreeElement *te, ID *id) | ||||
| /* open up tree to active object/bone */ | /* open up tree to active object/bone */ | ||||
| if (TREESTORE(te)->id == id) { | if (TREESTORE(te)->id == id) { | ||||
| if (outliner_open_back(te)) { | if (outliner_open_back(te)) { | ||||
| outliner_set_coordinates(region, so); | outliner_set_coordinates(region, so); | ||||
| } | } | ||||
| return; | return; | ||||
| } | } | ||||
| for (TreeElement *ten = te->subtree.first; ten; ten = ten->next) { | LISTBASE_FOREACH (TreeElement *, ten, &te->subtree) { | ||||
| outliner_show_active(so, region, ten, id); | outliner_show_active(so, region, ten, id); | ||||
| } | } | ||||
| } | } | ||||
| static int outliner_show_active_exec(bContext *C, wmOperator *UNUSED(op)) | static int outliner_show_active_exec(bContext *C, wmOperator *UNUSED(op)) | ||||
| { | { | ||||
| SpaceOutliner *so = CTX_wm_space_outliner(C); | SpaceOutliner *so = CTX_wm_space_outliner(C); | ||||
| ViewLayer *view_layer = CTX_data_view_layer(C); | ViewLayer *view_layer = CTX_data_view_layer(C); | ||||
| ARegion *region = CTX_wm_region(C); | ARegion *region = CTX_wm_region(C); | ||||
| View2D *v2d = ®ion->v2d; | View2D *v2d = ®ion->v2d; | ||||
| TreeElement *active_element = outliner_show_active_get_element(C, so, view_layer); | TreeElement *active_element = outliner_show_active_get_element(C, so, view_layer); | ||||
| if (active_element) { | if (active_element) { | ||||
| ID *id = TREESTORE(active_element)->id; | ID *id = TREESTORE(active_element)->id; | ||||
| /* Expand all elements in the outliner with matching ID */ | /* Expand all elements in the outliner with matching ID */ | ||||
| for (TreeElement *te = so->tree.first; te; te = te->next) { | LISTBASE_FOREACH (TreeElement *, te, &so->tree) { | ||||
| outliner_show_active(so, region, te, id); | outliner_show_active(so, region, te, id); | ||||
| } | } | ||||
| /* Also open back from the active_element (only done for the first found occurrence of ID | /* Also open back from the active_element (only done for the first found occurrence of ID | ||||
| * though). */ | * though). */ | ||||
| outliner_show_active(so, region, active_element, id); | outliner_show_active(so, region, active_element, id); | ||||
| /* Center view on first element found */ | /* Center view on first element found */ | ||||
| ▲ Show 20 Lines • Show All 986 Lines • Show Last 20 Lines | |||||