diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-05-03 17:51:16 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-05-03 17:53:43 +0300 |
commit | d33b564f9178d324349d3a21eef4d6bf9dde1f1b (patch) | |
tree | 5d1017325ea5f0710ec4061695a4cf578a31eb97 /source/blender/editors/armature/pose_group.c | |
parent | dced56f02a42481de167dd45542adf6dae2d039d (diff) |
Fix T44591: Set PBone Group operator did not handled predifined group index in its invoke func.
Diffstat (limited to 'source/blender/editors/armature/pose_group.c')
-rw-r--r-- | source/blender/editors/armature/pose_group.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/editors/armature/pose_group.c b/source/blender/editors/armature/pose_group.c index 413a74d24b5..4d9df06f33f 100644 --- a/source/blender/editors/armature/pose_group.c +++ b/source/blender/editors/armature/pose_group.c @@ -130,6 +130,7 @@ static int pose_groups_menu_invoke(bContext *C, wmOperator *op, const wmEvent *U { Object *ob = ED_pose_object_from_context(C); bPose *pose; + PropertyRNA *prop = RNA_struct_find_property(op->ptr, "type"); uiPopupMenu *pup; uiLayout *layout; @@ -140,6 +141,17 @@ static int pose_groups_menu_invoke(bContext *C, wmOperator *op, const wmEvent *U if (ELEM(NULL, ob, ob->pose)) return OPERATOR_CANCELLED; pose = ob->pose; + + /* If group index is set, try to use it! */ + if (RNA_property_is_set(op->ptr, prop)) { + const int num_groups = BLI_listbase_count(&pose->agroups); + const int group = RNA_property_int_get(op->ptr, prop); + + /* just use the active group index, and call the exec callback for the calling operator */ + if (group > 0 && group <= num_groups) { + return op->type->exec(C, op); + } + } /* if there's no active group (or active is invalid), create a new menu to find it */ if (pose->active_group <= 0) { |