88 base->
flag &= ~BASE_SELECTED;
103 if (mbus !=
nullptr) {
112 view_layer->
basact = base;
151 bool any_visible =
false;
152 bool changed =
false;
185 *r_any_visible = any_visible;
225 Base *base_best =
nullptr;
226 int priority_best = 0;
229 if (base->object && base->object->data ==
id) {
236 if (priority_test > priority_best) {
237 priority_best = priority_test;
254 if (base ==
nullptr) {
301 if (ebone !=
nullptr) {
304 ebone->
flag &= ~BONE_HIDDEN_A;
325 if (pchan !=
nullptr) {
328 pchan->
bone->
flag &= ~BONE_HIDDEN_P;
361 if (obact && obact->
mode) {
379 short obtype, extend;
389 if (base->object->type == obtype) {
406 ot->
name =
"Select by Type";
407 ot->
description =
"Select all visible objects that are of a type";
408 ot->
idname =
"OBJECT_OT_select_by_type";
423 "Extend selection instead of deselecting everything first");
453 {0,
nullptr, 0,
nullptr,
nullptr},
458 bool changed =
false;
462 if (base->object->data == obdata) {
475 bool changed =
false;
479 Object *ob = base->object;
483 for (a = 1; a <= ob->
totcol; a++) {
500 bool changed =
false;
508 base->object->instance_collection :
510 if (instance_collection == instance_collection_other) {
524 bool changed =
false;
530 if (psys->part == psys_act->
part) {
549 bool changed =
false;
553 if (
lib == base->object->id.lib) {
566 bool changed =
false;
570 if (base->object->data &&
lib == ((
ID *)base->object->data)->lib) {
583 int idtype =
GS(id->name);
584 bool changed =
false;
589 else if (idtype ==
ID_MA) {
592 else if (idtype ==
ID_LI) {
610 bool changed =
false, extend;
632 if (ob->
data ==
nullptr) {
642 if (mat ==
nullptr) {
667 if (ob->
data ==
nullptr) {
690 ot->
name =
"Select Linked";
691 ot->
description =
"Select all visible objects that are linked";
692 ot->
idname =
"OBJECT_OT_select_linked";
707 "Extend selection instead of deselecting everything first");
745 "Objects included in active Keying Set"},
747 {0,
nullptr, 0,
nullptr,
nullptr},
752 bool changed =
false;
755 if (ob == base->object->
parent) {
777 bool changed =
false;
796#define COLLECTION_MENU_MAX 24
801 bool changed =
false;
809 collection =
static_cast<Collection *
>(collection->id.next))
821 collection = ob_collections[0];
839 collection = ob_collections[i];
841 collection->id.name + 2,
843 "OBJECT_OT_select_same_collection",
845 collection->id.name + 2);
858 bool changed =
false;
882 bool changed =
false;
897 bool changed =
false;
900 if (base->object->type ==
OB_LAMP) {
901 Light *la_test =
static_cast<Light *
>(base->object->data);
913 bool changed =
false;
927 bool changed =
false;
941 bool changed =
false;
958 bool changed =
false;
970 "Use another Keying Set, as the active one depends on the currently "
971 "selected objects or cannot find any targets due to unsuitable context");
990 if (ksp->id == (
ID *)base->object) {
1010 bool changed =
false, extend;
1020 if (ob ==
nullptr) {
1080 ot->
name =
"Select Grouped";
1081 ot->
description =
"Select all visible objects grouped by various properties";
1082 ot->
idname =
"OBJECT_OT_select_grouped";
1097 "Extend selection instead of deselecting everything first");
1113 bool any_visible =
false;
1125 if (any_visible ==
false) {
1137 ot->
name =
"(De)select All";
1138 ot->
description =
"Change selection of all visible objects in scene";
1139 ot->
idname =
"OBJECT_OT_select_all";
1198 ot->
name =
"Select Same Collection";
1200 ot->
idname =
"OBJECT_OT_select_same_collection";
1214 "Name of the collection to select");
1237 if (!
STREQ(name_flip, primbase->object->id.name + 2)) {
1249 if (extend ==
false) {
1268 ot->
name =
"Select Mirror";
1270 "Select the mirror objects of the selected object e.g. \"L.sword\" and \"R.sword\"";
1271 ot->
idname =
"OBJECT_OT_select_mirror";
1284 "Extend selection instead of deselecting everything first");
1300 Object *ob = base->object;
1301 ob->
flag &= ~OB_DONE;
1302 ob->
id.
tag &= ~ID_TAG_DOIT;
1328 bool changed =
false;
1363 ot->
name =
"Select More";
1364 ot->
idname =
"OBJECT_OT_select_more";
1394 ot->
name =
"Select Less";
1395 ot->
idname =
"OBJECT_OT_select_less";
1396 ot->
description =
"Deselect objects at the boundaries of parent/child relationships";
1420 int elem_map_len = 0;
1421 Base **elem_map =
static_cast<Base **
>(
1425 elem_map[elem_map_len++] =
static_cast<Base *
>(
ptr.
data);
1429 const int count_select = elem_map_len * randfac;
1430 for (
int i = 0; i < count_select; i++) {
1447 ot->
name =
"Select Random";
1448 ot->
description =
"Select or deselect random visible objects";
1449 ot->
idname =
"OBJECT_OT_select_random";
C++ functions to deal with Armature collections (i.e. the successor of bone layers).
void ANIM_armature_bonecoll_show_from_ebone(bArmature *armature, const EditBone *ebone)
void ANIM_armature_bonecoll_show_from_pchan(bArmature *armature, const bPoseChannel *pchan)
Functionality to interact with keying sets.
Blender kernel action and pose functionality.
bPoseChannel * BKE_pose_channel_find_name(const bPose *pose, const char *name)
bool BKE_collection_has_object(Collection *collection, const Object *ob)
bool CTX_data_selectable_bases(const bContext *C, blender::Vector< PointerRNA > *list)
#define CTX_DATA_BEGIN(C, Type, instance, member)
Object * CTX_data_active_object(const bContext *C)
#define CTX_DATA_COUNT(C, member)
Scene * CTX_data_scene(const bContext *C)
Object * CTX_data_edit_object(const bContext *C)
Base * CTX_data_active_base(const bContext *C)
Main * CTX_data_main(const bContext *C)
View3D * CTX_wm_view3d(const bContext *C)
ViewLayer * CTX_data_view_layer(const bContext *C)
#define FOREACH_VISIBLE_BASE_END
void BKE_view_layer_synced_ensure(const Scene *scene, ViewLayer *view_layer)
Base * BKE_view_layer_active_base_get(ViewLayer *view_layer)
Object * BKE_view_layer_active_object_get(const ViewLayer *view_layer)
#define FOREACH_VISIBLE_BASE_BEGIN(_scene, _view_layer, _v3d, _instance)
Base * BKE_view_layer_base_find(ViewLayer *view_layer, Object *ob)
ListBase * BKE_view_layer_object_bases_get(ViewLayer *view_layer)
Object * BKE_view_layer_edit_object_get(const ViewLayer *view_layer)
ID * BKE_libblock_find_name(Main *bmain, short type, const char *name, const std::optional< Library * > lib=std::nullopt) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
General operations, lookup, etc. for materials.
struct Material * BKE_object_material_get(struct Object *ob, short act)
struct ParticleSystem * psys_get_current(struct Object *ob)
void BKE_report(ReportList *reports, eReportType type, const char *message)
void BKE_scene_object_base_flag_sync_from_base(Base *base)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
#define LISTBASE_FOREACH(type, var, list)
MINLINE bool compare_v3v3(const float v1[3], const float v2[3], float limit) ATTR_WARN_UNUSED_RESULT
void BLI_array_randomize(void *data, unsigned int elem_size, unsigned int elem_num, unsigned int seed)
size_t BLI_string_flip_side_name(char *name_dst, const char *name_src, bool strip_number, size_t name_dst_maxncpy) ATTR_NONNULL(1
#define BLT_I18NCONTEXT_ID_ID
void DEG_id_tag_update(ID *id, unsigned int flags)
Object groups, one object can be in many groups at once.
@ BASE_ENABLED_AND_MAYBE_VISIBLE_IN_VIEWPORT
#define OB_DATA_SUPPORT_ID(_id_type)
#define BASE_SELECTED(v3d, base)
#define BASE_SELECTABLE(v3d, base)
#define BASE_VISIBLE(v3d, base)
#define EBONE_SELECTABLE(arm, ebone)
void ED_outliner_select_sync_from_object_tag(bContext *C)
bool ED_operator_objectmode(bContext *C)
Read Guarded memory(de)allocation.
void UI_popup_menu_end(bContext *C, uiPopupMenu *pup)
uiPopupMenu * UI_popup_menu_begin(bContext *C, const char *title, int icon) ATTR_NONNULL()
uiLayout * UI_popup_menu_layout(uiPopupMenu *pup)
void uiItemStringO(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, const char *value)
bool ED_armature_edit_deselect_all(Object *obedit)
EditBone * ED_armature_ebone_find_name(const ListBase *edbo, const char *name)
void ED_armature_edit_sync_selection(ListBase *edbo)
void ED_armature_ebone_select_set(EditBone *ebone, bool select)
static int collection_count(const ListBase *lb)
static unsigned long seed
KeyingSet * ANIM_scene_get_active_keyingset(const Scene *scene)
blender::animrig::ModifyKeyReturn ANIM_validate_keyingset(bContext *C, blender::Vector< PointerRNA > *sources, KeyingSet *keyingset)
void *(* MEM_mallocN)(size_t len, const char *str)
void MEM_freeN(void *vmemh)
ccl_device_inline float4 select(const int4 mask, const float4 a, const float4 b)
static bool select_grouped_object_hooks(bContext *C, Object *ob)
static bool select_grouped_index_object(bContext *C, Object *ob)
bool jump_to_object(bContext *C, Object *ob, bool reveal_hidden)
static int object_select_same_collection_exec(bContext *C, wmOperator *op)
Base * find_first_by_data_id(const Scene *scene, ViewLayer *view_layer, ID *id)
void OBJECT_OT_select_more(wmOperatorType *ot)
static int object_select_random_exec(bContext *C, wmOperator *op)
void OBJECT_OT_select_mirror(wmOperatorType *ot)
static const EnumPropertyItem prop_select_grouped_types[]
static bool object_select_all_by_library_obdata(bContext *C, Library *lib)
void OBJECT_OT_select_all(wmOperatorType *ot)
static bool select_grouped_color(bContext *C, Object *ob)
void OBJECT_OT_select_same_collection(wmOperatorType *ot)
void base_activate(bContext *C, Base *base)
static int object_select_less_exec(bContext *C, wmOperator *)
static const EnumPropertyItem prop_select_linked_types[]
static bool select_grouped_parent(bContext *C)
void base_select(Base *base, eObjectSelect_Mode mode)
static bool object_select_all_by_material(bContext *C, Material *mat)
void OBJECT_OT_select_linked(wmOperatorType *ot)
static int object_select_more_exec(bContext *C, wmOperator *)
static int object_select_all_exec(bContext *C, wmOperator *op)
void OBJECT_OT_select_by_type(wmOperatorType *ot)
static bool select_grouped_children(bContext *C, Object *ob, const bool recursive)
static bool object_select_all_by_library(bContext *C, Library *lib)
@ OBJECT_SELECT_LINKED_LIBRARY
@ OBJECT_SELECT_LINKED_OBDATA
@ OBJECT_SELECT_LINKED_MATERIAL
@ OBJECT_SELECT_LINKED_IPO
@ OBJECT_SELECT_LINKED_PARTICLE
@ OBJECT_SELECT_LINKED_LIBRARY_OBDATA
@ OBJECT_SELECT_LINKED_DUPGROUP
static bool object_select_all_by_instance_collection(bContext *C, Object *ob)
static int object_select_mirror_exec(bContext *C, wmOperator *op)
void OBJECT_OT_select_less(wmOperatorType *ot)
static int object_select_grouped_exec(bContext *C, wmOperator *op)
static bool select_grouped_siblings(bContext *C, Object *ob)
static bool select_grouped_type(bContext *C, Object *ob)
static bool object_select_more_less(bContext *C, const bool select)
@ OBJECT_GRPSEL_LIGHT_TYPE
@ OBJECT_GRPSEL_CHILDREN_RECURSIVE
@ OBJECT_GRPSEL_KEYINGSET
@ OBJECT_GRPSEL_COLLECTION
static int object_select_linked_exec(bContext *C, wmOperator *op)
void base_activate_with_mode_exit_if_needed(bContext *C, Base *base)
static bool objects_selectable_poll(bContext *C)
bool editmode_exit_multi_ex(Main *bmain, Scene *scene, ViewLayer *view_layer, int flag)
static bool object_select_all_by_obdata(bContext *C, void *obdata)
bool jump_to_bone(bContext *C, Object *ob, const char *bone_name, bool reveal_hidden)
void base_active_refresh(Main *bmain, Scene *scene, ViewLayer *view_layer)
void select_linked_by_id(bContext *C, ID *id)
static bool object_select_all_by_particle(bContext *C, Object *ob)
void OBJECT_OT_select_grouped(wmOperatorType *ot)
static bool select_grouped_keyingset(bContext *C, Object *, ReportList *reports)
bool base_deselect_all(const Scene *scene, ViewLayer *view_layer, View3D *v3d, int action)
bool base_deselect_all_ex(const Scene *scene, ViewLayer *view_layer, View3D *v3d, int action, bool *r_any_visible)
static bool select_grouped_lighttype(bContext *C, Object *ob)
static int get_base_select_priority(Base *base)
void OBJECT_OT_select_random(wmOperatorType *ot)
bool mode_set(bContext *C, eObjectMode mode)
static bool select_grouped_collection(bContext *C, Object *ob)
static int object_select_by_type_exec(bContext *C, wmOperator *op)
#define COLLECTION_MENU_MAX
void ED_pose_bone_select_tag_update(Object *ob)
bool ED_pose_deselect_all(Object *ob, int select_mode, const bool ignore_visibility)
void ED_pose_bone_select(Object *ob, bPoseChannel *pchan, bool select, bool change_active)
void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
float RNA_float_get(PointerRNA *ptr, const char *name)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
const EnumPropertyItem rna_enum_object_type_items[]
struct Collection * instance_collection
int object_type_exclude_select
struct EditBone * act_edbone
bool(* poll)(bContext *C) ATTR_WARN_UNUSED_RESULT
int(* invoke)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
int(* exec)(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
static DynamicLibrary lib
void WM_main_add_notifier(uint type, void *reference)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
#define WM_msg_publish_rna_prop(mbus, id_, data_, type_, prop_)
int WM_operator_properties_select_random_seed_increment_get(wmOperator *op)
void WM_operator_properties_select_random(wmOperatorType *ot)
void WM_operator_properties_select_all(wmOperatorType *ot)
int WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *)