LODs are child collections of the asset collection (COL_{asset}_LOD{n}).
Overrides hide the other LOD collections (viewport and render), keeping
the rig, pose and animation; collection instances instance the LOD
collection. Each instance has its own LOD, set per instance or for the
selection in the Loaded panel, kept through save, reload and updates.
Loading shows SCENE_MANAGER_DEFAULT_LOD (0).
The Shot Viewer panel is now "Shot Manager" and starts closed. Code
names and SHOT_VIEWER_* config keys are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
92 lines
2.4 KiB
Python
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 manager (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 manager (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).
|