【发布时间】:2020-12-28 08:37:31
【问题描述】:
我将按钮添加到栏的顶部,但添加了两个按钮。我该如何解决这个问题d
class ExportAll(bpy.types.Menu):
bl_label = "ExportAll"
bl_idname = "OBJECT_MT_simple_custom_menu"
def draw(self, context):
layout = self.layout
obj = context.object
row = layout.row()
row.operator("mesh.primitive_cube_add")
def draw_btn(self, context):
layout = self.layout
row = layout.row(align=True)
row.operator('mesh.primitive_cube_add',text="CUP",icon="IPO_EXPO")
def register():
bpy.utils.register_class(ExportAll)
bpy.types.TOPBAR_HT_upper_bar.append(draw_btn)
def unregister():
bpy.utils.unregister_class(ExportAll)
bpy.types.TOPBAR_HT_upper_bar.remove(draw_btn)
if __name__ == "__main__":
register()
【问题讨论】: