67 #define PBONE_PREV_FLAG_GET(pchan) ((void)0, (POINTER_AS_INT((pchan)->temp)))
68 #define PBONE_PREV_FLAG_SET(pchan, val) ((pchan)->temp = POINTER_FROM_INT(val))
76 switch (select_mode) {
149 if (!ob || !ob->
pose) {
170 if (!extend && !deselect && toggle) {
176 if (!extend && !deselect && !toggle) {
181 Object *ob_iter = base_iter->object;
258 if (!ob || !ob->
pose) {
265 &base, 1,
buffer, hits, 1, do_nearest, &base_dummy);
269 return nearBone !=
NULL;
289 &virtualModifierData);
290 for (; md; md = md->
next) {
294 if (ob_arm !=
NULL) {
296 if ((base_arm !=
NULL) && (base_arm != base_select) &&
307 for (; md; md = md->
next) {
311 if (ob_arm !=
NULL) {
313 if ((base_arm !=
NULL) && (base_arm != base_select) &&
353 bool changed =
false;
359 changed = (changed || flag_prev != pchan->
bone->
flag);
380 for (
uint base_index = 0; base_index < bases_len; base_index++) {
392 const bool ignore_visibility)
400 bool changed_multi =
false;
401 for (
uint base_index = 0; base_index < bases_len; base_index++) {
405 changed_multi =
true;
408 return changed_multi;
420 bases, bases_len, select_mode, ignore_visibility);
422 return changed_multi;
465 for (curBone = bone; curBone; curBone =
next) {
507 ot->
name =
"Select Connected";
508 ot->
idname =
"POSE_OT_select_linked_pick";
509 ot->
description =
"Select bones linked by parent/child connections under the mouse cursor";
524 "Extend selection instead of deselecting everything first");
539 for (curBone = pchan->bone; curBone; curBone =
next) {
571 ot->
name =
"Select Connected";
572 ot->
idname =
"POSE_OT_select_linked";
573 ot->
description =
"Select all bones linked by parent/child connections to the current selection";
625 ot->
name =
"(De)select All";
672 ot->
name =
"Select Parent Bone";
673 ot->
idname =
"POSE_OT_select_parent";
674 ot->
description =
"Select bones that are parents of the currently selected bones";
693 for (con = pchan->constraints.first; con; con = con->
next) {
701 for (ct = targets.
first; ct; ct = ct->
next) {
737 ot->
name =
"Select Constraint Target";
738 ot->
idname =
"POSE_OT_select_constraint_target";
739 ot->
description =
"Select bones used as targets for the currently selected bones";
760 bool changed =
false;
763 if (pchan_act ==
NULL) {
789 for (pass = 0; pass < 2 && (bone_child ==
NULL); pass++) {
793 if (pchan_iter->
parent == pchan_act) {
795 bone_child = pchan_iter->
bone;
815 if (changed ==
false) {
835 ot->
name =
"Select Hierarchy";
836 ot->
idname =
"POSE_OT_select_hierarchy";
837 ot->
description =
"Select immediate parent/children of selected bones";
864 bool *group_flags_array;
865 bool *group_flags =
NULL;
867 bool changed =
false, tagged =
false;
871 uint objects_len = 0;
874 for (ob_index = 0; ob_index < objects_len; ob_index++) {
889 if (groups_len == 0) {
899 group_flags_array =
MEM_callocN(objects_len * groups_len *
sizeof(
bool),
900 "pose_select_same_group");
908 group_flags = group_flags_array + (ob_index * groups_len);
914 group_flags[pchan->agrp_index] =
true;
934 group_flags = group_flags_array + (ob_index * groups_len);
940 if (group_flags[pchan->agrp_index]) {
949 for (ob_index = 0; ob_index < objects_len; ob_index++) {
950 Object *ob = objects[ob_index];
967 int *layers_array, *layers =
NULL;
970 bool changed =
false;
972 uint objects_len = 0;
975 for (ob_index = 0; ob_index < objects_len; ob_index++) {
976 Object *ob = objects[ob_index];
980 layers_array =
MEM_callocN(objects_len *
sizeof(*layers_array),
"pose_select_same_layer");
988 layers = &layers_array[++ob_index];
994 *layers |= pchan->bone->layer;
1004 bool any_layer =
false;
1005 for (ob_index = 0; ob_index < objects_len; ob_index++) {
1006 if (layers_array[ob_index]) {
1020 if (ob != ob_prev) {
1021 layers = &layers_array[++ob_index];
1026 if ((*layers & pchan->bone->layer) && (pchan->bone->flag &
BONE_UNSELECTABLE) == 0) {
1033 for (ob_index = 0; ob_index < objects_len; ob_index++) {
1034 Object *ob = objects[ob_index];
1052 bool changed_multi =
false;
1066 "Use another Keying Set, as the active one depends on the currently "
1067 "selected items or cannot find any targets due to unsuitable context");
1077 if (extend ==
false) {
1086 uint objects_len = 0;
1089 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
1093 bool changed =
false;
1106 if (strstr(ksp->
rna_path,
"bones")) {
1125 if (changed || !extend) {
1127 changed_multi =
true;
1132 return changed_multi;
1140 bool changed =
false;
1162 printf(
"pose_select_grouped() - Unknown selection type %u\n",
type);
1184 "All bones affected by active Keying Set"},
1189 ot->
name =
"Select Grouped";
1190 ot->
description =
"Select all visible bones grouped by similar properties";
1191 ot->
idname =
"POSE_OT_select_grouped";
1206 "Extend selection instead of deselecting everything first");
1224 uint objects_len = 0;
1227 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
1228 Object *ob = objects[ob_index];
1245 flag_new |= flag_mirror;
1248 pchan_mirror_act = pchan_mirror;
1262 if (pchan_mirror_act) {
1266 if (is_weight_paint) {
1287 ot->
name =
"Select Mirror";
1288 ot->
idname =
"POSE_OT_select_mirror";
1300 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(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)
const bConstraintTypeInfo * BKE_constraint_typeinfo_get(struct bConstraint *con)
#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, ReportType type, const char *message)
#define LISTBASE_FOREACH(type, var, list)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
char * BLI_str_quoted_substrN(const char *__restrict str, const char *__restrict prefix) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
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 uint *buffer, short hits, bool findunsel, bool do_nearest, struct Base **r_base)
const Depsgraph * depsgraph
__kernel void ccl_constant KernelData ccl_global void ccl_global char ccl_global int ccl_global char ccl_global unsigned int 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))
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)
void ED_armature_pose_select_pick_bone(ViewLayer *view_layer, View3D *v3d, Object *ob, Bone *bone, const bool extend, const bool deselect, const bool toggle)
static bool pose_select_linked_pick_poll(bContext *C)
bool ED_armature_pose_select_pick_with_buffer(ViewLayer *view_layer, View3D *v3d, Base *base, const uint *buffer, short hits, bool extend, bool deselect, bool toggle, bool do_nearest)
@ POSE_SEL_SAME_KEYINGSET
static int pose_de_select_all_exec(bContext *C, wmOperator *op)
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)
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
int(* get_constraint_targets)(struct bConstraint *con, struct ListBase *list)
void(* flush_constraint_targets)(struct bConstraint *con, struct ListBase *list, bool no_copy)
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
__forceinline const avxb select(const avxb &m, const avxb &t, const avxb &f)
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))