diff options
-rw-r--r-- | source/blender/editors/armature/armature_select.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/editors/armature/armature_select.c b/source/blender/editors/armature/armature_select.c index 07ff7f15ce4..fc295647ed5 100644 --- a/source/blender/editors/armature/armature_select.c +++ b/source/blender/editors/armature/armature_select.c @@ -801,6 +801,7 @@ enum { SIMEDBONE_PREFIX, SIMEDBONE_SUFFIX, SIMEDBONE_LAYER, + SIMEDBONE_GROUP, SIMEDBONE_SHAPE, }; @@ -813,6 +814,7 @@ static const EnumPropertyItem prop_similar_types[] = { {SIMEDBONE_PREFIX, "PREFIX", 0, "Prefix", ""}, {SIMEDBONE_SUFFIX, "SUFFIX", 0, "Suffix", ""}, {SIMEDBONE_LAYER, "LAYER", 0, "Layer", ""}, + {SIMEDBONE_GROUP, "GROUP", 0, "Group", ""}, {SIMEDBONE_SHAPE, "SHAPE", 0, "Shape", ""}, {0, NULL, 0, NULL, NULL} }; @@ -1003,6 +1005,9 @@ static int armature_select_similar_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } +#define STRUCT_SIZE_AND_OFFSET(_struct, _member) \ + sizeof(((_struct *)NULL)->_member), offsetof(_struct, _member) + switch (type) { case SIMEDBONE_CHILDREN: select_similar_children(arm, ebone_act); @@ -1028,13 +1033,20 @@ static int armature_select_similar_exec(bContext *C, wmOperator *op) case SIMEDBONE_LAYER: select_similar_layer(arm, ebone_act); break; + case SIMEDBONE_GROUP: + select_similar_data_pchan( + arm, obedit, ebone_act, + STRUCT_SIZE_AND_OFFSET(bPoseChannel, agrp_index)); + break; case SIMEDBONE_SHAPE: select_similar_data_pchan( arm, obedit, ebone_act, - sizeof(void *), offsetof(bPoseChannel, custom)); + STRUCT_SIZE_AND_OFFSET(bPoseChannel, custom)); break; } +#undef STRUCT_SIZE_AND_OFFSET + WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, obedit); return OPERATOR_FINISHED; |