51 #define PBONE_PREV_FLAG_GET(pchan) ((void)0, (POINTER_AS_INT((pchan)->temp)))
52 #define PBONE_PREV_FLAG_SET(pchan, val) ((pchan)->temp = POINTER_FROM_INT(val))
60 switch (select_mode) {
131 bool changed =
false;
133 if (ob || ob->
pose) {
143 else if (found ||
params->deselect_all) {
148 Object *ob_iter = base_iter->object;
243 return changed || found;
257 if (!ob || !ob->
pose) {
264 &base, 1,
buffer, hits, 1, do_nearest, &base_dummy);
278 &virtualModifierData);
279 for (; md; md = md->
next) {
283 if (ob_arm !=
NULL) {
285 if ((base_arm !=
NULL) && (base_arm != base_select) &&
296 for (; md; md = md->
next) {
300 if (ob_arm !=
NULL) {
302 if ((base_arm !=
NULL) && (base_arm != base_select) &&
339 bool changed =
false;
345 changed = (changed || flag_prev != pchan->
bone->
flag);
366 for (
uint base_index = 0; base_index < bases_len; base_index++) {
378 const bool ignore_visibility)
386 bool changed_multi =
false;
387 for (
uint base_index = 0; base_index < bases_len; base_index++) {
391 changed_multi =
true;
394 return changed_multi;
406 bases, bases_len, select_mode, ignore_visibility);
408 return changed_multi;
451 for (curBone = bone; curBone; curBone =
next) {
495 ot->
name =
"Select Connected";
496 ot->
idname =
"POSE_OT_select_linked_pick";
497 ot->
description =
"Select bones linked by parent/child connections under the mouse cursor";
512 "Extend selection instead of deselecting everything first");
528 for (curBone = pchan->bone; curBone; curBone =
next) {
560 ot->
name =
"Select Connected";
561 ot->
idname =
"POSE_OT_select_linked";
562 ot->
description =
"Select all bones linked by parent/child connections to the current selection";
614 ot->
name =
"(De)select All";
661 ot->
name =
"Select Parent Bone";
662 ot->
idname =
"POSE_OT_select_parent";
663 ot->
description =
"Select bones that are parents of the currently selected bones";
682 for (con = pchan->constraints.first; con; con = con->
next) {
687 for (ct = targets.
first; ct; ct = ct->
next) {
721 ot->
name =
"Select Constraint Target";
722 ot->
idname =
"POSE_OT_select_constraint_target";
723 ot->
description =
"Select bones used as targets for the currently selected bones";
744 bool changed =
false;
747 if (pchan_act ==
NULL) {
773 for (pass = 0; pass < 2 && (bone_child ==
NULL); pass++) {
777 if (pchan_iter->
parent == pchan_act) {
779 bone_child = pchan_iter->
bone;
799 if (changed ==
false) {
819 ot->
name =
"Select Hierarchy";
820 ot->
idname =
"POSE_OT_select_hierarchy";
821 ot->
description =
"Select immediate parent/children of selected bones";
848 bool *group_flags_array;
849 bool *group_flags =
NULL;
851 bool changed =
false, tagged =
false;
855 uint objects_len = 0;
858 for (ob_index = 0; ob_index < objects_len; ob_index++) {
873 if (groups_len == 0) {
883 group_flags_array =
MEM_callocN(objects_len * groups_len *
sizeof(
bool),
884 "pose_select_same_group");
892 group_flags = group_flags_array + (ob_index * groups_len);
898 group_flags[pchan->agrp_index] =
true;
918 group_flags = group_flags_array + (ob_index * groups_len);
924 if (group_flags[pchan->agrp_index]) {
933 for (ob_index = 0; ob_index < objects_len; ob_index++) {
934 Object *ob = objects[ob_index];
951 int *layers_array, *layers =
NULL;
954 bool changed =
false;
956 uint objects_len = 0;
959 for (ob_index = 0; ob_index < objects_len; ob_index++) {
960 Object *ob = objects[ob_index];
964 layers_array =
MEM_callocN(objects_len *
sizeof(*layers_array),
"pose_select_same_layer");
972 layers = &layers_array[++ob_index];
978 *layers |= pchan->bone->layer;
988 bool any_layer =
false;
989 for (ob_index = 0; ob_index < objects_len; ob_index++) {
990 if (layers_array[ob_index]) {
1004 if (ob != ob_prev) {
1005 layers = &layers_array[++ob_index];
1010 if ((*layers & pchan->bone->layer) && (pchan->bone->flag &
BONE_UNSELECTABLE) == 0) {
1017 for (ob_index = 0; ob_index < objects_len; ob_index++) {
1018 Object *ob = objects[ob_index];
1036 bool changed_multi =
false;
1050 "Use another Keying Set, as the active one depends on the currently "
1051 "selected items or cannot find any targets due to unsuitable context");
1061 if (extend ==
false) {
1070 uint objects_len = 0;
1073 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
1077 bool changed =
false;
1091 char boneName[
sizeof(pchan->
name)];
1107 if (changed || !extend) {
1109 changed_multi =
true;
1114 return changed_multi;
1122 bool changed =
false;
1144 printf(
"pose_select_grouped() - Unknown selection type %u\n",
type);
1166 "All bones affected by active Keying Set"},
1171 ot->
name =
"Select Grouped";
1172 ot->
description =
"Select all visible bones grouped by similar properties";
1173 ot->
idname =
"POSE_OT_select_grouped";
1188 "Extend selection instead of deselecting everything first");
1206 uint objects_len = 0;
1209 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
1210 Object *ob = objects[ob_index];
1227 flag_new |= flag_mirror;
1230 pchan_mirror_act = pchan_mirror;
1244 if (pchan_mirror_act) {
1248 if (is_weight_paint) {
1269 ot->
name =
"Select Mirror";
1270 ot->
idname =
"POSE_OT_select_mirror";
1282 ot->
srna,
"only_active",
false,
"Active Only",
"Only operate on the active bone");
Blender kernel action and pose functionality.
struct bPoseChannel * BKE_pose_channel_find_name(const struct bPose *pose, const char *name)
struct bPoseChannel * BKE_pose_channel_active_if_layer_visible(struct Object *ob)
struct bPoseChannel * BKE_pose_channel_get_mirrored(const struct bPose *pose, const char *name)
#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)
struct Scene * CTX_data_scene(const bContext *C)
#define CTX_DATA_BEGIN(C, Type, instance, member)
struct ViewLayer * CTX_data_view_layer(const bContext *C)
struct Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
struct Object * CTX_data_active_object(const bContext *C)
struct View3D * CTX_wm_view3d(const bContext *C)
#define CTX_DATA_COUNT(C, member)
struct bPoseChannel * CTX_data_active_pose_bone(const bContext *C)
struct GpencilModifierData * BKE_gpencil_modifiers_get_virtual_modifierlist(const struct Object *ob, struct GpencilVirtualModifierData *data)
#define FOREACH_VISIBLE_BASE_END
#define FOREACH_VISIBLE_BASE_BEGIN(_view_layer, _v3d, _instance)
struct Base * BKE_view_layer_base_find(struct ViewLayer *view_layer, struct Object *ob)
struct ModifierData * BKE_modifiers_get_virtual_modifierlist(const struct Object *ob, struct VirtualModifierData *data)
General operations, lookup, etc. for blender objects.
struct Object * BKE_object_pose_armature_get(struct Object *ob)
struct Object ** BKE_object_pose_array_get_unique(struct ViewLayer *view_layer, struct View3D *v3d, unsigned int *r_objects_len)
struct Base ** BKE_object_pose_base_array_get_unique(struct ViewLayer *view_layer, struct View3D *v3d, unsigned int *r_bases_len)
void BKE_report(ReportList *reports, eReportType type, const char *message)
#define BLI_assert_unreachable()
#define LISTBASE_FOREACH(type, var, list)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
bool bool BLI_str_quoted_substr(const char *__restrict str, const char *__restrict prefix, char *result, size_t result_maxlen)
struct Depsgraph Depsgraph
void DEG_id_tag_update(struct ID *id, int flag)
@ ID_RECALC_COPY_ON_WRITE
@ eGpencilModifierType_Armature
#define OB_MODE_ALL_WEIGHT_PAINT
Object is a sort of wrapper for general info.
#define OBEDIT_FROM_VIEW_LAYER(view_layer)
#define OBACT(_view_layer)
#define BONE_SELECT_CHILD
#define BONE_SELECT_PARENT
void ED_vgroup_select_by_name(struct Object *ob, const char *name)
void ED_object_base_select(struct Base *base, eObjectSelect_Mode mode)
void ED_outliner_select_sync_from_pose_bone_tag(struct bContext *C)
bool ED_operator_posemode(struct bContext *C)
bool ED_operator_view3d_active(struct bContext *C)
void ED_view3d_viewcontext_init(struct bContext *C, struct ViewContext *vc, struct Depsgraph *depsgraph)
void view3d_operator_needs_opengl(const struct bContext *C)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
Read Guarded memory(de)allocation.
struct Bone * ED_armature_pick_bone(struct bContext *C, const int xy[2], bool findunsel, struct Base **r_base)
struct Bone * ED_armature_pick_bone_from_selectbuffer(struct Base **bases, uint bases_len, const struct GPUSelectResult *buffer, short hits, bool findunsel, bool do_nearest, struct Base **r_base)
__forceinline const avxb select(const avxb &m, const avxb &t, const avxb &f)
const Depsgraph * depsgraph
ccl_global float * buffer
eModifyKey_Returns ANIM_validate_keyingset(bContext *C, ListBase *dsources, KeyingSet *ks)
KeyingSet * ANIM_scene_get_active_keyingset(const Scene *scene)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
static const EnumPropertyItem prop_select_grouped_types[]
void POSE_OT_select_parent(wmOperatorType *ot)
static bool pose_select_same_group(bContext *C, bool extend)
bool ED_pose_deselect_all_multi_ex(Base **bases, uint bases_len, int select_mode, const bool ignore_visibility)
#define PBONE_PREV_FLAG_SET(pchan, val)
static bool ed_pose_is_any_selected_multi(Base **bases, uint bases_len, bool ignore_visibility)
static int pose_select_hierarchy_exec(bContext *C, wmOperator *op)
static int pose_select_linked_exec(bContext *C, wmOperator *UNUSED(op))
bool ED_armature_pose_select_pick_bone(ViewLayer *view_layer, View3D *v3d, Object *ob, Bone *bone, const struct SelectPick_Params *params)
static int pose_select_constraint_target_exec(bContext *C, wmOperator *UNUSED(op))
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 bool pose_select_same_layer(bContext *C, bool extend)
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)
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_KEYINGSET
static int pose_de_select_all_exec(bContext *C, wmOperator *op)
bool ED_armature_pose_select_pick_with_buffer(ViewLayer *view_layer, View3D *v3d, Base *base, const struct GPUSelectResult *buffer, const short hits, const struct SelectPick_Params *params, bool do_nearest)
static int pose_select_parent_exec(bContext *C, wmOperator *UNUSED(op))
void ED_armature_pose_select_in_wpaint_mode(ViewLayer *view_layer, Base *base_select)
static bool pose_select_same_keyingset(bContext *C, ReportList *reports, bool extend)
void POSE_OT_select_linked(wmOperatorType *ot)
#define PBONE_PREV_FLAG_GET(pchan)
static void selectconnected_posebonechildren(Object *ob, Bone *bone, int extend)
void ED_pose_bone_select(Object *ob, bPoseChannel *pchan, bool select)
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_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
struct GpencilModifierData * next
struct ModifierData * next
struct ToolSettings * toolsettings
struct ViewLayer * view_layer
struct bConstraintTarget * next
struct bConstraint * next
struct bPoseChannel * parent
struct bPoseChannel * next
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
void WM_main_add_notifier(unsigned int 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 *UNUSED(event))