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"
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.
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()
[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]