Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/object/object_select.c
| Show First 20 Lines • Show All 240 Lines • ▼ Show 20 Lines | Base *ED_object_find_first_by_data_id(ViewLayer *view_layer, ID *id) | ||||
| if (basact && basact->object && basact->object->data == id) { | if (basact && basact->object && basact->object->data == id) { | ||||
| return basact; | return basact; | ||||
| } | } | ||||
| /* Try all objects. */ | /* Try all objects. */ | ||||
| Base *base_best = NULL; | Base *base_best = NULL; | ||||
| int priority_best = 0; | int priority_best = 0; | ||||
| for (Base *base = view_layer->object_bases.first; base; base = base->next) { | LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) { | ||||
| if (base->object && base->object->data == id) { | if (base->object && base->object->data == id) { | ||||
| if (base->flag & BASE_SELECTED) { | if (base->flag & BASE_SELECTED) { | ||||
| return base; | return base; | ||||
| } | } | ||||
| else { | else { | ||||
| int priority_test = get_base_select_priority(base); | int priority_test = get_base_select_priority(base); | ||||
| if (priority_test > priority_best) { | if (priority_test > priority_best) { | ||||
| ▲ Show 20 Lines • Show All 1,062 Lines • ▼ Show 20 Lines | |||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Select More/Less | /** \name Select More/Less | ||||
| * \{ */ | * \{ */ | ||||
| static bool object_select_more_less(bContext *C, const bool select) | static bool object_select_more_less(bContext *C, const bool select) | ||||
| { | { | ||||
| ViewLayer *view_layer = CTX_data_view_layer(C); | ViewLayer *view_layer = CTX_data_view_layer(C); | ||||
| for (Base *base = view_layer->object_bases.first; base; base = base->next) { | LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) { | ||||
| Object *ob = base->object; | Object *ob = base->object; | ||||
| ob->flag &= ~OB_DONE; | ob->flag &= ~OB_DONE; | ||||
| ob->id.tag &= ~LIB_TAG_DOIT; | ob->id.tag &= ~LIB_TAG_DOIT; | ||||
| /* parent may be in another scene */ | /* parent may be in another scene */ | ||||
| if (ob->parent) { | if (ob->parent) { | ||||
| ob->parent->flag &= ~OB_DONE; | ob->parent->flag &= ~OB_DONE; | ||||
| ob->parent->id.tag &= ~LIB_TAG_DOIT; | ob->parent->id.tag &= ~LIB_TAG_DOIT; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 157 Lines • Show Last 20 Lines | |||||