0

I am trying to make a simple first add-on. I have installed it and made a keymap for it, but it doesn't seem to work. If I manually load the script in and run it, the keymap will start working and everything is great.

From what I can tell I think the add-on has been successfully installed but obviously something is going wrong and I just don't know what. Any help would be appreciated.

bl_info = {"name" : "GoodScript1",   "category": "3D View",   "author": "my name"}
import bpy

class WM_OT_dialogop(bpy.types.Operator): """Custom Operator - Add txt here """ bl_label = "Add Cube" bl_idname = "wm.dialogop"

def execute(self, context):

    bpy.ops.mesh.primitive_cube_add(size=2, enter_editmode=False, align='WORLD', location=(0, 0, 0), scale=(1, 1, 1))

    return {'FINISHED'}


def register(): bpy.utils.register_class(WM_OT_dialogop)

def unregister(): bpy.utils.unregister_class(WM_OT_dialogop)

if name == "main": register()

0 Answers0