Pose bone menu (Ctrl+G) wasnt working, replace with a reference to python menu.
authorCampbell Barton <ideasman42@gmail.com>
Mon, 2 Nov 2009 16:39:45 +0000 (16:39 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 2 Nov 2009 16:39:45 +0000 (16:39 +0000)
source/blender/editors/armature/armature_intern.h
source/blender/editors/armature/armature_ops.c
source/blender/editors/armature/poseobject.c

index 6f5a5f4..d31a3bd 100644 (file)
@@ -87,7 +87,6 @@ void POSE_OT_select_hierarchy(struct wmOperatorType *ot);
 void POSE_OT_select_linked(struct wmOperatorType *ot);
 void POSE_OT_select_constraint_target(struct wmOperatorType *ot);
 
-void POSE_OT_groups_menu(struct wmOperatorType *ot);
 void POSE_OT_group_add(struct wmOperatorType *ot);
 void POSE_OT_group_remove(struct wmOperatorType *ot);
 void POSE_OT_group_remove(struct wmOperatorType *ot);
index cc359de..159effe 100644 (file)
@@ -128,7 +128,6 @@ void ED_operatortypes_armature(void)
        WM_operatortype_append(POSE_OT_select_linked);
        WM_operatortype_append(POSE_OT_select_constraint_target);
        
-       WM_operatortype_append(POSE_OT_groups_menu);
        WM_operatortype_append(POSE_OT_group_add);
        WM_operatortype_append(POSE_OT_group_remove);
        WM_operatortype_append(POSE_OT_group_assign);
@@ -312,7 +311,8 @@ void ED_keymap_armature(wmKeyConfig *keyconf)
        WM_keymap_add_item(keymap, "POSE_OT_ik_add", IKEY, KM_PRESS, /*KM_CTRL|*/KM_SHIFT, 0);
        WM_keymap_add_item(keymap, "POSE_OT_ik_clear", IKEY, KM_PRESS, KM_CTRL|KM_ALT, 0);
        
-       WM_keymap_add_item(keymap, "POSE_OT_groups_menu", GKEY, KM_PRESS, KM_CTRL, 0);
+       kmi= WM_keymap_add_item(keymap, "WM_OT_call_menu", GKEY, KM_PRESS, KM_CTRL, 0);
+       RNA_string_set(kmi->ptr, "name", "VIEW3D_MT_pose_group");
        
                /* set flags */
        kmi= WM_keymap_add_item(keymap, "POSE_OT_flags_set", WKEY, KM_PRESS, KM_SHIFT, 0);
index 331bd6f..f04aaaf 100644 (file)
@@ -1438,54 +1438,6 @@ void POSE_OT_group_unassign (wmOperatorType *ot)
        ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
-/* ----------------- */
-
-static int pose_groupOps_menu_invoke (bContext *C, wmOperator *op, wmEvent *evt)
-{
-       Object *ob= CTX_data_active_object(C);
-       uiPopupMenu *pup= uiPupMenuBegin(C, op->type->name, 0);
-       uiLayout *layout= uiPupMenuLayout(pup);
-       
-       /* sanity check - must have object with pose */
-       if ELEM(NULL, ob, ob->pose)
-               return OPERATOR_CANCELLED;
-       
-       /* get mode of action */
-       if (CTX_DATA_COUNT(C, selected_pchans)) {
-               /* if selected bone(s), include options to add/remove to active group */
-               uiItemO(layout, "Add Selected to Active Group", 0, "POSE_OT_group_assign");
-               
-               uiItemS(layout);
-               
-               uiItemO(layout, "Remove Selected from All Groups", 0, "POSE_OT_group_unassign");
-               uiItemO(layout, "Remove Active Group", 0, "POSE_OT_group_remove");
-       }
-       else {
-               /* no selected bones - so just options for groups management */
-               uiItemO(layout, "Add New Group", 0, "POSE_OT_group_add");
-               uiItemO(layout, "Remove Active Group", 0, "POSE_OT_group_remove");
-       }
-               
-       return OPERATOR_CANCELLED;
-}
-
-void POSE_OT_groups_menu (wmOperatorType *ot)
-{
-       /* identifiers */
-       ot->name= "Bone Group Tools";
-       ot->idname= "POSE_OT_groups_menu";
-       ot->description= "Menu displaying available tools for Bone Groups.";
-       
-       /* api callbacks (only invoke needed) */
-       ot->invoke= pose_groupOps_menu_invoke;
-       ot->poll= ED_operator_posemode;
-       
-       /* flags */
-       ot->flag= OPTYPE_REGISTER;
-}
-
-/* ********************************************** */
-
 static short pose_select_same_group (Object *ob)
 {
        bPose *pose= (ob)? ob->pose : NULL;