It's not giving any erros when installing it, also tested the operators before and and they were working fin but i can't make the menu show up. I was trying to call it using "DC_MT_macro_menu" in a shortcut.
Mainly use this post as reference, though he is using panel instead of menu.
The init file
bl_info = {
"name": "Popup Macro",
"author": "",
"version": (1, 0),
"blender": (2, 83, 0),
"location": "DC_MT_macro_menu",
"description": "",
"warning": "",
"doc_url": "",
"category": "",
}
}
import bpy
from . macro_menu import DC_MT_macro_menu
from . macro_classes import DC_OT_bevel_subdiv, DC_OT_bevel_second
classes = (
DC_MT_macro_menu,
DC_OT_bevel_subdiv,
DC_OT_bevel_second,
)
register, unregister = bpy.utils.register_classes_factory(classes)
if __name__ == "__main__":
register()
The menu "macro_menu"
import bpy
class DC_MT_macro_menu(bpy.types.Menu):
bl_idname = "DC_MT_macro_menu"
bl_label = "Macro"
def draw(self, context):
layout = self.layout
layout.operator("3dview.bevel_subdiv")
layout.operator("3dview.bevel_second")
And the operators "macro_classes"
import bpy
class DC_OT_bevel_subdiv(bpy.types.Operator):
bl_idname = "3dview.bevel_subdiv"
bl_label = "Subdivision Workflow"
def execute(self, context):
ob = context.object
bm = ob.modifiers.get("Bevel")
bm = ob.modifiers.new(name="Bevel", type='BEVEL')
bm.segments = 2
bm.profile = 1
bm.limit_method = 'WEIGHT'
bm.miter_outer = 'MITER_ARC'
bm.use_clamp_overlap = False
return {'FINISHED'}
class DC_OT_bevel_second(bpy.types.Operator):
bl_idname = "3dview.bevel_second"
bl_label = "Second Bevel"
def execute(self, context):
ob = context.object
bm = ob.modifiers.get("Bevel")
bm = ob.modifiers.new(name="secBevel", type='BEVEL')
bm.limit_method = 'ANGLE'
bm.miter_outer = 'MITER_ARC'
bm.use_clamp_overlap = False
return {'FINISHED'}