diff --git a/release/scripts/ui/space_view3d.py b/release/scripts/ui/space_view3d.py index 3938711bf62..3b7c43f1ee8 100644 --- a/release/scripts/ui/space_view3d.py +++ b/release/scripts/ui/space_view3d.py @@ -1298,9 +1298,8 @@ class VIEW3D_MT_edit_armature(bpy.types.Menu): layout.itemO("armature.extrude_move") -# EXTRUDE FORKED DOESN'T WORK YET -# if arm.x_axis_mirror: -# layout.item_booleanO("armature.extrude_move", "forked", True, text="Extrude Forked") + if arm.x_axis_mirror: + layout.itemO("armature.extrude_forked") layout.itemO("armature.duplicate_move") layout.itemO("armature.merge") @@ -1311,6 +1310,7 @@ class VIEW3D_MT_edit_armature(bpy.types.Menu): layout.itemS() layout.itemO("armature.subdivide_multi", text="Subdivide") + layout.itemO("armature.switch_direction", text="Switch Direction") layout.itemS() @@ -1334,6 +1334,24 @@ class VIEW3D_MT_edit_armature(bpy.types.Menu): layout.item_menu_enumO("armature.flags_set", "mode", text="Bone Settings") +class VIEW3D_MT_armature_specials(bpy.types.Menu): + bl_label = "Specials" + + def draw(self, context): + layout = self.layout + + layout.operator_context = 'INVOKE_REGION_WIN' + + layout.itemO("armature.subdivide_multi", text="Subdivide") + layout.itemO("armature.switch_direction", text="Switch Direction") + + layout.itemS() + + layout.operator_context = 'EXEC_REGION_WIN' + layout.item_enumO("armature.autoside_names", "type", 'XAXIS', text="AutoName Left/Right") + layout.item_enumO("armature.autoside_names", "type", 'YAXIS', text="AutoName Front/Back") + layout.item_enumO("armature.autoside_names", "type", 'ZAXIS', text="AutoName Top/Bottom") + layout.itemO("armature.flip_names", text="Flip Names") class VIEW3D_MT_edit_armature_parent(bpy.types.Menu): bl_label = "Parent" @@ -1769,6 +1787,8 @@ bpy.types.register(VIEW3D_MT_edit_armature) bpy.types.register(VIEW3D_MT_edit_armature_parent) bpy.types.register(VIEW3D_MT_edit_armature_roll) +bpy.types.register(VIEW3D_MT_armature_specials) # Only as a menu for keybindings + # Panels bpy.types.register(VIEW3D_PT_3dview_properties) bpy.types.register(VIEW3D_PT_3dview_display) diff --git a/source/blender/editors/armature/armature_ops.c b/source/blender/editors/armature/armature_ops.c index 5bb0d67cfbf..be6f7d536f8 100644 --- a/source/blender/editors/armature/armature_ops.c +++ b/source/blender/editors/armature/armature_ops.c @@ -172,6 +172,14 @@ void ED_operatormacros_armature(void) RNA_enum_set(otmacro->ptr, "forked", 0); otmacro= WM_operatortype_macro_define(ot, "TFM_OT_translate"); RNA_enum_set(otmacro->ptr, "proportional", 0); + + // XXX would it be nicer to just be able to have standard extrude_move, but set the forked property separate? + // that would require fixing a properties bug 19733 + ot= WM_operatortype_append_macro("ARMATURE_OT_extrude_forked", "Extrude Forked", OPTYPE_UNDO|OPTYPE_REGISTER); + otmacro=WM_operatortype_macro_define(ot, "ARMATURE_OT_extrude"); + RNA_enum_set(otmacro->ptr, "forked", 1); + otmacro= WM_operatortype_macro_define(ot, "TFM_OT_translate"); + RNA_enum_set(otmacro->ptr, "proportional", 0); } void ED_keymap_armature(wmKeyConfig *keyconf) @@ -207,8 +215,6 @@ void ED_keymap_armature(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "ARMATURE_OT_switch_direction", FKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "ARMATURE_OT_bone_primitive_add", AKEY, KM_PRESS, KM_SHIFT, 0); - /* only the menu-version of subdivide is registered in keymaps for now */ - WM_keymap_add_item(keymap, "ARMATURE_OT_subdivide_multi", WKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "ARMATURE_OT_parent_set", PKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "ARMATURE_OT_parent_clear", PKEY, KM_PRESS, KM_ALT, 0); @@ -234,8 +240,7 @@ void ED_keymap_armature(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "ARMATURE_OT_delete", DELKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "ARMATURE_OT_duplicate_move", DKEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_add_item(keymap, "ARMATURE_OT_extrude_move", EKEY, KM_PRESS, 0, 0); - kmi= WM_keymap_add_item(keymap, "ARMATURE_OT_extrude_move", EKEY, KM_PRESS, KM_SHIFT, 0); - // RNA_boolean_set(kmi->ptr, "forked", 1); // XXX this doesn't work ok for macros it seems... + WM_keymap_add_item(keymap, "ARMATURE_OT_extrude_forked", EKEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_add_item(keymap, "ARMATURE_OT_click_extrude", LEFTMOUSE, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "ARMATURE_OT_fill", FKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "ARMATURE_OT_merge", MKEY, KM_PRESS, KM_ALT, 0); @@ -261,6 +266,9 @@ void ED_keymap_armature(wmKeyConfig *keyconf) /* 2) set roll */ kmi= WM_keymap_add_item(keymap, "TFM_OT_transform", RKEY, KM_PRESS, KM_CTRL, 0); RNA_enum_set(kmi->ptr, "mode", TFM_BONE_ROLL); + + /* menus */ + WM_keymap_add_menu(keymap, "VIEW3D_MT_armature_specials", WKEY, KM_PRESS, 0, 0); /* Pose ------------------------ */ /* only set in posemode, by space_view3d listener */