Pose bone menu (Ctrl+G) wasnt working, replace with a reference to python menu.

This commit is contained in:
2009-11-02 16:39:45 +00:00
parent 1d9f90ed42
commit 8557f617f0
3 changed files with 2 additions and 51 deletions

View 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);

View 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);

View 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;