MagnumVD / RotoForge-AI

An implementation of SAM-HQ + some other stuff to make rotoscoping in blender fast af
https://ko-fi.com/s/5025cf0a06
Other
39 stars 1 forks source link

Error raised when disabling and reenabling the addon without relaunching blender #8

Closed tayadev closed 4 months ago

tayadev commented 5 months ago

When you manually disable the addon in blender you can't reenable it until you restart blender, since it errors out on reloading:

register_class(...):
Info: Registering add-on preferences class: 'RotoForge_Preferences', bl_idname 'RotoForge-AI' has been registered before, unregistering previous
register_class(...):
Info: Registering operator class: 'Install_Dependencies_Operator', bl_idname 'rotoforge.install_dependencies' has been registered before, unregistering previous
register_class(...):
Info: Registering operator class: 'Forceupdate_Dependencies_Operator', bl_idname 'rotoforge.forcupdate_dependencies' has been registered before, unregistering previous
Exception in module register(): C:\Users\taya\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\RotoForge-AI\__init__.py
Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\Blender 4.1\4.1\scripts\modules\addon_utils.py", line 444, in enable
    mod.register()
  File "C:\Users\taya\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\RotoForge-AI\__init__.py", line 116, in register
    setup_ui.register()
  File "C:\Users\taya\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\RotoForge-AI\functions\setup_ui.py", line 450, in register
    bpy.utils.register_class(cls)
ValueError: register_class(...): already registered as a subclass 'MaskGenControls'

System Info:

MagnumVD commented 5 months ago

Wait, but I do unregister the class when disabling the addon...

MagnumVD commented 4 months ago

@tayadev Were you able to look into this issue? I tried using a breakpoint and going step by step but I can't seem to find anything. Maybe blender has an internal class with that name?