Scene Manager: LOD switching; Shot Viewer renamed Shot Manager

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>
This commit is contained in:
NDemaerschalkandClaude Opus 5.5 committed 2026-10-27 16:42:24 +01:00
1 parent 9fe38ce58a
commit bac7a6f5da
10 files changed
+258 -45

No files matched your search

+36 -2
View File
@@ -1,4 +1,4 @@
"""Scene Manager operators: connection, shot context, casting, load, update, remove, assetize.
"""Scene Manager operators: connection, shot context, casting, load, update, LOD, remove, assetize.
Libreflow is only reached through ``ipc``; every request but the ones filling a
dialog runs in the background and applies its result on the main thread.
@@ -13,7 +13,7 @@ import time
import bpy
from bpy.app.handlers import persistent
from bpy.props import BoolProperty, EnumProperty, PointerProperty, StringProperty
from bpy.props import BoolProperty, EnumProperty, IntProperty, PointerProperty, StringProperty
from .. import config
from . import ipc
@@ -731,6 +731,39 @@ class WTD_OT_scene_select_instance(bpy.types.Operator):
return {"FINISHED"}
class WTD_OT_scene_set_lod(bpy.types.Operator):
bl_idname = "wtd_scene.set_lod"
bl_label = "Set LOD"
bl_description = "Show this level of detail (one of the asset's LOD collections)"
bl_options = {"REGISTER", "UNDO"}
lod: IntProperty(name="LOD", min=0)
library: StringProperty(options={"SKIP_SAVE"})
instance: StringProperty(description="Only this instance (object or collection name)", options={"SKIP_SAVE"})
selected: BoolProperty(description="The instances of the selected objects", options={"SKIP_SAVE"})
def execute(self, context):
if self.selected:
targets = lib.selected_instances(context.view_layer)
else:
library = bpy.data.libraries.get(self.library)
targets = [(library, i) for i in lib.instances(library) if i.name == self.instance] if library else []
targets = [(library, instance) for library, instance in targets if lib.lods(library, instance)]
if not targets:
self.report({"WARNING"}, "No loaded instance with LODs selected")
return {"CANCELLED"}
switched, errors = [], []
for library, instance in targets:
try:
lib.set_lod(library, instance, self.lod)
switched.append(instance.name)
except lib.LoadError as exc:
errors.append(str(exc))
text = f"LOD {self.lod}: {', '.join(switched)}" if switched else f"LOD {self.lod} not set"
self.report({"WARNING"} if errors else {"INFO"}, "; ".join([text, *errors]))
return {"FINISHED"} if switched else {"CANCELLED"}
class WTD_OT_scene_toggle_expand(bpy.types.Operator):
bl_idname = "wtd_scene.toggle_expand"
bl_label = "Show Instances"
@@ -948,6 +981,7 @@ classes = (
WTD_OT_scene_pick_revision,
WTD_OT_scene_remove,
WTD_OT_scene_select_instance,
WTD_OT_scene_set_lod,
WTD_OT_scene_toggle_expand,
WTD_OT_scene_assetize,
)