本文整理汇总了Python中bpy.types.Menu方法的典型用法代码示例。如果您正苦于以下问题:Python types.Menu方法的具体用法?Python types.Menu怎么用?Python types.Menu使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bpy.types
的用法示例。
在下文中一共展示了types.Menu方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: draw
# 需要导入模块: from bpy import types [as 别名]
# 或者: from bpy.types import Menu [as 别名]
def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False
obj = bpy.context.object
if obj == None:
return
if obj.rigid_body != None:
layout.prop(obj, 'arm_rb_linear_factor')
layout.prop(obj, 'arm_rb_angular_factor')
layout.prop(obj, 'arm_rb_trigger')
layout.prop(obj, 'arm_rb_force_deactivation')
layout.prop(obj, 'arm_rb_ccd')
if obj.soft_body != None:
layout.prop(obj, 'arm_soft_body_margin')
# Menu in data region
示例2: draw_menus
# 需要导入模块: from bpy import types [as 别名]
# 或者: from bpy.types import Menu [as 别名]
def draw_menus(layout, context):
obj = context.active_object
mode_string = context.mode
edit_object = context.edit_object
gp_edit = context.gpencil_data and context.gpencil_data.use_stroke_edit_mode
layout.menu("VIEW3D_MT_view")
# Select Menu
if gp_edit:
layout.menu("VIEW3D_MT_select_gpencil")
elif mode_string in {'PAINT_WEIGHT', 'PAINT_VERTEX', 'PAINT_TEXTURE'}:
mesh = obj.data
if mesh.use_paint_mask:
layout.menu("VIEW3D_MT_select_paint_mask")
elif mesh.use_paint_mask_vertex and mode_string == 'PAINT_WEIGHT':
layout.menu("VIEW3D_MT_select_paint_mask_vertex")
elif mode_string != 'SCULPT':
layout.menu("VIEW3D_MT_select_%s" % mode_string.lower())
if gp_edit:
pass
elif mode_string == 'OBJECT':
layout.menu("INFO_MT_add", text="Add")
elif mode_string == 'EDIT_MESH':
layout.menu("INFO_MT_mesh_add", text="Add")
elif mode_string == 'EDIT_CURVE':
layout.menu("INFO_MT_curve_add", text="Add")
elif mode_string == 'EDIT_SURFACE':
layout.menu("INFO_MT_surface_add", text="Add")
elif mode_string == 'EDIT_METABALL':
layout.menu("INFO_MT_metaball_add", text="Add")
elif mode_string == 'EDIT_ARMATURE':
layout.menu("INFO_MT_edit_armature_add", text="Add")
if gp_edit:
layout.menu("VIEW3D_MT_edit_gpencil")
elif edit_object:
layout.menu("VIEW3D_MT_edit_%s" % edit_object.type.lower())
elif obj:
if mode_string != 'PAINT_TEXTURE':
layout.menu("VIEW3D_MT_%s" % mode_string.lower())
if mode_string in {'SCULPT', 'PAINT_VERTEX', 'PAINT_WEIGHT', 'PAINT_TEXTURE'}:
layout.menu("VIEW3D_MT_brush")
if mode_string == 'SCULPT':
layout.menu("VIEW3D_MT_hide_mask")
else:
layout.menu("VIEW3D_MT_object")
# ********** Menu **********
# ********** Utilities **********