Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/object/object_collection.c
| Show First 20 Lines • Show All 558 Lines • ▼ Show 20 Lines | void OBJECT_OT_collection_unlink(wmOperatorType *ot) | ||||
| ot->poll = ED_operator_objectmode; | ot->poll = ED_operator_objectmode; | ||||
| /* flags */ | /* flags */ | ||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ||||
| } | } | ||||
| static int select_grouped_exec(bContext *C, wmOperator *UNUSED(op)) /* Select objects in the same collection as the active */ | static int select_grouped_exec(bContext *C, wmOperator *UNUSED(op)) /* Select objects in the same collection as the active */ | ||||
| { | { | ||||
| Scene *scene = CTX_data_scene(C); | |||||
| Collection *collection = CTX_data_pointer_get_type(C, "collection", &RNA_Collection).data; | Collection *collection = CTX_data_pointer_get_type(C, "collection", &RNA_Collection).data; | ||||
| if (!collection) | if (!collection) | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| CTX_DATA_BEGIN (C, Base *, base, visible_bases) | CTX_DATA_BEGIN (C, Base *, base, visible_bases) | ||||
| { | { | ||||
| if (((base->flag & BASE_SELECTED) == 0) && ((base->flag & BASE_SELECTABLE) != 0)) { | if (((base->flag & BASE_SELECTED) == 0) && ((base->flag & BASE_SELECTABLE) != 0)) { | ||||
| if (BKE_collection_has_object_recursive(collection, base->object)) { | if (BKE_collection_has_object_recursive(collection, base->object)) { | ||||
| ED_object_base_select(base, BA_SELECT); | ED_object_base_select(base, BA_SELECT); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| CTX_DATA_END; | CTX_DATA_END; | ||||
| WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, NULL); | DEG_id_tag_update(&scene->id, DEG_TAG_SELECT_UPDATE); | ||||
| WM_main_add_notifier(NC_SCENE | ND_OB_SELECT, scene); | |||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| void OBJECT_OT_collection_objects_select(wmOperatorType *ot) | void OBJECT_OT_collection_objects_select(wmOperatorType *ot) | ||||
| { | { | ||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Select Objects in Collection"; | ot->name = "Select Objects in Collection"; | ||||
| Show All 10 Lines | |||||