104 wmMsgBus *mbus = (bmain->
wm.first())->runtime->message_bus;
105 if (mbus !=
nullptr) {
114 view_layer->
basact = base;
157 bool any_visible =
false;
158 bool changed =
false;
191 *r_any_visible = any_visible;
232 Base *base_best =
nullptr;
233 int priority_best = 0;
236 if (base.object && base.object->data ==
id) {
243 if (priority_test > priority_best) {
244 priority_best = priority_test;
262 if (base ==
nullptr) {
310 if (ebone !=
nullptr) {
335 if (pchan !=
nullptr) {
346 arm->
act_bone = pchan->bone_get(*ob);
372 if (obact && obact->
mode) {
391 short obtype, extend;
401 if (base->object->type == obtype) {
418 ot->
name =
"Select by Type";
419 ot->
description =
"Select all visible objects that are of a type";
420 ot->
idname =
"OBJECT_OT_select_by_type";
435 "Extend selection instead of deselecting everything first");
465 {0,
nullptr, 0,
nullptr,
nullptr},
470 bool changed =
false;
474 if (base->object->data == obdata) {
487 bool changed =
false;
491 Object *ob = base->object;
495 for (a = 1; a <= ob->
totcol; a++) {
512 bool changed =
false;
520 base->object->instance_collection :
522 if (instance_collection == instance_collection_other) {
535 bool changed =
false;
560 bool changed =
false;
564 if (lib == base->object->
id.
lib) {
577 bool changed =
false;
581 if (base->object->data && lib == (base->object->data)->lib) {
594 int idtype =
GS(
id->name);
595 bool changed =
false;
600 else if (idtype ==
ID_MA) {
603 else if (idtype ==
ID_LI) {
622 bool changed =
false, extend;
644 if (ob->
data ==
nullptr) {
654 if (mat ==
nullptr) {
669 if (psys_act ==
nullptr) {
680 if (ob->
data ==
nullptr) {
703 ot->
name =
"Select Linked";
704 ot->
description =
"Select all visible objects that are linked";
705 ot->
idname =
"OBJECT_OT_select_linked";
720 "Extend selection instead of deselecting everything first");
758 "Objects included in active Keying Set"},
760 {0,
nullptr, 0,
nullptr,
nullptr},
765 bool changed =
false;
768 if (ob == base->object->
parent) {
791 bool changed =
false;
810#define COLLECTION_MENU_MAX 24
815 bool changed =
false;
817 int collection_count = 0, i;
824 ob_collections[collection_count] = collection;
829 if (!collection_count) {
832 if (collection_count == 1) {
833 collection = ob_collections[0];
856 for (i = 0; i < collection_count; i++) {
857 collection = ob_collections[i];
859 "OBJECT_OT_select_same_collection", collection->
id.
name + 2, ICON_NONE);
863 popup_menu_end(
C, pup);
874 bool changed =
false;
898 bool changed =
false;
913 bool changed =
false;
916 if (base->object->type ==
OB_LAMP) {
917 Light *la_test = id_cast<Light *>(base->object->data);
929 bool changed =
false;
943 bool changed =
false;
957 bool changed =
false;
974 bool changed =
false;
982 if (ks->
paths.first_ ==
nullptr) {
986 "Use another Keying Set, as the active one depends on the currently "
987 "selected objects or cannot find any targets due to unsuitable context");
1006 if (ksp.
id == id_cast<ID *>(base->object)) {
1027 bool changed =
false, extend;
1037 if (ob ==
nullptr) {
1097 ot->
name =
"Select Grouped";
1098 ot->
description =
"Select all visible objects grouped by various properties";
1099 ot->
idname =
"OBJECT_OT_select_grouped";
1114 "Extend selection instead of deselecting everything first");
1131 bool any_visible =
false;
1143 if (any_visible ==
false) {
1155 ot->
name =
"(De)select All";
1156 ot->
description =
"Change selection of all visible objects in scene";
1157 ot->
idname =
"OBJECT_OT_select_all";
1216 ot->
name =
"Select Same Collection";
1217 ot->
description =
"Select object in the same collection";
1218 ot->
idname =
"OBJECT_OT_select_same_collection";
1232 "Name of the collection to select");
1255 if (!
STREQ(name_flip, primbase->object->id.name + 2)) {
1267 if (extend ==
false) {
1286 ot->
name =
"Select Mirror";
1288 "Select the mirror objects of the selected object e.g. \"L.sword\" and \"R.sword\"";
1289 ot->
idname =
"OBJECT_OT_select_mirror";
1302 "Extend selection instead of deselecting everything first");
1319 Object *ob = base.object;
1338 Object *ob = (
static_cast<Base *
>(ptr.data))->
object;
1347 bool changed =
false;
1352 Base *base =
static_cast<Base *
>(ptr.data);
1382 ot->
name =
"Select More";
1383 ot->
idname =
"OBJECT_OT_select_more";
1384 ot->
description =
"Select connected parent/child objects";
1413 ot->
name =
"Select Less";
1414 ot->
idname =
"OBJECT_OT_select_less";
1415 ot->
description =
"Deselect objects at the boundaries of parent/child relationships";
1439 int elem_map_len = 0;
1443 elem_map[elem_map_len++] =
static_cast<Base *
>(ptr.data);
1447 const int count_select = elem_map_len * randfac;
1448 for (
int i = 0; i < count_select; i++) {
1451 MEM_delete(elem_map);
1465 ot->
name =
"Select Random";
1466 ot->
description =
"Select or deselect random visible objects";
1467 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).
Functionality to interact with keying sets.
Blender kernel action and pose functionality.
#define CTX_DATA_BEGIN(C, Type, instance, member)
#define CTX_DATA_COUNT(C, member)
#define FOREACH_VISIBLE_BASE_END
#define FOREACH_VISIBLE_BASE_BEGIN(_bmain, _scene, _view_layer, _v3d, _instance)
General operations, lookup, etc. for materials.
#define BLT_I18NCONTEXT_ID_ID
Object groups, one object can be in many groups at once.
#define OB_DATA_SUPPORT_ID(_id_type)
#define BASE_VISIBLE(v3d, base)
#define EBONE_SELECTABLE(arm, ebone)
Read Blender memory allocation and freeing.
KeyingSet * scene_get_active_keyingset(const Scene *scene)
ModifyKeyReturn validate_keyingset(bContext *C, 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)
static bool select_grouped_collection(bContext *C, Object *ob, ReportList *reports)
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)
bool base_deselect_all_ex(const Main &bmain, const Scene *scene, ViewLayer *view_layer, View3D *v3d, int action, bool *r_any_visible)
static bool object_select_more_less(bContext *C, const bool select)
Base * find_first_by_data_id(const Main &bmain, const Scene *scene, ViewLayer *view_layer, ID *id)
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)
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, const ParticleSystem *psys_act)
void OBJECT_OT_select_grouped(wmOperatorType *ot)
static bool select_grouped_keyingset(bContext *C, Object *, ReportList *reports)
static bool select_grouped_lighttype(bContext *C, Object *ob)
static int get_base_select_priority(Base *base)
void OBJECT_OT_select_random(wmOperatorType *ot)
@ OBJECT_GRPSEL_LIGHT_TYPE
@ OBJECT_GRPSEL_CHILDREN_RECURSIVE
@ OBJECT_GRPSEL_KEYINGSET
@ OBJECT_GRPSEL_COLLECTION
bool mode_set(bContext *C, eObjectMode mode)
bool base_deselect_all(const Main &bmain, const Scene *scene, ViewLayer *view_layer, View3D *v3d, int action)
static wmOperatorStatus object_select_linked_exec(bContext *C, wmOperator *op)
static wmOperatorStatus object_select_grouped_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
PopupMenu * popup_menu_begin(bContext *C, const char *title, int icon) ATTR_NONNULL()
void WM_main_add_notifier(uint type, void *reference)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
wmOperatorStatus WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *)
int RNA_enum_get(PointerRNA *ptr, const char *name)
Object * BKE_view_layer_active_object_get(const ViewLayer *view_layer)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
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()
void WM_operator_properties_select_random(wmOperatorType *ot)
void * MEM_new_array_uninitialized(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
void ED_outliner_select_sync_from_pose_bone_tag(bContext *C)
const EnumPropertyItem rna_enum_object_type_items[]
struct ParticleSystem * psys_get_current(struct Object *ob)
@ BASE_ENABLED_AND_MAYBE_VISIBLE_IN_VIEWPORT
Material * BKE_object_material_get(Object *ob, short act)
int WM_operator_properties_select_random_seed_increment_get(wmOperator *op)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
wmWindow * CTX_wm_window(const bContext *C)
Base * BKE_view_layer_active_base_get(ViewLayer *view_layer)
Base * CTX_data_active_base(const bContext *C)
ViewLayer * CTX_data_view_layer(const bContext *C)
void ED_outliner_select_sync_from_object_tag(bContext *C)
void WM_operator_properties_select_all(wmOperatorType *ot)
void BLI_array_randomize(void *data, unsigned int elem_size, unsigned int elem_num, unsigned int seed)
bool BKE_collection_has_object(Collection *collection, const Object *ob)
Object * BKE_view_layer_edit_object_get(const ViewLayer *view_layer)
void DEG_id_tag_update(ID *id, unsigned int flags)
void BKE_report(ReportList *reports, eReportType type, const char *message)
void ED_armature_edit_sync_selection(ListBaseT< EditBone > *edbo)
bool ED_pose_deselect_all(Object *ob, int select_mode, const bool ignore_visibility)
Object * CTX_data_edit_object(const bContext *C)
void BKE_scene_object_base_flag_sync_from_base(Base *base)
void ED_pose_bone_select(Object *ob, bPoseChannel *pchan, bool select, bool change_active)
bool BKE_view_layer_synced_ensure(const Main &bmain, const Scene *scene, ViewLayer *view_layer)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void ED_pose_bone_select_tag_update(Object *ob)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void ANIM_armature_bonecoll_show_from_ebone(bArmature *armature, const EditBone *ebone)
bool ED_operator_objectmode(bContext *C)
MINLINE bool compare_v3v3(const float v1[3], const float v2[3], float limit) ATTR_WARN_UNUSED_RESULT
void ANIM_armature_bonecoll_show_from_pchan(bArmature *armature, const bPoseChannel *pchan)
Main * CTX_data_main(const bContext *C)
ID_Type GS(const char *name)
Base * BKE_view_layer_base_find(ViewLayer *view_layer, Object *ob)
void ED_outliner_select_sync_from_edit_bone_tag(bContext *C)
Scene * CTX_data_scene(const bContext *C)
std::string RNA_string_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
Object * CTX_data_active_object(const bContext *C)
void ED_armature_ebone_select_set(EditBone *ebone, bool select)
ListBaseT< Base > * BKE_view_layer_object_bases_get(ViewLayer *view_layer)
float RNA_float_get(PointerRNA *ptr, const char *name)
bPoseChannel * BKE_pose_channel_find_name(const bPose *pose, const char *name)
View3D * CTX_wm_view3d(const bContext *C)
EditBone * ED_armature_ebone_find_name(const ListBaseT< EditBone > *edbo, const char *name)
bool CTX_data_selectable_bases(const bContext *C, Vector< PointerRNA > *list)
bool ED_armature_edit_deselect_all(Object *obedit)
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 COLLECTION_MENU_MAX
ListBaseT< KS_Path > paths
ListBaseT< wmWindowManager > wm
ListBaseT< Collection > collections
ListBaseT< ModifierData > modifiers
eObject_TransFlag transflag
struct Collection * instance_collection
int object_type_exclude_select
ListBaseT< EditBone > * edbo
struct EditBone * act_edbone
PointerRNA op(wmOperatorType *ot, std::optional< StringRef > name, int icon, wm::OpCallContext context, eUI_Item_Flag flag)
wmOperatorStatus(*) exec(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
bool(*) poll(bContext *C) ATTR_WARN_UNUSED_RESULT
wmOperatorStatus(*) invoke(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
#define WM_msg_publish_rna_prop(mbus, id_, data_, type_, prop_)