forked from bartvdbraak/blender
Fix #24054: Shift+A add menu in Surface editmode shows curve items.
This commit is contained in:
parent
6e41dc8571
commit
2597377b5c
@ -189,6 +189,21 @@ class INFO_MT_curve_add(bpy.types.Menu):
|
|||||||
layout.operator("curve.primitive_nurbs_circle_add", icon='CURVE_NCIRCLE', text="Nurbs Circle")
|
layout.operator("curve.primitive_nurbs_circle_add", icon='CURVE_NCIRCLE', text="Nurbs Circle")
|
||||||
layout.operator("curve.primitive_nurbs_path_add", icon='CURVE_PATH', text="Path")
|
layout.operator("curve.primitive_nurbs_path_add", icon='CURVE_PATH', text="Path")
|
||||||
|
|
||||||
|
class INFO_MT_edit_curve_add(bpy.types.Menu):
|
||||||
|
bl_idname = "INFO_MT_edit_curve_add"
|
||||||
|
bl_label = "Add"
|
||||||
|
|
||||||
|
def draw(self, context):
|
||||||
|
is_surf = context.active_object.type == 'SURFACE'
|
||||||
|
|
||||||
|
layout = self.layout
|
||||||
|
layout.operator_context = 'INVOKE_REGION_WIN'
|
||||||
|
|
||||||
|
if is_surf:
|
||||||
|
INFO_MT_surface_add.draw(self, context)
|
||||||
|
else:
|
||||||
|
INFO_MT_curve_add.draw(self, context)
|
||||||
|
|
||||||
|
|
||||||
class INFO_MT_surface_add(bpy.types.Menu):
|
class INFO_MT_surface_add(bpy.types.Menu):
|
||||||
bl_idname = "INFO_MT_surface_add"
|
bl_idname = "INFO_MT_surface_add"
|
||||||
|
@ -193,7 +193,7 @@ void ED_keymap_curve(wmKeyConfig *keyconf)
|
|||||||
keymap= WM_keymap_find(keyconf, "Curve", 0, 0);
|
keymap= WM_keymap_find(keyconf, "Curve", 0, 0);
|
||||||
keymap->poll= ED_operator_editsurfcurve;
|
keymap->poll= ED_operator_editsurfcurve;
|
||||||
|
|
||||||
WM_keymap_add_menu(keymap, "INFO_MT_curve_add", AKEY, KM_PRESS, KM_SHIFT, 0);
|
WM_keymap_add_menu(keymap, "INFO_MT_edit_curve_add", AKEY, KM_PRESS, KM_SHIFT, 0);
|
||||||
WM_keymap_add_item(keymap, "CURVE_OT_vertex_add", LEFTMOUSE, KM_CLICK, KM_CTRL, 0);
|
WM_keymap_add_item(keymap, "CURVE_OT_vertex_add", LEFTMOUSE, KM_CLICK, KM_CTRL, 0);
|
||||||
|
|
||||||
WM_keymap_add_item(keymap, "CURVE_OT_select_all", AKEY, KM_PRESS, 0, 0);
|
WM_keymap_add_item(keymap, "CURVE_OT_select_all", AKEY, KM_PRESS, 0, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user