Blender 2.8 - Add view 3d menu

What you have works. It places it after the Shading overlays. Append places at the end and prepend places at the beginning. As far as trying to get it in a specific location. The only way to prolly do that is edit the main .py file.

import bpy

class VIEW3D_MT_menu(bpy.types.Menu):
    bl_label = "Test"

    def draw(self, context):
        self.layout.operator("mesh.primitive_monkey_add")

def addmenu_callback(self, context):
    self.layout.menu("VIEW3D_MT_menu")


def register():
    bpy.utils.register_class(VIEW3D_MT_menu)
    bpy.types.VIEW3D_HT_header.append(addmenu_callback)  

def unregister():
    bpy.types.VIEW3D_HT_header.remove(addmenu_callback)  
    bpy.utils.unregister_class(VIEW3D_MT_menu)


if __name__ == "__main__":
	register()
2 Likes