Hy together!
It is just an suggestion,
but i think it will be good to have for all new Mesh, Curves, etc. Plugins,
a separate Panel under the Create TAB.
> not in Add Mesh, Curves, etc. alone.
Something like
Panel > Plug: new Primitive
Panel > Plug: Mesh
Panel > Plug: Curve
Panel > etc.
class VIEW3D_add_object_plug(bpy.types.Panel):
"""Creates a new Panel under Create TAB"""
bl_category = "Create" #to TAB Create
bl_context = "objectmode" #3D View Location
bl_label = "Plug: new Primitive" #Name of the Panel
bl_idname = "OBJECT_PT_PLUG" #specific Name for Operator & etc.
def draw(self, context):
layout = self.layout
#create your MyNewObject Button
layout.object("bl_idname from your operator", text = "buttonname", icon = "")
def register():
bpy.utils.register_class(VIEW3D_add_object_plug)
def unregister():
bpy.utils.unregister_class(VIEW3D_add_object_plug)
if __name__ == "__main__":
register()
adding the operator to the new Panel
#Registration / add the MyNewObject Button into the Plug Panel
def menu_func(self, context):
self.layout.operator("mesh.mynew_add", text="MyNewObject", icon='MESH_CUBE')
def register():
bpy.utils.register_module(__name__)
#VIEW3D_add_object_plug > class name of the Panel
bpy.types.VIEW3D_add_object_plug.prepend(menu_func)
def unregister():
bpy.utils.unregister_module(__name__)
bpy.types.VIEW3D_add_object_plug.remove(menu_func)
if __name__ == "__main__":
register()