104 if (mbus !=
nullptr) {
113 view_layer->
basact = base;
152 bool any_visible =
false;
153 bool changed =
false;
186 *r_any_visible = any_visible;
226 Base *base_best =
nullptr;
227 int priority_best = 0;
230 if (base->object && base->object->data ==
id) {
237 if (priority_test > priority_best) {
238 priority_best = priority_test;
255 if (base ==
nullptr) {
302 if (ebone !=
nullptr) {
326 if (pchan !=
nullptr) {
362 if (obact && obact->
mode) {
380 short obtype, extend;
390 if (base->object->type == obtype) {
407 ot->name =
"Select by Type";
408 ot->description =
"Select all visible objects that are of a type";
409 ot->idname =
"OBJECT_OT_select_by_type";
424 "Extend selection instead of deselecting everything first");
454 {0,
nullptr, 0,
nullptr,
nullptr},
459 bool changed =
false;
463 if (base->object->data == obdata) {
476 bool changed =
false;
480 Object *ob = base->object;
484 for (a = 1; a <= ob->
totcol; a++) {
501 bool changed =
false;
509 base->object->instance_collection :
511 if (instance_collection == instance_collection_other) {
525 bool changed =
false;
531 if (psys->part == psys_act->
part) {
550 bool changed =
false;
554 if (
lib == base->object->id.lib) {
567 bool changed =
false;
571 if (base->object->data &&
lib == ((
ID *)base->object->data)->lib) {
584 int idtype =
GS(id->
name);
585 bool changed =
false;
590 else if (idtype ==
ID_MA) {
593 else if (idtype ==
ID_LI) {
611 bool changed =
false, extend;
633 if (ob->
data ==
nullptr) {
643 if (mat ==
nullptr) {
668 if (ob->
data ==
nullptr) {
691 ot->name =
"Select Linked";
692 ot->description =
"Select all visible objects that are linked";
693 ot->idname =
"OBJECT_OT_select_linked";
708 "Extend selection instead of deselecting everything first");
746 "Objects included in active Keying Set"},
748 {0,
nullptr, 0,
nullptr,
nullptr},
753 bool changed =
false;
756 if (ob == base->object->
parent) {
778 bool changed =
false;
797#define COLLECTION_MENU_MAX 24
802 bool changed =
false;
822 collection = ob_collections[0];
840 collection = ob_collections[
i];
842 "OBJECT_OT_select_same_collection", collection->
id.
name + 2, ICON_NONE);
856 bool changed =
false;
880 bool changed =
false;
895 bool changed =
false;
898 if (base->object->type ==
OB_LAMP) {
899 Light *la_test =
static_cast<Light *
>(base->object->data);
911 bool changed =
false;
925 bool changed =
false;
939 bool changed =
false;
956 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";
1199 ot->description =
"Select object in the 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;
1328 bool changed =
false;
1363 ot->name =
"Select More";
1364 ot->idname =
"OBJECT_OT_select_more";
1365 ot->description =
"Select connected parent/child objects";
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";
Functions to deal with Armatures.
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.
Material * BKE_object_material_get(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)
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
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)
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
void * MEM_mallocN(size_t len, const char *str)
void MEM_freeN(void *vmemh)
KeyingSet * scene_get_active_keyingset(const Scene *scene)
ModifyKeyReturn validate_keyingset(bContext *C, blender::Vector< PointerRNA > *sources, KeyingSet *keyingset)
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)
Base * find_first_by_data_id(const Scene *scene, ViewLayer *view_layer, ID *id)
void OBJECT_OT_select_more(wmOperatorType *ot)
static wmOperatorStatus object_select_more_exec(bContext *C, wmOperator *)
void OBJECT_OT_select_mirror(wmOperatorType *ot)
static wmOperatorStatus object_select_random_exec(bContext *C, wmOperator *op)
static const EnumPropertyItem prop_select_grouped_types[]
static wmOperatorStatus object_select_same_collection_exec(bContext *C, wmOperator *op)
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)
static wmOperatorStatus object_select_less_exec(bContext *C, wmOperator *)
void base_activate(bContext *C, Base *base)
static wmOperatorStatus object_select_all_exec(bContext *C, wmOperator *op)
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)
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)
static bool object_select_all_by_instance_collection(bContext *C, Object *ob)
void OBJECT_OT_select_less(wmOperatorType *ot)
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)
static wmOperatorStatus object_select_by_type_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 wmOperatorStatus object_select_mirror_exec(bContext *C, wmOperator *op)
@ 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_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 wmOperatorStatus object_select_linked_exec(bContext *C, wmOperator *op)
@ OBJECT_GRPSEL_LIGHT_TYPE
@ OBJECT_GRPSEL_CHILDREN_RECURSIVE
@ OBJECT_GRPSEL_KEYINGSET
@ OBJECT_GRPSEL_COLLECTION
static wmOperatorStatus object_select_grouped_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_set(PointerRNA *ptr, const char *name, const char *value)
float RNA_float_get(PointerRNA *ptr, const char *name)
std::string RNA_string_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
PointerRNA op(wmOperatorType *ot, std::optional< blender::StringRef > name, int icon, blender::wm::OpCallContext context, eUI_Item_Flag flag)
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)
wmOperatorStatus WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *)