I am currently trying to create a panel blender addon with more than one python script (init.py, data.py) . However when I try to test out the code by installing the addon through zip then enabling it, it does not show up in the panel section. Nothing shows up in the system console, and no errors are seen. From what I can see, there isn't a problem with the code itself, which is confusing. What should I do?
here is the example code.
bl_info = {
"name": "example_addon",
"author": "KripC",
"version": (0, 1),
"location": "View3D > UI > example_addon",
"category": "Animation",
"bl_space_type": "VIEW_3D",
"bl_region_type": "UI",
}
import bpy
from . import data
from bpy.props import (FloatProperty,
IntProperty,
BoolProperty,
EnumProperty)
class addonPref(bpy.types.PropertyGroup):
oneHand: BoolProperty(
name = "One Hand",
description = "Animation only applies to one hand",
default = False
)
class addonfunc(bpy.types.Operator):
bl_idname = "addon.func"
bl_label = "addonfunc"
def execute(self, context):
print("hello")
return {'FINISHED'}
class addonpanel(bpy.types.Panel):
bl_label = "exampleaddon"
bl_idname = "exampleaddon_PT_Panel"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
bl_category = "example_addon"
def draw(self, context):
layout = self.layout
scene = context.scene
mytool = scene.my_tools
layout.operator(addonfunc.bl_idname, text="FUNCTION")
classes = (
addonPref,
addonfunc,
addonpanel,
)
def register():
for cls in classes:
bpy.utils.register_class(cls)
bpy.types.Scene.my_tools = bpy.props.PointerProperty(type=addonPref)
def unregister():
for cls in classes:
bpy.utils.unregister_class(cls)
del bpy.types.Scene.my_tools
if __name__ == "__main__":
register()