Preserve location route metadata

This commit is contained in:
2026-06-27 13:21:51 +02:00
parent 63e8489fb2
commit 75a71a2df6
9 changed files with 215 additions and 24 deletions
+16
View File
@@ -70,6 +70,18 @@ def apply_contextual_composition(row: dict[str, Any], subject_kind: str) -> dict
return row
def scene_camera_profile_metadata(scene_text: Any) -> dict[str, str]:
profile = scene_camera_adapters.scene_camera_profile(scene_text)
if not profile:
return {}
return {
"key": str(profile.get("key") or ""),
"family": str(profile.get("family") or ""),
"layout_label": str(profile.get("layout_label") or ""),
"place": str(profile.get("place") or ""),
}
def camera_scene_directive_for_context(
scene_text: Any,
composition: Any,
@@ -129,6 +141,10 @@ def apply_camera_config(
pov_labels = row_pov_labels(row, pov_label_resolver)
subject_kind = row_camera_subject_kind(row)
row = apply_contextual_composition(row, subject_kind)
profile_metadata = scene_camera_profile_metadata(row.get("scene_text") or row.get("source_scene_text") or row.get("scene"))
if profile_metadata:
row["scene_camera_profile"] = profile_metadata
row["scene_camera_profile_key"] = profile_metadata.get("key", "")
scene_directive, parsed = camera_scene_directive_for_context(
row.get("scene_text") or row.get("source_scene_text") or row.get("scene"),
row.get("composition") or row.get("source_composition"),