refactor: Make EffectPlugin an abstract base class, update effects to inherit from it, and improve plugin discovery.

This commit is contained in:
2026-03-18 23:06:04 -07:00
parent bd400c25be
commit 347ae68f43
6 changed files with 45 additions and 15 deletions

View File

@@ -5,6 +5,7 @@ PLUGIN_DIR = Path(__file__).parent
def discover_plugins():
from engine.effects.registry import get_registry
from engine.effects.types import EffectPlugin
registry = get_registry()
imported = {}
@@ -22,8 +23,8 @@ def discover_plugins():
attr = getattr(module, attr_name)
if (
isinstance(attr, type)
and hasattr(attr, "name")
and hasattr(attr, "process")
and issubclass(attr, EffectPlugin)
and attr is not EffectPlugin
and attr_name.endswith("Effect")
):
plugin = attr()