Custom addon never appear in menu

Hello,

I been trying like a thousand times with different scripts I wrote
although my addon is loaded on startup it never show at all in blender

it also does not seem to do the register() function

I tried View3D > Add > Mesh
I tried File > MyAddon

it just never works

here is my blinfo

bl_info = {
“name”: “Cross object painting”,
“description”: “”,
“author”: “…”,
“version”: (1, 0),
“blender”: (2, 73, 0),
“location”: “View3D > Add > Mesh”,
“warning”: “”,
“wiki_url”: “http://wiki.blender.org/index.php/Extensions:2.5/Py/
“Scripts/My_Script”,
“category”: “Object”}

please tell me what is needed to make this work

thanks

This bl_info map is only metadata it won’t affect your panels (provided that your panels are the ones that will be placed on the GUI). In order to make your panels appear anywhere you want you must set the values to the properties of the class.

This for example is the panel template from Blender examples.


class LayoutDemoPanel(bpy.types.Panel):
    """Creates a Panel in the scene context of the properties editor"""
    bl_label = "Layout Demo"
    bl_idname = "SCENE_PT_layout"
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "scene"

For more information about the available bl_space_type values see here:
http://www.blender.org/api/blender_python_api_2_74_0/bpy.types.Panel.html?highlight=bl_space_type#bpy.types.Panel.bl_space_type

Did you check for errors in the terminal / system console? Do you conditionally call register() at the very end? You might want to add print()s to see if it’s run at all.

so I tried this

bl_space_type = 'VIEW_3D'
bl_region_type = 'TOOLS'
bl_context = "scene"

but I cant find my addon anywhere (menu,tools panel,search dialog…)even after reinstalling it
it is hard to figure out where it is going to end up just from the documentation


bl_info = {
    "name": "MyAddon",
    "description": "..",
    "author": "...",
    "version": (1, 0),
    "blender": (2, 73, 0),
    "location": "View3D > Add > Mesh",
    "warning": "", # used for warning icon and text in addons panel
    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.5/Py/"
                "Scripts/My_Script",
    "category": "Object"}

import bpy
from mathutils import Vector

class ModalOperator(bpy.types.Operator):
    bl_idname = "object.modal_operator"
    bl_label = "Simple Modal Operator"
    bl_options = {'REGISTER'}
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'TOOLS'
    bl_context = "scene"
        
    
    def modal(self, context, event):
    ...
        return {'RUNNING_MODAL'}

    def invoke(self, context, event):
       # self.value = event.mouse_x
       # self.execute(context)

        print(context.window_manager.modal_handler_add(self))
        return {'RUNNING_MODAL'}

addon_keymaps = []

def register():
    bpy.utils.register_class(ModalOperator)
     # handle the keymap
    wm = bpy.context.window_manager
    km = wm.keyconfigs.addon.keymaps.new(name='Object Mode', space_type='EMPTY')

    kmi = km.keymap_items.new(ModalOperator.bl_idname, 'SPACE', 'PRESS', ctrl=True, shift=True)
    kmi.properties.total = 4

    addon_keymaps.append(km)

    print("registered")


def unregister():
    bpy.utils.unregister_class(ModalOperator)
    
    # handle the keymap
    wm = bpy.context.window_manager
    for km in addon_keymaps:
        wm.keyconfigs.addon.keymaps.remove(km)
    # clear the list
    addon_keymaps.clear()

    print("unregistered")

# This allows you to run the script directly from blenders text editor
# to test the addon without having to install it.
if __name__ == "__main__":
    register()
    

I also tried to add this


def menu_func(self, context):
    self.layout.operator(ModalOperator.bl_idname)

def register():
    bpy.types.VIEW3D_MT_object.append(menu_func)

does not work

[edit: ok after changing ModalOperator to something else, it appeared in the menu…
but it does not appear anymore when I restart Blender wtf ?
and register() is never called]

yes I tried that too, but it does not seem to register at all, see the code above

You should compare your code with Addon Add Object template

if I run the script it works
so it’s on install that it does not work
is there anyone willing to look at the code ?

I tried installing that addon (adding print debug lines to it) it does not register when installing
there is something wrong with blender 2.73


def register():
    print("register")
    bpy.utils.register_class(OBJECT_OT_add_object)
    bpy.utils.register_manual_map(add_object_manual_map)
    bpy.types.INFO_MT_mesh_add.append(add_object_button)


def unregister():
    print("unregister")
    bpy.utils.unregister_class(OBJECT_OT_add_object)
    bpy.utils.unregister_manual_map(add_object_manual_map)
    bpy.types.INFO_MT_mesh_add.remove(add_object_button)

unless register is not supposed to be called on install