59#define PBONE_PREV_FLAG_GET(pchan) ((void)0, POINTER_AS_INT((pchan)->temp))
60#define PBONE_PREV_FLAG_SET(pchan, val) ((pchan)->temp = POINTER_FROM_INT(val))
68 switch (select_mode) {
125 pchan->
bone->
flag &= ~BONE_SELECTED;
144 bool changed =
false;
156 else if (found ||
params->deselect_all) {
161 Object *ob_iter = base_iter->object;
192 bone->
flag &= ~BONE_SELECTED;
258 return changed || found;
273 if (!ob || !ob->
pose) {
278 Base *base_dummy =
nullptr;
280 {base}, hit_results, hits,
true, do_nearest, &base_dummy);
296 for (; md; md = md->
next) {
300 if (ob_arm !=
nullptr) {
302 if ((base_arm !=
nullptr) && (base_arm != base_select) && (base_arm->
flag &
BASE_SELECTED))
319 if (ob->
pose ==
nullptr) {
337 bool changed =
false;
341 int flag_prev = pchan->bone->
flag;
343 changed = (changed || flag_prev != pchan->bone->flag);
364 for (
Base *base : bases) {
365 Object *ob_iter = base->object;
375 const bool ignore_visibility)
382 bool changed_multi =
false;
383 for (
Base *base : bases) {
384 Object *ob_iter = base->object;
387 changed_multi =
true;
390 return changed_multi;
412 bone->
flag &= ~BONE_SELECTED;
427 Bone *bone, *curBone, *
next =
nullptr;
432 Base *base =
nullptr;
440 for (curBone = bone; curBone; curBone =
next) {
444 curBone->
flag &= ~BONE_SELECTED;
484 ot->
name =
"Select Connected";
485 ot->
idname =
"POSE_OT_select_linked_pick";
486 ot->
description =
"Select bones linked by parent/child connections under the mouse cursor";
501 "Extend selection instead of deselecting everything first");
517 for (curBone = pchan->bone; curBone; curBone =
next) {
549 ot->
name =
"Select Connected";
550 ot->
idname =
"POSE_OT_select_linked";
551 ot->
description =
"Select all bones linked by parent/child connections to the current selection";
568 int multipaint = scene->toolsettings->multipaint;
574 Object *ob_prev =
nullptr;
603 ot->
name =
"(De)select All";
650 ot->
name =
"Select Parent Bone";
651 ot->
idname =
"POSE_OT_select_parent";
652 ot->
description =
"Select bones that are parents of the currently selected bones";
671 ListBase targets = {
nullptr,
nullptr};
677 if ((ct->subtarget[0] !=
'\0') && (ob !=
nullptr) && (ob->
type ==
OB_ARMATURE) &&
708 ot->
name =
"Select Constraint Target";
709 ot->
idname =
"POSE_OT_select_constraint_target";
710 ot->
description =
"Select bones used as targets for the currently selected bones";
731 bool changed =
false;
734 if (pchan_act ==
nullptr) {
745 pchan_act->
bone->
flag &= ~BONE_SELECTED;
755 Bone *bone_child =
nullptr;
759 for (pass = 0; pass < 2 && (bone_child ==
nullptr); pass++) {
763 if (pchan_iter->parent == pchan_act) {
765 bone_child = pchan_iter->bone;
777 pchan_act->
bone->
flag &= ~BONE_SELECTED;
785 if (changed ==
false) {
801 {0,
nullptr, 0,
nullptr,
nullptr},
805 ot->
name =
"Select Hierarchy";
806 ot->
idname =
"POSE_OT_select_hierarchy";
807 ot->
description =
"Select immediate parent/children of selected bones";
836 bool changed_any_selection =
false;
850 pchan->bone->flag &= ~BONE_SELECTED;
851 updated_objects.
add(ob);
852 changed_any_selection =
true;
860 used_colors.
add(color);
864 Bone *bone = pchan->bone;
876 changed_any_selection =
true;
877 updated_objects.
add(ob);
881 if (!changed_any_selection) {
885 for (
Object *ob : updated_objects) {
893 bool changed_any_selection =
false;
905 pchan->bone->flag &= ~BONE_SELECTED;
906 updated_objects.
add(ob);
907 changed_any_selection =
true;
916 collection_names.
add(bcoll_ref->bcoll->name);
921 Bone *bone = pchan->bone;
927 if (!collection_names.
contains(bcoll_ref->bcoll->name)) {
932 changed_any_selection =
true;
933 updated_objects.
add(ob);
938 for (
Object *ob : updated_objects) {
942 return changed_any_selection;
949 bool changed_multi =
false;
962 "Use another Keying Set, as the active one depends on the currently "
963 "selected items or cannot find any targets due to unsuitable context");
973 if (extend ==
false) {
976 pchan->bone->flag &= ~BONE_SELECTED;
984 for (
const int ob_index : objects.index_range()) {
988 bool changed =
false;
991 if (
ELEM(
nullptr, ob, pose, arm)) {
1000 if ((ksp->id == &ob->
id) && (ksp->rna_path !=
nullptr)) {
1002 char boneName[
sizeof(pchan->
name)];
1018 if (changed || !extend) {
1020 changed_multi =
true;
1024 return changed_multi;
1032 bool changed =
false;
1035 if (ob->
pose ==
nullptr) {
1054 printf(
"pose_select_grouped() - Unknown selection type %d\n", type);
1074 "Same collections as the active bone"},
1080 "All bones affected by active Keying Set"},
1081 {0,
nullptr, 0,
nullptr,
nullptr},
1085 ot->
name =
"Select Grouped";
1086 ot->
description =
"Select all visible bones grouped by similar properties";
1087 ot->
idname =
"POSE_OT_select_grouped";
1102 "Extend selection instead of deselecting everything first");
1122 for (
Object *ob : objects) {
1140 flag_new |= flag_mirror;
1142 if (pchan->bone == arm->
act_bone) {
1143 pchan_mirror_act = pchan_mirror;
1147 if (active_only && !
ELEM(arm->
act_bone, pchan->bone, pchan_mirror->
bone)) {
1157 if (pchan_mirror_act) {
1161 if (is_weight_paint) {
1181 ot->
name =
"Select Mirror";
1182 ot->
idname =
"POSE_OT_select_mirror";
1194 ot->
srna,
"only_active",
false,
"Active Only",
"Only operate on the active bone");
C++ functions to deal with Armature collections (i.e. the successor of bone layers).
C++ part of the BoneColor DNA struct.
Functionality to interact with keying sets.
Blender kernel action and pose functionality.
bPoseChannel * BKE_pose_channel_find_name(const bPose *pose, const char *name)
bPoseChannel * BKE_pose_channel_get_mirrored(const bPose *pose, const char *name) ATTR_WARN_UNUSED_RESULT
bPoseChannel * BKE_pose_channel_active_if_bonecoll_visible(Object *ob) ATTR_WARN_UNUSED_RESULT
#define PBONE_VISIBLE(arm, bone)
#define PBONE_SELECTABLE(arm, bone)
void BKE_constraint_targets_flush(struct bConstraint *con, struct ListBase *targets, bool no_copy)
int BKE_constraint_targets_get(struct bConstraint *con, struct ListBase *r_targets)
#define CTX_DATA_BEGIN_WITH_ID(C, Type, instance, member, Type_id, instance_id)
bPoseChannel * CTX_data_active_pose_bone(const bContext *C)
#define CTX_DATA_BEGIN(C, Type, instance, member)
Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
Object * CTX_data_active_object(const bContext *C)
#define CTX_DATA_COUNT(C, member)
Scene * CTX_data_scene(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)
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)
Object * BKE_view_layer_edit_object_get(const ViewLayer *view_layer)
ModifierData * BKE_modifiers_get_virtual_modifierlist(const Object *ob, VirtualModifierData *data)
General operations, lookup, etc. for blender objects.
blender::Vector< Base * > BKE_object_pose_base_array_get_unique(const Scene *scene, ViewLayer *view_layer, View3D *v3d)
Object * BKE_object_pose_armature_get(Object *ob)
blender::Vector< Object * > BKE_object_pose_array_get_unique(const Scene *scene, ViewLayer *view_layer, View3D *v3d)
void BKE_report(ReportList *reports, eReportType type, const char *message)
#define BLI_assert_unreachable()
#define LISTBASE_FOREACH(type, var, list)
bool bool BLI_str_quoted_substr(const char *__restrict str, const char *__restrict prefix, char *result, size_t result_maxncpy)
void DEG_id_tag_update(ID *id, unsigned int flags)
#define OB_MODE_ALL_WEIGHT_PAINT
Object is a sort of wrapper for general info.
#define BASE_SELECTED(v3d, base)
#define BONE_SELECT_CHILD
#define BONE_SELECT_PARENT
void ED_outliner_select_sync_from_pose_bone_tag(bContext *C)
bool ED_operator_view3d_active(bContext *C)
bool ED_operator_posemode(bContext *C)
ViewContext ED_view3d_viewcontext_init(bContext *C, Depsgraph *depsgraph)
void view3d_operator_needs_opengl(const bContext *C)
Read Guarded memory(de)allocation.
Bone * ED_armature_pick_bone_from_selectbuffer(blender::Span< Base * > bases, const GPUSelectResult *hit_results, int hits, bool findunsel, bool do_nearest, Base **r_base)
Bone * ED_armature_pick_bone(bContext *C, const int xy[2], bool findunsel, Base **r_base)
bool contains(const Key &key) const
const Depsgraph * depsgraph
KeyingSet * ANIM_scene_get_active_keyingset(const Scene *scene)
blender::animrig::ModifyKeyReturn ANIM_validate_keyingset(bContext *C, blender::Vector< PointerRNA > *sources, KeyingSet *keyingset)
ccl_device_inline float4 select(const int4 mask, const float4 a, const float4 b)
const BoneColor & ANIM_bonecolor_posebone_get(const bPoseChannel *pose_bone)
void base_select(Base *base, eObjectSelect_Mode mode)
void vgroup_select_by_name(Object *ob, const char *name)
static bool pose_select_same_collection(bContext *C, const bool extend)
void POSE_OT_select_parent(wmOperatorType *ot)
void ED_armature_pose_select_in_wpaint_mode(const Scene *scene, ViewLayer *view_layer, Base *base_select)
#define PBONE_PREV_FLAG_SET(pchan, val)
static int pose_select_hierarchy_exec(bContext *C, wmOperator *op)
bool ED_armature_pose_select_pick_with_buffer(const Scene *scene, ViewLayer *view_layer, View3D *v3d, Base *base, const GPUSelectResult *hit_results, const int hits, const SelectPick_Params *params, bool do_nearest)
bool ED_armature_pose_select_pick_bone(const Scene *scene, ViewLayer *view_layer, View3D *v3d, Object *ob, Bone *bone, const SelectPick_Params *params)
static bool ed_pose_is_any_selected_multi(const Span< Base * > bases, bool ignore_visibility)
void POSE_OT_select_hierarchy(wmOperatorType *ot)
void POSE_OT_select_grouped(wmOperatorType *ot)
void POSE_OT_select_linked_pick(wmOperatorType *ot)
static void pose_do_bone_select(bPoseChannel *pchan, const int select_mode)
static int pose_select_linked_exec(bContext *C, wmOperator *)
void ED_pose_bone_select_tag_update(Object *ob)
bool ED_pose_deselect_all(Object *ob, int select_mode, const bool ignore_visibility)
static int pose_select_connected_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void POSE_OT_select_mirror(wmOperatorType *ot)
bool ED_pose_deselect_all_multi_ex(const Span< Base * > bases, int select_mode, const bool ignore_visibility)
static bool ed_pose_is_any_selected(Object *ob, bool ignore_visibility)
bool ED_pose_deselect_all_multi(bContext *C, int select_mode, const bool ignore_visibility)
static int pose_select_mirror_exec(bContext *C, wmOperator *op)
void POSE_OT_select_all(wmOperatorType *ot)
void POSE_OT_select_constraint_target(wmOperatorType *ot)
static bool pose_select_linked_pick_poll(bContext *C)
@ POSE_SEL_SAME_COLLECTION
@ POSE_SEL_SAME_KEYINGSET
static int pose_de_select_all_exec(bContext *C, wmOperator *op)
static int pose_select_parent_exec(bContext *C, wmOperator *)
static bool pose_select_same_keyingset(bContext *C, ReportList *reports, bool extend)
void ED_pose_bone_select(Object *ob, bPoseChannel *pchan, bool select, bool change_active)
static int pose_select_constraint_target_exec(bContext *C, wmOperator *)
void POSE_OT_select_linked(wmOperatorType *ot)
#define PBONE_PREV_FLAG_GET(pchan)
static bool pose_select_same_color(bContext *C, const bool extend)
static void selectconnected_posebonechildren(Object *ob, Bone *bone, int extend)
static int pose_select_grouped_exec(bContext *C, wmOperator *op)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
int RNA_enum_get(PointerRNA *ptr, const char *name)
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_flag(PropertyRNA *prop, PropertyFlag flag)
struct ModifierData * next
struct bPoseChannel * parent
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
void WM_main_add_notifier(uint type, void *reference)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void WM_operator_properties_select_all(wmOperatorType *ot)
int WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *)