Files
wtd-libreflow-addon/__init__.py
T
Nero Frame 13andClaude Opus 5.5 c238f4db7c Added the Scene Manager (Libreflow casting, load, update, assetize)
New Scene Manager panel (WTD tab) talking to a running Libreflow through
its IPC server and the wtdcmds commands: pick the shot context, read the
casting, link the latest available publishes (overrides for chars and
props, collection instances otherwise), flag out-of-date versions in red,
update / roll back / remove loaded assets, and publish local collections
as assets. Requests run in the background. Settings in config.py
(SCENE_MANAGER_*, LIBREFLOW_*).

The Shot Viewer groups rigs loaded by the Scene Manager by asset type.
The manifest declares the network permission.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 11:15:02 +01:00

92 lines
2.4 KiB
Python

import sys
# Reload support: drop our cached submodules so "Reload Scripts" and
# disable/enable pick up edits in every file, not only this one.
for _name in [name for name in sys.modules if name.startswith(__name__ + ".")]:
del sys.modules[_name]
import bpy # noqa: E402
from bpy.app.handlers import persistent # noqa: E402
from . import checks, core, rename, scene_manager, shot_viewer, tools_ops, ui # noqa: E402
from .core import runner # noqa: E402
api = core
# Old bl_info to be able to develop on live code
bl_info = {
"name": "Melvile Tools",
"author": "Walking The Dog (WTD)",
"version": (0, 1, 1),
"blender": (5, 2, 0),
"description": "Tools for the Melvile Pipeline",
"location": "",
"warning": "",
"wiki_url": "",
"tracker_url": "",
"category": [],
}
@persistent
def _on_load_post(*_args):
runner.clear()
def _load_config_override():
prefs = ui.properties.get_prefs()
ui.properties.load_config_override(prefs.config_path if prefs else "")
# Register modules
def register() -> None:
# Register tool operators
tools_ops.register()
# Register the rename tool (settings and operator, before its panel)
rename.register()
# Register the shot viewer (settings and operators, before its panel)
shot_viewer.register()
# Register the scene manager (settings and operators, before its panels)
scene_manager.register()
# Load all the sanity checks into the sanity REGISTRY
checks.load_all()
# Register the UI for all panels
ui.register()
# Load the configuration for sanity checks
_load_config_override()
# Load it natively
bpy.app.handlers.load_post.append(_on_load_post)
# Unregister modules
def unregister() -> None:
# Unregister tool operators
tools_ops.unregister()
# Destroy the post loader
if _on_load_post in bpy.app.handlers.load_post:
bpy.app.handlers.load_post.remove(_on_load_post)
# Unregister all panels
ui.unregister()
# Unregister the rename tool (after its panel)
rename.unregister()
# Unregister the shot viewer (after its panel)
shot_viewer.unregister()
# Unregister the scene manager (after its panels)
scene_manager.unregister()
runner.clear()
# The check registry is plain Python and is rebuilt with the modules on
# re-import, so it is kept as is (enable/disable without re-import).