@deepblend/dsh-blender-bundle 0.22.0 → 0.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/client.js CHANGED
@@ -252,9 +252,17 @@ window.__ModuleLoader__.load({
252
252
  "assets.reset": "放弃素材草稿",
253
253
  "assets.saved": "素材已应用到 {revision}。",
254
254
  "assets.model": "放入场景(保留原材质)",
255
+ 'assets.hideExisting': '导入时隐藏现有对象(可选)',
256
+ 'assets.hideNone': '不隐藏任何对象',
257
+ 'assets.hideHelp': '新模型可能与现有对象重叠。只隐藏你明确选择的对象;原版本保留,可用于移开默认立方体。',
258
+ 'assets.makeSubject': '将新模型设为创作主体',
259
+ 'assets.hideSubjectError': '要隐藏当前明确指定的主体,请先勾选将新模型设为创作主体。',
255
260
  "assets.image": "绑定图片材质",
256
261
  "assets.environment": "用作环境照明",
257
- "assets.dimensions": "素材尺寸(米)",
262
+ "assets.dimensions": "首帧导入包围尺寸(场景米)",
263
+ "assets.unitsObj": "OBJ 不记录物理单位。请与实物尺寸核对;缩放倍数 = 实际尺寸 ÷ 上面的对应尺寸。",
264
+ "assets.unitsGltf": "glTF 约定以米为单位;请核对模型与实物尺寸。缩放倍数 = 实际尺寸 ÷ 上面的对应尺寸。",
265
+ "assets.scaledDimensions": "缩放后首帧包围尺寸(米,未计本次旋转)",
258
266
  "assets.toneMapped": "这是环境照明效果示例,经过色调映射;应用使用原始 HDR / EXR 数据。",
259
267
  "assets.modelHelp": "位置为素材原点,缩放相对原素材。保留原材质、层级与源对象,不改相机。",
260
268
  "assets.entityId": "新对象标识",
@@ -326,6 +334,21 @@ window.__ModuleLoader__.load({
326
334
  'brief.review': "评审已保存版本",
327
335
  'brief.autofix': "按参考自动修正",
328
336
  'brief.reviewCost': "点击后会渲染 640 × 480 / 16 采样预览并调用视觉模型;自动修正可能创建或回退版本。",
337
+ 'reviewView.title': '评审画面',
338
+ 'reviewView.selected': '指定保存机位',
339
+ 'reviewView.standard': '标准检查视图组',
340
+ 'reviewView.help': '按保存的项目画幅生成最大边不超过 640 像素、最多 16 采样的检查图,并调用模型。请核对机位和帧;这不是对正式图片或完整影片的验收。',
341
+ 'reviewView.standardHelp': '标准视图组按角色选择机位,不会自动匹配交付图片。',
342
+ 'reviewView.fromImages': '使用最近最多 4 张已完成图片的机位',
343
+ 'reviewView.add': '增加机位',
344
+ 'reviewView.remove': '移除机位',
345
+ 'reviewView.invalid': '请选择当前版本中 1–4 组不同的机位和帧,帧须位于工程范围内;来源未就绪时请刷新。',
346
+ 'reviewView.stale': '机位选择来自旧版本,请重置为当前保存版本后再评审。',
347
+ 'reviewView.reset': '重置为当前版本',
348
+ 'reviewView.noAutofix': '指定机位评审仅提供反馈。自动修正使用标准检查视图组。',
349
+ 'reviewView.scope': '实际检查画面 · {revision}',
350
+ 'reviewView.scopeItem': '{camera} · 第 {frame} 帧 · {resolution} · {samples} 采样',
351
+ 'reviewView.mismatch': '评审返回的画面来源与本次选择不一致,请刷新后重新核对。',
329
352
  'brief.iterations': "最多修正轮数",
330
353
  'brief.reviewing': "正在渲染并评审…",
331
354
  'brief.fixing': "正在进行有限轮次修正…",
@@ -349,6 +372,7 @@ window.__ModuleLoader__.load({
349
372
  'fit.reset': '重新读取当前版本',
350
373
  'fit.cancel': '取消保存',
351
374
  'fit.saved': '已保存完整取景:{revision} · 第 {frame} 帧 · {count} 个部件。请查看预览。',
375
+ 'fit.savedOtherPreview': '已保存完整取景:{revision}。当前显示的不是该版本预览,请核对图片来源;如果未更新,请点击刷新。',
352
376
  'fit.unconfirmed': '保存结果尚未确认。重试会沿用同一请求和机位;刷新页面后仍可继续。',
353
377
  'fit.stale': '当前版本已变化。重新读取当前版本后再保存。',
354
378
  'fit.failed': '未能保存完整取景。查看详情后调整部件、相机或留白,再试一次。',
@@ -399,6 +423,23 @@ window.__ModuleLoader__.load({
399
423
  "photo.restoreFailed": "恢复失败,已保留摄影记录:{message}",
400
424
  "photo.reuseUnavailable": "无法读取完整摄影设置,请重新选择来源。",
401
425
  "photo.reuseTitle": "复用已保存作品的摄影设置",
426
+ "photo.reuseMode": "复用方式",
427
+ "photo.reuseAbsolute": "原坐标",
428
+ "photo.reuseBounds": "按产品边界适配",
429
+ "photo.boundsHelp": "根据两边所选静态部件的实际边界缩放摄影位置。非太阳灯尺寸乘比例、功率乘比例平方;目标传感器、画幅与光圈保留,对焦距离重新计算。套用后查看预览,必要时另存完整取景;不保证相同曝光或构图。",
430
+ "photo.boundsAll": "选择非环境可见部件",
431
+ "photo.boundsClear": "清空选择",
432
+ "photo.boundsUnavailable": "当前 Host 不支持边界适配,未改动草稿。可更新插件,或明确改用原坐标。",
433
+ "photo.boundsPick": "两边都应选完整产品,排除环境与支承。未选部件不参与比例计算;动态、隐藏或无法可靠测量的几何会拒绝。",
434
+ "photo.boundsSource": "来源产品部件({count})",
435
+ "photo.boundsDestination": "目标产品部件({count})",
436
+ "photo.boundsFrame": "来源检查帧",
437
+ "photo.boundsPlanning": "正在读取两个保存工程的实际边界…",
438
+ "photo.boundsCancel": "取消适配",
439
+ "photo.boundsApplied": "已按 {scale} 倍套用到草稿:来源 {sourceCount} 件,目标 {destinationCount} 件,来源第 {frame} 帧。相机只取该帧,不复制动画。",
440
+ "photo.boundsInvalid": "请选择有效检查帧,以及来源和目标的完整产品部件。",
441
+ "photo.boundsMismatch": "适配结果与本次保存来源不一致,未改动摄影草稿。",
442
+ "photo.boundsChanged": "适配期间选择或草稿已变化,已保留当前输入;请重新适配。",
402
443
  "photo.reuseHelp": "原坐标以米复用,不自动缩放或取景。替换本作品全部灯光和所选相机的可编辑设置;模型、材质、世界、动画、其他相机与交付设置保留。套用后检查构图,再明确保存。",
403
444
  "photo.reuseProject": "来源作品",
404
445
  "photo.reuseRevision": "来源保存版本",
@@ -490,6 +531,15 @@ window.__ModuleLoader__.load({
490
531
  'editor.mesh': '自定义曲面',
491
532
  'editor.meshCounts': '控制网格:{vertices} 个顶点,{faces} 个面',
492
533
  'editor.smoothSurface': '平滑表面',
534
+ 'editor.uv.title': '纹理坐标',
535
+ 'editor.uv.saved': '当前使用已保存的逐面 UV。',
536
+ 'editor.uv.automatic': '当前使用默认平面 UV;部分朝向可能出现纹理拉伸。',
537
+ 'editor.uv.project': '保存时逐面重建 UV',
538
+ 'editor.uv.help': '适合木纹等重复纹理。保存会替换当前 UV;各面可重叠,不用于烘焙贴图,也不保证跨面无缝。',
539
+ 'editor.uv.direction': '纹理方向',
540
+ 'editor.uv.scale': '纹理重复',
541
+ 'editor.uv.scaleInvalid': '请输入 0.0001 到 10000 之间的重复次数。',
542
+ 'editor.uv.scaleHelp': '最长局部网格边界跨度内的重复次数。只改变纹理坐标,保存后查看实际预览。',
493
543
  'editor.subdivision': '曲面细分',
494
544
  'editor.surfaceScatter': '封闭表面布置',
495
545
  'editor.scatterTargets': '依附物体(逗号分隔)',
@@ -642,6 +692,7 @@ window.__ModuleLoader__.load({
642
692
  'projects.recovered': '已打开之前创建的 {id},未重复创建或渲染',
643
693
  'projects.replyMissing': '未能收到创建结果。输入已保留;重试上次创建会检查同一次请求。',
644
694
  'projects.environmentFailed': 'Blender 环境尚未就绪。输入已保留;请先检查安装和路径,修复后再重试。',
695
+ 'projects.environmentAllowlist': 'Blender 路径未获许可。输入已保留;请在 DSH 配置中指定 Blender 的绝对路径,或授权该程序所在目录,然后重试。',
645
696
  'projects.creationFailed': '未能确认创建结果。输入已保留;可重试上次创建,或刷新列表检查已保存的项目。',
646
697
  'projects.retryCreation': '重试上次创建',
647
698
  'projects.originalTitle': '上次创建:{title}',
@@ -707,6 +758,83 @@ window.__ModuleLoader__.load({
707
758
  'preview.identical': '结构完全相同',
708
759
  'jobs.empty': '还没有渲染任务。',
709
760
  'jobs.deliveryVerified': '交付已校验',
761
+ 'jobs.downloadVideo': '下载 MP4 · 版本 {revision}',
762
+ 'jobs.downloadFrame': '下载 PNG · 版本 {revision} · 第 {frame} 帧',
763
+ 'jobs.camera': '渲染相机',
764
+ 'jobs.cameraDefault': '场景默认相机',
765
+ 'jobs.cameraMissing': '所选相机在当前版本中不存在,请重新选择。',
766
+ 'motion.title': '制作相机推进',
767
+ 'readiness.imageTitle': '模型图片输入检查',
768
+ 'readiness.imageHelp': '主动发送一张随机测试图到当前视觉评审模型,可能产生模型费用;不会修改作品。切换模型或服务后请重新检查。',
769
+ 'readiness.imageRun': '检查模型是否能看图',
770
+ 'readiness.imageRunning': '正在检查…',
771
+ 'readiness.imagePass': '本次测试图识别正确。该检查不评价作品质量,也不能保证所有图片都能识别。',
772
+ 'readiness.imageAuth': '模型鉴权失败。请在 DSH 中检查当前服务的凭据,再重新检查。',
773
+ 'readiness.imageCredentials': '当前模型服务尚未配置可用凭据。请在当前工作台使用的 DSH 配置中完成服务凭据设置,再重新检查。',
774
+ 'readiness.imageUnsupported': '当前评审模型未声明支持图片输入。请在 DSH 中检查视觉评审模型配置。',
775
+ 'readiness.imageModel': '当前服务的模型目录中找不到所选模型。请核对当前工作台使用的 DSH 配置,并选择目录中的模型标识;模型显示名可能与标识不同。保存后重新检查。',
776
+ 'readiness.imageRoute': '评审模型或服务不可用。请检查当前 DSH 配置和服务状态。',
777
+ 'readiness.imageRate': '模型服务暂时限流,请稍后重试。',
778
+ 'readiness.imageTimeout': '本次检查超时或被取消,无法确认模型能否看图。',
779
+ 'readiness.imageBusy': '上一次检查仍未结束;请稍后重试,若持续不结束,请重启 DSH。',
780
+ 'readiness.imageInconclusive': '本次无法确认模型是否识别了测试图,请检查模型服务后重试。',
781
+ 'readiness.imageLocal': '请在本机工作台检查;旧版 Host 需要重启或更新。',
782
+ 'storage.low': '项目磁盘本次测得可用 {space},低于 2 GiB;多帧渲染可能中断。请先释放空间并刷新。',
783
+ 'storage.observed': '项目磁盘本次测得可用 {space}。渲染可能需要更多空间。',
784
+ 'storage.unknown': '暂时无法测量项目磁盘空间。请在渲染前检查项目所在磁盘。',
785
+ 'storage.limit': '这是最近一次刷新时的估计,不是空间预留;系统保留、配额、临时目录和其他任务可能影响实际可写空间。',
786
+ 'aspect.title': '为 16:9 交付准备画幅',
787
+ 'aspect.help': '切换会创建新版本,并调整预览与正式配置的画幅;已保存相机和模型保持,但构图可能改变。请重新完整取景并检查画面。',
788
+ 'aspect.change': '{profile}:{before} → {after}',
789
+ 'aspect.apply': '保存 16:9 画幅',
790
+ 'aspect.done': '预览和正式配置已是 16:9。仍需检查实际取景和影片。',
791
+ 'aspect.unavailable': '当前配置无法安全计算 16:9 尺寸,或宿主需要更新;请检查项目配置。',
792
+ 'aspect.pending': '请先保存或放弃其他草稿,并保存或重置运动草稿。',
793
+ 'aspect.saved': '已保存新的画幅版本;请重新取景并检查。',
794
+ 'aspect.outputMismatch': '所选交付是 16:9,但工程预览或正式画幅不是 16:9,画面可能裁切。请先准备 16:9 画幅并重新取景,或明确检查裁切结果。',
795
+ 'aspect.outputUnknown': '无法确认工程预览和正式画幅;请先检查 16:9 交付的实际构图。',
796
+ 'motion.help': '先从已完整取景的静态相机生成低质量运动预览,确认后保存新相机和运动;原作品与原相机保留。',
797
+ 'motion.camera': '起始相机',
798
+ 'motion.cameraAnimated': '这个相机已有动画,请选择静态相机;也可以先用「完整取景」生成新机位。',
799
+ 'motion.cameraTargeted': '这个相机跟踪场景中的对象,请先用「完整取景」生成静态机位。',
800
+ 'motion.cameraAnimatedOption': '{camera}(已有动画)',
801
+ 'motion.cameraTargetedOption': '{camera}(跟踪对象)',
802
+ 'motion.subject': '检查哪些产品部件',
803
+ 'motion.wholeLamp': '选择完整台灯',
804
+ 'motion.tagged': '选择标记为产品的可见部件',
805
+ 'motion.taggedHint': '请核对是否包括整件可见产品;标签不保证完整,隐藏部件不参与入镜检查。',
806
+ 'motion.hidden': '(已隐藏,不参与入镜检查)',
807
+ 'motion.tooMany': '标记为产品的可见部件超过 128 个,无法一次检查全部部件;请调整场景或自行检查未选部分。',
808
+ 'motion.duration': '时长(秒)',
809
+ 'motion.amount': '推进幅度(%)',
810
+ 'motion.direction': '方向',
811
+ 'motion.forward': '向前推进',
812
+ 'motion.backward': '向后拉远',
813
+ 'motion.extend': '如有需要,允许延长项目时间范围;已有动画需要重新检查',
814
+ 'motion.preview': '生成运动预览',
815
+ 'motion.generating': '正在生成预览…',
816
+ 'motion.cancel': '取消预览',
817
+ 'motion.save': '确认并保存运动',
818
+ 'motion.retry': '重试并找回保存结果',
819
+ 'motion.abandon': '停止找回并重新选择',
820
+ 'motion.abandonHelp': '如果无法找回,可以停止找回并重新选择。先检查版本记录:之前的保存仍可能完成。',
821
+ 'motion.saving': '正在保存…',
822
+ 'motion.discard': '放弃候选',
823
+ 'motion.reset': '重新选择',
824
+ 'motion.stale': '作品版本已改变,请重新选择并生成预览。',
825
+ 'motion.invalid': '请选择静态相机和至少一个完整部件,并检查时长与幅度。',
826
+ 'motion.outOfFrame': '所选部件在运动中超出画面。可减少推进幅度、选择向后拉远,或先调整静态取景后重试;没有保存新版本。',
827
+ 'motion.unverifiable': '无法逐帧核验所选部件。请检查是否含隐藏部件、实例或模拟几何,并选择受支持的可见网格;没有保存新版本。',
828
+ 'motion.limit': '预览为低采样画面;请看完整视频并检查遮挡、位移贴图、闪烁和最终画幅。',
829
+ 'motion.fullCheck': '已逐帧核对预览中所选部件的求值网格。',
830
+ 'motion.savedCheck': '确认保存时,将对重新编译的工程再逐帧检查,未通过则保留原版本。',
831
+ 'motion.savedOutOfFrame': '保存前的逐帧检查发现所选部件出画,未保存新版本。可停止找回并重新选择,调整取景或幅度后再次预览。',
832
+ 'motion.savedUnverifiable': '保存前无法逐帧核验所选部件,未保存新版本。可停止找回并重新选择,检查可见网格和取景后再次预览。',
833
+ 'motion.local': '运动预览需要本机工作台和支持此功能的 Host。',
834
+ 'motion.storage': '无法安全保存恢复信息;请启用浏览器存储后重试。',
835
+ 'motion.uncertain': '未能确认保存结果;请使用同一候选重试,系统会查找已保存的版本。',
836
+ 'motion.saved': '运动已保存到 {revision};请在渲染相机中选择 {camera}。',
837
+ 'motion.failed': '未完成:{message}',
710
838
  'jobs.provenanceUnknown': '帧来源未知',
711
839
  'jobs.provenanceUnchecked': '{count} 帧未在本次状态读取中复核;交付时的记录见交付清单',
712
840
  'jobs.provenanceMixed': '混合配置:{details}',
@@ -718,9 +846,23 @@ window.__ModuleLoader__.load({
718
846
  'jobs.cancel': '取消',
719
847
  'jobs.resume': '继续渲染',
720
848
  'jobs.startDelivery': '启动交付渲染',
849
+ 'jobs.noDeclaredMotion': '当前场景没有声明动画轨道。增加帧数不会自动产生运动;导入素材可能自带动画,请先预览并确认。',
721
850
  'jobs.frameStart': '起始帧',
722
851
  'jobs.frameEnd': '结束帧',
723
852
  'jobs.profile': '渲染配置',
853
+ 'jobs.stillPreset': '交付尺寸',
854
+ 'jobs.stillProfileSize': '使用渲染配置尺寸',
855
+ 'jobs.still2560': '正式静帧 2560×1440(单帧)',
856
+ 'jobs.stillRange': '图片交付或 2560×1440 静帧规格需要起始帧与结束帧相同;引擎与采样沿用所选渲染配置,采样受预算限制。',
857
+ 'jobs.stillUnsupported': '当前 Host 不支持此静帧规格,请更新后重试。',
858
+ 'jobs.video1080': '视频 1920×1080',
859
+ 'jobs.videoPresetHelp': '视频使用项目帧率 {fps} fps;1–144 帧在 24 fps 时为 6 秒。采样、引擎受所选配置及预算控制。',
860
+ 'jobs.videoPresetInvalid': '1080p 视频尺寸只用于视频交付;请切换交付类型或选择其他尺寸。',
861
+ 'jobs.videoPresetUnsupported': '当前 Host 不支持此视频规格,请更新后重试。',
862
+ 'jobs.deliveryKind': '交付类型',
863
+ 'jobs.deliveryVideo': '视频 MP4',
864
+ 'jobs.deliveryStill': '图片 PNG(单帧,无需视频编码)',
865
+ 'jobs.stillKindUnsupported': '当前 Host 不支持独立图片交付,请更新后重试。',
724
866
  'jobs.start': '启动',
725
867
  'qa.passed': '技术校验通过',
726
868
  'qa.none': '无技术校验记录',
@@ -766,10 +908,13 @@ window.__ModuleLoader__.load({
766
908
  "snapshot.title": "保存可编辑副本",
767
909
  "snapshot.scope": "包含 Blender 工程、源文件与相关外部素材。",
768
910
  "snapshot.details": "副本范围",
769
- "snapshot.detailText": "仅包含选定的已保存版本。仅用于观察的外部参考图不另行附带;工程内嵌内容未另行检查。可附带同版本的已完成影片。未保存的编辑不会进入副本。",
911
+ "snapshot.detailText": "仅包含选定的已保存版本。仅用于观察的外部参考图不另行附带;工程内嵌内容未另行检查。可附带同版本的已完成影片和图片。未保存的编辑不会进入副本。",
770
912
  "snapshot.revision": "已保存版本",
771
913
  "snapshot.video": "附带影片",
772
914
  "snapshot.noVideo": "不附带影片",
915
+ "snapshot.images": "附带已完成图片(最多 16 张)",
916
+ "snapshot.noImages": "该版本没有可附带的图片任务。",
917
+ "snapshot.missingImage": "{jobId} 不再可用;取消勾选或刷新后重试。",
773
918
  "snapshot.prepare": "准备下载",
774
919
  "snapshot.preparing": "正在准备副本…",
775
920
  "snapshot.checking": "正在检查已有副本…",
@@ -1005,9 +1150,17 @@ window.__ModuleLoader__.load({
1005
1150
  "assets.reset": "Discard asset draft",
1006
1151
  "assets.saved": "Asset applied in {revision}.",
1007
1152
  "assets.model": "Place in scene (preserve materials)",
1153
+ 'assets.hideExisting': 'Hide an existing object when importing (optional)',
1154
+ 'assets.hideNone': 'Keep every object visible',
1155
+ 'assets.hideHelp': 'The new model may overlap existing objects. Only the object you choose is hidden; the original revision is kept. This can move the default cube out of view.',
1156
+ 'assets.makeSubject': 'Make the new model the creative subject',
1157
+ 'assets.hideSubjectError': 'To hide the explicitly selected subject, first choose the new model as the creative subject.',
1008
1158
  "assets.image": "Bind image material",
1009
1159
  "assets.environment": "Use for environment lighting",
1010
- "assets.dimensions": "Asset dimensions (metres)",
1160
+ "assets.dimensions": "Imported first-frame bounds (scene metres)",
1161
+ "assets.unitsObj": "OBJ does not record physical units. Compare with the real object; scale = real size ÷ the corresponding size above.",
1162
+ "assets.unitsGltf": "glTF uses metres by convention. Check the model against the real object; scale = real size ÷ the corresponding size above.",
1163
+ "assets.scaledDimensions": "Scaled first-frame bounds (metres, before this rotation)",
1011
1164
  "assets.toneMapped": "This tone-mapped preview shows environment lighting; applying uses original HDR / EXR data.",
1012
1165
  "assets.modelHelp": "Position refers to the source origin and scale is relative to the source. Preserve its materials, hierarchy and objects; keep the camera.",
1013
1166
  "assets.entityId": "New object ID",
@@ -1079,6 +1232,21 @@ window.__ModuleLoader__.load({
1079
1232
  'brief.review': "Review saved revision",
1080
1233
  'brief.autofix': "Correct using references",
1081
1234
  'brief.reviewCost': "Clicking renders 640 × 480 previews at 16 samples and calls the vision model. Corrections may create or restore revisions.",
1235
+ 'reviewView.title': 'Review images',
1236
+ 'reviewView.selected': 'Selected saved cameras',
1237
+ 'reviewView.standard': 'Standard view group',
1238
+ 'reviewView.help': 'Render inspection images using the saved project aspect, at most 640 pixels on the long edge and 16 samples, then call the model. Check the cameras and frames. This does not accept the final images or full movie.',
1239
+ 'reviewView.standardHelp': 'Standard views choose cameras by role and do not automatically match delivered images.',
1240
+ 'reviewView.fromImages': 'Use cameras from up to 4 recent completed images',
1241
+ 'reviewView.add': 'Add camera',
1242
+ 'reviewView.remove': 'Remove camera',
1243
+ 'reviewView.invalid': 'Choose 1–4 distinct saved camera/frame pairs within the project range. Refresh if the saved source is unavailable.',
1244
+ 'reviewView.stale': 'This selection belongs to an older revision. Reset it to the current saved revision before reviewing.',
1245
+ 'reviewView.reset': 'Reset to current revision',
1246
+ 'reviewView.noAutofix': 'Selected-camera review returns feedback only. Automatic correction uses standard views.',
1247
+ 'reviewView.scope': 'Actual inspected images · {revision}',
1248
+ 'reviewView.scopeItem': '{camera} · frame {frame} · {resolution} · {samples} samples',
1249
+ 'reviewView.mismatch': 'The returned review image sources do not match this selection. Refresh and check again.',
1082
1250
  'brief.iterations': "Maximum correction rounds",
1083
1251
  'brief.reviewing': "Rendering and reviewing…",
1084
1252
  'brief.fixing': "Running bounded corrections…",
@@ -1102,6 +1270,7 @@ window.__ModuleLoader__.load({
1102
1270
  'fit.reset': 'Read current revision again',
1103
1271
  'fit.cancel': 'Cancel save',
1104
1272
  'fit.saved': 'Complete view saved: {revision} · frame {frame} · {count} parts. Review the preview.',
1273
+ 'fit.savedOtherPreview': 'Complete view saved: {revision}. Its preview is not currently displayed. Check the image source; refresh if it has not updated.',
1105
1274
  'fit.unconfirmed': 'The save is unconfirmed. Retry reuses this request and camera, including after a page refresh.',
1106
1275
  'fit.stale': 'The current revision changed. Read it again before saving.',
1107
1276
  'fit.failed': 'The complete view could not be saved. Check the details, adjust the parts, camera or margin, and retry.',
@@ -1152,6 +1321,23 @@ window.__ModuleLoader__.load({
1152
1321
  "photo.restoreFailed": "Restore failed; the photography record is retained: {message}",
1153
1322
  "photo.reuseUnavailable": "Complete photography settings are unavailable. Select the source again.",
1154
1323
  "photo.reuseTitle": "Reuse photography from saved work",
1324
+ "photo.reuseMode": "Reuse coordinates",
1325
+ "photo.reuseAbsolute": "Original coordinates",
1326
+ "photo.reuseBounds": "Adapt to product bounds",
1327
+ "photo.boundsHelp": "Scale the setup from the measured bounds of both selected static products. Non-sun light size scales by the ratio and power by its square. Keep the destination sensor, aspect and aperture; recalculate focus distance. Preview and reframe as needed; exposure and composition can differ.",
1328
+ "photo.boundsAll": "Select visible non-environment parts",
1329
+ "photo.boundsClear": "Clear selection",
1330
+ "photo.boundsUnavailable": "This Host does not support boundary adaptation. The draft was kept. Update the plugin or explicitly choose original coordinates.",
1331
+ "photo.boundsPick": "Select the complete product on both sides, excluding the environment and supports. Unselected parts do not affect the ratio. Dynamic, hidden or unmeasurable geometry is refused.",
1332
+ "photo.boundsSource": "Source product parts ({count})",
1333
+ "photo.boundsDestination": "Destination product parts ({count})",
1334
+ "photo.boundsFrame": "Source inspection frame",
1335
+ "photo.boundsPlanning": "Reading native bounds from both saved works…",
1336
+ "photo.boundsCancel": "Cancel adaptation",
1337
+ "photo.boundsApplied": "Applied ratio {scale} to the draft: {sourceCount} source parts, {destinationCount} destination parts, source frame {frame}. The camera is sampled at this frame; its animation is not copied.",
1338
+ "photo.boundsInvalid": "Select a valid inspection frame and complete source and destination product parts.",
1339
+ "photo.boundsMismatch": "The adaptation does not match these saved inputs. The photography draft was kept.",
1340
+ "photo.boundsChanged": "The selection or draft changed while inspecting. Current inputs were kept; adapt again.",
1155
1341
  "photo.reuseHelp": "Reuse absolute coordinates in metres, without automatic scaling or framing. Replace all lights and the selected camera’s editable settings. Keep models, materials, world, animation, other cameras and delivery settings. Check the framing before explicitly saving.",
1156
1342
  "photo.reuseProject": "Source work",
1157
1343
  "photo.reuseRevision": "Saved source version",
@@ -1243,6 +1429,15 @@ window.__ModuleLoader__.load({
1243
1429
  'editor.mesh': 'Custom surface',
1244
1430
  'editor.meshCounts': 'Control mesh: {vertices} vertices, {faces} faces',
1245
1431
  'editor.smoothSurface': 'Smooth surface',
1432
+ 'editor.uv.title': 'Texture coordinates',
1433
+ 'editor.uv.saved': 'Using saved per-face UVs.',
1434
+ 'editor.uv.automatic': 'Using default planar UVs; some face directions may stretch the texture.',
1435
+ 'editor.uv.project': 'Rebuild UVs per face on save',
1436
+ 'editor.uv.help': 'For repeating textures such as wood grain. Saving replaces current UVs; faces can overlap. Not a bake atlas or a seamless unwrap.',
1437
+ 'editor.uv.direction': 'Texture direction',
1438
+ 'editor.uv.scale': 'Texture repetitions',
1439
+ 'editor.uv.scaleInvalid': 'Enter repetitions from 0.0001 to 10000.',
1440
+ 'editor.uv.scaleHelp': 'Repetitions across the longest local mesh extent. Only texture coordinates change; check the saved preview.',
1246
1441
  'editor.subdivision': 'Surface subdivision',
1247
1442
  'editor.surfaceScatter': 'Closed surface placement',
1248
1443
  'editor.scatterTargets': 'Support objects (comma separated)',
@@ -1395,6 +1590,7 @@ window.__ModuleLoader__.load({
1395
1590
  'projects.recovered': 'Opened the previously created {id}; no duplicate creation or render',
1396
1591
  'projects.replyMissing': 'The creation result could not be received. Your inputs are kept; retry the previous creation to check the same request.',
1397
1592
  'projects.environmentFailed': 'Blender is not ready. Your inputs are kept; check its installation and path, then retry.',
1593
+ 'projects.environmentAllowlist': 'The Blender path is not permitted. Your inputs are kept; set an absolute Blender path in DSH or allow its directory, then retry.',
1398
1594
  'projects.creationFailed': 'The creation result could not be confirmed. Your inputs are kept; retry the previous creation, or refresh the list to check saved projects.',
1399
1595
  'projects.retryCreation': 'Retry previous creation',
1400
1596
  'projects.originalTitle': 'Previous creation: {title}',
@@ -1460,6 +1656,83 @@ window.__ModuleLoader__.load({
1460
1656
  'preview.identical': 'structurally identical',
1461
1657
  'jobs.empty': 'No render jobs yet.',
1462
1658
  'jobs.deliveryVerified': 'delivery verified',
1659
+ 'jobs.downloadVideo': 'Download MP4 · revision {revision}',
1660
+ 'jobs.downloadFrame': 'Download PNG · revision {revision} · frame {frame}',
1661
+ 'jobs.camera': 'Render camera',
1662
+ 'jobs.cameraDefault': 'Scene default camera',
1663
+ 'jobs.cameraMissing': 'The selected camera is not in this revision. Choose a camera again.',
1664
+ 'motion.title': 'Create a camera push',
1665
+ 'readiness.imageTitle': 'Model image-input check',
1666
+ 'readiness.imageHelp': 'Send one random test image to the configured review model. This may incur model charges and does not change your work. Check again after changing the model or service.',
1667
+ 'readiness.imageRun': 'Check model image input',
1668
+ 'readiness.imageRunning': 'Checking…',
1669
+ 'readiness.imagePass': 'The test image was identified correctly. This does not review artwork or guarantee recognition of every image.',
1670
+ 'readiness.imageAuth': 'Model authentication failed. Check the current service credentials in DSH, then retry.',
1671
+ 'readiness.imageCredentials': 'No usable credentials are configured for the current model service. Set up its credentials in this workbench’s DSH configuration, then check again.',
1672
+ 'readiness.imageUnsupported': 'The configured review model does not declare image input. Check its DSH configuration.',
1673
+ 'readiness.imageModel': 'The selected model is absent from the current service catalog. Check this workbench’s DSH configuration and choose the model’s catalog identifier; its display name may differ. Save, then check again.',
1674
+ 'readiness.imageRoute': 'The configured review model or service is unavailable. Check DSH configuration and service status.',
1675
+ 'readiness.imageRate': 'The model service is rate limited. Try again later.',
1676
+ 'readiness.imageTimeout': 'The check timed out or was cancelled; image input is not verified.',
1677
+ 'readiness.imageBusy': 'The previous check has not finished. Try again later; restart DSH if it remains stuck.',
1678
+ 'readiness.imageInconclusive': 'This check could not confirm the test image was recognized. Check the model service and try again.',
1679
+ 'readiness.imageLocal': 'Run the check in the local workbench; older Hosts need a restart or update.',
1680
+ 'storage.low': 'The project disk reported {space} available, below 2 GiB; a multi-frame render may stop. Free space and refresh.',
1681
+ 'storage.observed': 'The project disk reported {space} available. Rendering may need more.',
1682
+ 'storage.unknown': 'Project disk space could not be measured. Check the project disk before rendering.',
1683
+ 'storage.limit': 'This is a snapshot from the last refresh, not reserved space; system reserves, quotas, temporary directories and other work can affect what is actually writable.',
1684
+ 'aspect.title': 'Prepare a 16:9 delivery frame',
1685
+ 'aspect.help': 'Saving creates a new version and adjusts preview and final frame shapes. Cameras and models stay intact, but composition can change. Refit and inspect the images.',
1686
+ 'aspect.change': '{profile}: {before} → {after}',
1687
+ 'aspect.apply': 'Save 16:9 frame',
1688
+ 'aspect.done': 'Preview and final profiles are already 16:9. Inspect the framing and video.',
1689
+ 'aspect.unavailable': 'A safe 16:9 size cannot be calculated, or the Host needs an update; check the project configuration.',
1690
+ 'aspect.pending': 'Save or discard other drafts and save or reset the motion draft first.',
1691
+ 'aspect.saved': 'Saved a new frame version; refit and inspect the result.',
1692
+ 'aspect.outputMismatch': 'The selected delivery is 16:9, but the project preview or final frame is not; the image may be cropped. Prepare a 16:9 frame and refit, or explicitly check the crop.',
1693
+ 'aspect.outputUnknown': 'The project preview and final frame shapes could not be verified. Check the actual 16:9 composition first.',
1694
+ 'motion.help': 'Preview a low-quality move from a static, fully framed camera; save a new camera and motion after review. The original work and camera are kept.',
1695
+ 'motion.camera': 'Starting camera',
1696
+ 'motion.cameraAnimated': 'This camera already has animation. Choose a static camera, or create one with Complete view first.',
1697
+ 'motion.cameraTargeted': 'This camera tracks an object. Create a static camera with Complete view first.',
1698
+ 'motion.cameraAnimatedOption': '{camera} (animated)',
1699
+ 'motion.cameraTargetedOption': '{camera} (tracks an object)',
1700
+ 'motion.subject': 'Product parts to check',
1701
+ 'motion.wholeLamp': 'Select complete lamp',
1702
+ 'motion.tagged': 'Select visible parts marked as product',
1703
+ 'motion.taggedHint': 'Check the visible product is complete; tags do not guarantee completeness and hidden parts are not inspected.',
1704
+ 'motion.hidden': ' (hidden, not checked for framing)',
1705
+ 'motion.tooMany': 'More than 128 visible parts are marked as product, so one check cannot cover them all. Adjust the scene or inspect the unselected parts yourself.',
1706
+ 'motion.duration': 'Duration (seconds)',
1707
+ 'motion.amount': 'Move amount (%)',
1708
+ 'motion.direction': 'Direction',
1709
+ 'motion.forward': 'Push forward',
1710
+ 'motion.backward': 'Pull back',
1711
+ 'motion.extend': 'Allow extending the project timeline if needed; review existing animation',
1712
+ 'motion.preview': 'Generate motion preview',
1713
+ 'motion.generating': 'Generating preview…',
1714
+ 'motion.cancel': 'Cancel preview',
1715
+ 'motion.save': 'Accept and save motion',
1716
+ 'motion.retry': 'Retry and recover saved result',
1717
+ 'motion.abandon': 'Stop recovery and choose again',
1718
+ 'motion.abandonHelp': 'If recovery is unavailable, you can stop trying and choose again. Check revision history first: the earlier save may still complete.',
1719
+ 'motion.saving': 'Saving…',
1720
+ 'motion.discard': 'Discard candidate',
1721
+ 'motion.reset': 'Choose again',
1722
+ 'motion.stale': 'The saved work changed. Choose again and generate a new preview.',
1723
+ 'motion.invalid': 'Choose a static camera and at least one complete part; check duration and amount.',
1724
+ 'motion.outOfFrame': 'Selected parts leave the frame. Reduce the move, pull back, or adjust the static view and retry; no revision was saved.',
1725
+ 'motion.unverifiable': 'The selected parts could not be checked in every frame. Check for hidden parts, instances or simulated geometry and select supported visible meshes; no revision was saved.',
1726
+ 'motion.limit': 'This is a low-sample preview. Watch the full video and inspect occlusion, displacement, flicker and delivery framing.',
1727
+ 'motion.fullCheck': 'Selected evaluated meshes were checked throughout the preview.',
1728
+ 'motion.savedCheck': 'Saving checks every frame of the recompiled project; the original revision is kept if it fails.',
1729
+ 'motion.savedOutOfFrame': 'The pre-save check found selected geometry outside the frame; no revision was saved. Stop recovery, adjust the framing or amount, and preview again.',
1730
+ 'motion.savedUnverifiable': 'The pre-save frame check could not verify the selection; no revision was saved. Stop recovery, check the visible meshes and framing, and preview again.',
1731
+ 'motion.local': 'Motion preview requires a local workbench and a compatible Host.',
1732
+ 'motion.storage': 'Recovery information could not be stored safely. Enable browser storage and retry.',
1733
+ 'motion.uncertain': 'Save could not be confirmed. Retry the same candidate to recover any saved version.',
1734
+ 'motion.saved': 'Motion saved to {revision}; choose {camera} as the render camera.',
1735
+ 'motion.failed': 'Not completed: {message}',
1463
1736
  'jobs.provenanceUnknown': 'Frame provenance unknown',
1464
1737
  'jobs.provenanceUnchecked': '{count} frames not rechecked in this status read; see the delivery manifest for publication-time evidence',
1465
1738
  'jobs.provenanceMixed': 'Mixed configurations: {details}',
@@ -1471,9 +1744,23 @@ window.__ModuleLoader__.load({
1471
1744
  'jobs.cancel': 'Cancel',
1472
1745
  'jobs.resume': 'Resume render',
1473
1746
  'jobs.startDelivery': 'Start a delivery render',
1747
+ 'jobs.noDeclaredMotion': 'This scene has no declared animation tracks. More frames do not create motion automatically; imported assets may contain animation, so preview and check first.',
1474
1748
  'jobs.frameStart': 'from frame',
1475
1749
  'jobs.frameEnd': 'to frame',
1476
1750
  'jobs.profile': 'Render profile',
1751
+ 'jobs.stillPreset': 'Delivery size',
1752
+ 'jobs.stillProfileSize': 'Use render profile size',
1753
+ 'jobs.still2560': 'Delivery still 2560×1440 (one frame)',
1754
+ 'jobs.stillRange': 'Image delivery or the 2560×1440 still preset requires the same start and end frame; engine and samples come from the selected profile, subject to the sample budget.',
1755
+ 'jobs.stillUnsupported': 'This Host does not support the still preset. Update it and retry.',
1756
+ 'jobs.video1080': 'Video 1920×1080',
1757
+ 'jobs.videoPresetHelp': 'Video uses the project frame rate of {fps} fps; frames 1–144 last 6 seconds at 24 fps. Engine and samples depend on the selected profile and budget.',
1758
+ 'jobs.videoPresetInvalid': 'The 1080p video size requires video delivery. Change the delivery type or size.',
1759
+ 'jobs.videoPresetUnsupported': 'This Host does not support the video size preset. Update it and retry.',
1760
+ 'jobs.deliveryKind': 'Delivery type',
1761
+ 'jobs.deliveryVideo': 'Video MP4',
1762
+ 'jobs.deliveryStill': 'Image PNG (single frame; no video encoding)',
1763
+ 'jobs.stillKindUnsupported': 'This Host does not support image delivery. Update it and retry.',
1477
1764
  'jobs.start': 'Start',
1478
1765
  'qa.passed': 'technical checks passed',
1479
1766
  'qa.none': 'no technical check recorded',
@@ -1519,10 +1806,13 @@ window.__ModuleLoader__.load({
1519
1806
  "snapshot.title": "Save an editable copy",
1520
1807
  "snapshot.scope": "Includes the Blender project, source files and relevant external assets.",
1521
1808
  "snapshot.details": "What the copy includes",
1522
- "snapshot.detailText": "Includes only the selected saved version. External images used only as visual references are omitted; embedded content is not separately inspected. You can include a completed video from the same version. Unsaved edits are not included.",
1809
+ "snapshot.detailText": "Includes only the selected saved version. External images used only as visual references are omitted; embedded content is not separately inspected. You can include completed videos and stills from the same version. Unsaved edits are not included.",
1523
1810
  "snapshot.revision": "Saved version",
1524
1811
  "snapshot.video": "Include a video",
1525
1812
  "snapshot.noVideo": "No video",
1813
+ "snapshot.images": "Include completed images (up to 16)",
1814
+ "snapshot.noImages": "No completed image jobs for this revision.",
1815
+ "snapshot.missingImage": "{jobId} is no longer available; deselect it or refresh and retry.",
1526
1816
  "snapshot.prepare": "Prepare download",
1527
1817
  "snapshot.preparing": "Preparing the copy…",
1528
1818
  "snapshot.checking": "Checking the existing copy…",
@@ -1732,6 +2022,7 @@ window.__ModuleLoader__.load({
1732
2022
  // the header, so the BROWSER makes the request and writes the file. `contract/diagnostics.test.mjs`
1733
2023
  // holds these four paths to the route table the Host actually matches.
1734
2024
  diagnostics: '/deepblend/diagnostics',
2025
+ imageInputProbe: '/deepblend/readiness/image-input',
1735
2026
  }
1736
2027
 
1737
2028
  /** Route for one project's own surfaces. */
@@ -1869,9 +2160,12 @@ window.__ModuleLoader__.load({
1869
2160
  return { entries, available: true }
1870
2161
  } catch { return { entries: [], available: false } }
1871
2162
  }
2163
+ const creationEnvironmentError = code => ['BLENDER_NOT_FOUND', 'RUNTIME_UNAVAILABLE', 'BLENDER_RUNTIME_UNAVAILABLE',
2164
+ 'BLENDER_EXECUTABLE_NOT_EXECUTABLE', 'BLENDER_EXECUTABLE_OUTSIDE_ALLOWLIST'].includes(code)
1872
2165
  function creationErrorMessage(code) {
1873
2166
  if (code === 'UI_FETCH_FAILED' || /^HTTP_/.test(code)) return t('projects.replyMissing')
1874
- if (code === 'BLENDER_NOT_FOUND' || code === 'RUNTIME_UNAVAILABLE') return t('projects.environmentFailed')
2167
+ if (code === 'BLENDER_EXECUTABLE_OUTSIDE_ALLOWLIST') return t('projects.environmentAllowlist')
2168
+ if (creationEnvironmentError(code)) return t('projects.environmentFailed')
1875
2169
  if (code === 'CREATION_REQUEST_CONFLICT') return t('projects.creationConflict')
1876
2170
  if (code === 'UI_HOST_API_STALE') return t('projects.hostNeedsRestart')
1877
2171
  return t('projects.creationFailed')
@@ -2448,6 +2742,7 @@ window.__ModuleLoader__.load({
2448
2742
  do { cloneId = `ui-material-${Date.now().toString(36)}-${++editorSequence}` }
2449
2743
  while (scene.nodes.materials.some(item => item.id === cloneId))
2450
2744
  return { projectId, entityId, baseRevision: scene.revision, original, entity: editorClone(original),
2745
+ uvProjection: null,
2451
2746
  materials: editorClone(scene.nodes.materials), entities: editorClone(scene.nodes.entities),
2452
2747
  tracks: editorClone(scene.nodes.animationTracks || []), cloneId,
2453
2748
  material: { id: material?.id || '', definition: editorClone(material?.definition || null),
@@ -2504,6 +2799,11 @@ window.__ModuleLoader__.load({
2504
2799
  && editorTrackLocked(draft, 'entity', draft.entityId, `${key}.${EDITOR_AXES[axis]}`)) bad(`${key}.${EDITOR_AXES[axis]}`)
2505
2800
  }
2506
2801
  const generator = draft.entity.generator
2802
+ if (draft.uvProjection != null) {
2803
+ if (draft.entity.kind !== 'generator' || generator?.shape !== 'mesh') bad(t('editor.uv.title'))
2804
+ scalar(draft.uvProjection.quarterTurns, t('editor.uv.direction'), 0, 3, true)
2805
+ scalar(draft.uvProjection.scale, t('editor.uv.scale'), 0.0001, 10000)
2806
+ }
2507
2807
  if (generator) {
2508
2808
  if (generator.dimensions !== undefined) {
2509
2809
  if (!['cube', 'rounded_box'].includes(generator.shape) || generator.size !== undefined
@@ -2627,6 +2927,7 @@ window.__ModuleLoader__.load({
2627
2927
  for (const key of ['location', 'rotationEuler']) if (!editorEqual(entity.transform[key], original.transform[key])) transform[key] = editorClone(entity.transform[key])
2628
2928
  if (Object.keys(transform).length > 2) operations.push(transform)
2629
2929
  if (!editorEqual(entity.generator, original.generator)) operations.push({ op: 'entity.generator.set', entityId: draft.entityId, generator: editorClone(entity.generator) })
2930
+ if (draft.uvProjection != null) operations.push({ op: 'entity.uv.project', entityId: draft.entityId, ...editorClone(draft.uvProjection) })
2630
2931
  if (!editorEqual(entity.modifiers, original.modifiers)) operations.push({ op: 'entity.modifiers.set', entityId: draft.entityId, modifiers: editorClone(entity.modifiers) })
2631
2932
  const material = draft.material.definition, baseMaterial = editorMaterialOriginal(draft)
2632
2933
  const changedProperties = material && baseMaterial ? ['baseColor', 'roughness'].filter(key => !editorEqual(material.parameters?.[key], baseMaterial.parameters?.[key])) : []
@@ -2694,6 +2995,7 @@ window.__ModuleLoader__.load({
2694
2995
  }
2695
2996
  if (kind === 'camera') {
2696
2997
  if (!number(editorNumberDefault(item.lens, 50), 0, false)) bad(`${item.id}.lens`)
2998
+ if (!editorEqual(item.focusDistance, original?.focusDistance) && !number(item.focusDistance, 0, false)) bad(`${item.id}.focusDistance`)
2697
2999
  if (item.targetEntityId !== undefined && !draft.entities.some(entity => entity.id === item.targetEntityId)) bad(`${item.id}.targetEntityId`)
2698
3000
  if (item.targetPoint !== undefined && !vector(item.targetPoint)) bad(`${item.id}.targetPoint`)
2699
3001
  if (item.targetEntityId !== undefined && item.targetPoint !== undefined) bad(`${item.id}.target`)
@@ -2718,7 +3020,7 @@ window.__ModuleLoader__.load({
2718
3020
  if (errors.length) throw new Error(t('photo.invalid', { fields: errors.join(', ') }))
2719
3021
  const operations = []
2720
3022
  const replaceLights = draft.reusedLights && !photographySameLights(draft.lights, draft.original.lights)
2721
- for (const [kind, items, fields] of [['camera', draft.cameras, ['lens', 'targetEntityId', 'targetPoint']], ['light', draft.lights, ['energy', 'color', 'size']]]) {
3023
+ for (const [kind, items, fields] of [['camera', draft.cameras, ['lens', 'targetEntityId', 'targetPoint', 'focusDistance']], ['light', draft.lights, ['energy', 'color', 'size']]]) {
2722
3024
  if (kind === 'light' && replaceLights) {
2723
3025
  for (const light of draft.original.lights) operations.push({ op: 'light.remove', lightId: light.id })
2724
3026
  for (const light of items) operations.push({ op: 'light.add', light: editorClone(light) })
@@ -2736,7 +3038,8 @@ window.__ModuleLoader__.load({
2736
3038
  if (Object.keys(changes).length) operations.push({ op: `${kind}.update`, [`${kind}Id`]: item.id, ...changes })
2737
3039
  }
2738
3040
  }
2739
- const note = draft.reuseSource ? t('photo.reuseNote', draft.reuseSource) : null
3041
+ const note = draft.reuseSource ? t('photo.reuseNote', draft.reuseSource)
3042
+ + (draft.reuseSource.normalization ? `\n${JSON.stringify(draft.reuseSource.normalization)}` : '') : null
2740
3043
  return { projectId: draft.projectId, baseRevision: draft.baseRevision, actor: 'ui', saveCheckpoint: true, renderPreview: false, operations, ...(note ? { note } : {}) }
2741
3044
  }
2742
3045
  function photographyDirty(draft) {
@@ -2766,11 +3069,63 @@ window.__ModuleLoader__.load({
2766
3069
  if (next.lights.some(item => !item)) throw new Error(t('photo.reuseUnavailable'))
2767
3070
  next.lightId = next.lights.some(item => item.id === next.lightId) ? next.lightId : next.lights[0]?.id || ''
2768
3071
  next.reusedLights = true
3072
+ delete next.boundaryReuse
2769
3073
  next.reuseSource = { project: source.project.id, revision: source.revision, digest: source.digest, camera: cameraId, target: targetEntityId || '—' }
2770
3074
  const errors = photographyErrors(next)
2771
3075
  if (errors.length) throw new Error(t('photo.invalid', { fields: errors.join(', ') }))
2772
3076
  return next
2773
3077
  }
3078
+ const photographyProductEntities = scene => (scene?.nodes?.entities || []).filter(e => ['generator', 'asset-instance'].includes(e.kind) && e.visible !== false)
3079
+ function photographyProductDefaults(scene, complete) {
3080
+ const choices = photographyProductEntities(scene), ids = choices.map(e => e.id)
3081
+ if (complete?.length && complete.length <= 128 && complete.every(id => ids.includes(id))) return [...complete].sort()
3082
+ const tagged = choices.filter(e => e.tags?.some(tag => ['hero-product', 'subject', 'subject-part'].includes(tag))).map(e => e.id)
3083
+ if (tagged.length && tagged.length <= 128) return tagged.sort()
3084
+ return choices.length === 1 ? [choices[0].id] : []
3085
+ }
3086
+ function photographyBoundaryRequest(state, selection, draft) {
3087
+ const source = selection?.source, scene = state.selected?.scene
3088
+ const valid = (values, nodes) => Array.isArray(values) && values.length >= 1 && values.length <= 128
3089
+ && new Set(values).size === values.length && values.every(id => photographyProductEntities(nodes).some(e => e.id === id))
3090
+ if (!state.photographyBoundaryReuseSupported || !draft || selection?.mode !== 'bounds'
3091
+ || !/^[a-f0-9]{64}$/.test(state.storeIdentity || '') || selection.storeIdentity !== state.storeIdentity || !/^[a-f0-9]{64}$/.test(scene?.digest || '')
3092
+ || !/^[a-f0-9]{64}$/.test(source?.digest || '') || source.project?.id !== selection.sourceProjectId
3093
+ || source.revision !== selection.revision || draft.baseRevision !== scene.revision
3094
+ || !source.nodes.cameras.some(c => c.id === selection.cameraId) || !draft.cameras.some(c => c.id === draft.cameraId)
3095
+ || !valid(selection.sourceEntityIds, source) || !valid(selection.destinationEntityIds, scene)
3096
+ || !Number.isSafeInteger(selection.sourceFrame) || selection.sourceFrame < source.project.frameStart || selection.sourceFrame > source.project.frameEnd
3097
+ || !Number.isSafeInteger(draft.frame) || draft.frame < draft.frameStart || draft.frame > draft.frameEnd) return null
3098
+ return { projectId: draft.projectId, baseRevision: draft.baseRevision, expectedDigest: scene.digest, expectedStoreIdentity: state.storeIdentity,
3099
+ cameraId: draft.cameraId, frame: draft.frame, entityIds: [...selection.destinationEntityIds].sort(),
3100
+ source: { projectId: source.project.id, revision: source.revision, digest: source.digest, cameraId: selection.cameraId,
3101
+ frame: selection.sourceFrame, entityIds: [...selection.sourceEntityIds].sort() } }
3102
+ }
3103
+ function applyBoundaryPhotography(draft, source, plan, request) {
3104
+ if (!plan || plan.schemaVersion !== 'deepblend.photography-reuse/v1' || creationSignature(plan.request) !== creationSignature(request)
3105
+ || plan.camera?.id !== draft.cameraId || !Number.isFinite(plan.scale) || plan.scale < .001 || plan.scale > 1000
3106
+ || plan.provenance?.mode !== 'product-bounds-v1' || plan.provenance.sourceDigest !== request.source.digest
3107
+ || plan.provenance.destinationDigest !== request.expectedDigest || plan.provenance.scale !== plan.scale
3108
+ || plan.provenance.sourceProject !== request.source.projectId || plan.provenance.sourceRevision !== request.source.revision
3109
+ || plan.provenance.sourceCamera !== request.source.cameraId || plan.provenance.sourceFrame !== request.source.frame
3110
+ || plan.provenance.destinationFrame !== request.frame || plan.provenance.storeIdentity !== request.expectedStoreIdentity || !Array.isArray(plan.lights)
3111
+ || creationSignature(plan.lights.map(l => l.id).sort()) !== creationSignature(source.nodes.lights.map(l => l.id).sort())) throw new Error(t('photo.boundsMismatch'))
3112
+ const next = editorClone(draft), camera = next.cameras.find(c => c.id === next.cameraId)
3113
+ camera.lens = plan.camera.lens
3114
+ camera.transform ||= {}
3115
+ camera.transform.location = editorClone(plan.camera.transform?.location)
3116
+ camera.transform.rotationEuler = editorClone(plan.camera.transform?.rotationEuler)
3117
+ if (camera.fStop !== undefined) camera.focusDistance = plan.camera.focusDistance
3118
+ delete camera.targetEntityId; delete camera.targetPoint
3119
+ next.lights = editorClone(plan.lights); next.reusedLights = true
3120
+ next.lightId = next.lights.some(l => l.id === next.lightId) ? next.lightId : next.lights[0]?.id || ''
3121
+ next.reuseSource = { project: request.source.projectId, revision: request.source.revision, digest: request.source.digest,
3122
+ camera: request.source.cameraId, target: '—', normalization: editorClone(plan.provenance) }
3123
+ next.boundaryReuse = { scale: plan.scale, sourceFrame: request.source.frame, sourceCameraStatic: plan.sourceStaticCamera,
3124
+ sourceCount: request.source.entityIds.length, destinationCount: request.entityIds.length }
3125
+ const errors = photographyErrors(next)
3126
+ if (errors.length) throw new Error(t('photo.invalid', { fields: errors.join(', ') }))
3127
+ return next
3128
+ }
2774
3129
  function inspectionReceiptValid(receipt, request, digest) {
2775
3130
  const artifacts = receipt?.artifacts, view = request.views[0]
2776
3131
  return Boolean(receipt?.revision === request.revision && receipt?.sourceRevision === request.revision && receipt?.mode === request.mode
@@ -2844,7 +3199,7 @@ window.__ModuleLoader__.load({
2844
3199
  const id = `ui-asset-${Date.now().toString(36)}-${++editorSequence}`
2845
3200
  const draft = { projectId, baseRevision: scene.revision, scene: editorClone(scene), entry: editorClone(entry),
2846
3201
  inspection: editorClone(inspection), kind: assetKind(entry.asset), newEntityId: id, newMaterialId: `${id}-material`,
2847
- location: [0, 0, 0], rotationEuler: [0, 0, 0], scale: 1,
3202
+ location: [0, 0, 0], rotationEuler: [0, 0, 0], scale: 1, hideEntityId: '', makeSubject: false,
2848
3203
  entityId: entityId || scene.nodes.entities.find(item => item.kind !== 'empty')?.id || '',
2849
3204
  target: 'entity', partId: '', slotIndex: '', scope: 'local', newMaterial: false,
2850
3205
  channel: 'baseColor', binding: {}, replaceTexture: false,
@@ -2875,6 +3230,14 @@ window.__ModuleLoader__.load({
2875
3230
  if (!Number.isFinite(draft.scale) || draft.scale <= 0) fail('scale')
2876
3231
  operations.push({ op: 'entity.add', entity: { id: draft.newEntityId, type: 'asset-instance', assetId: asset.id,
2877
3232
  transform: { location: [...draft.location], rotationEuler: [...draft.rotationEuler], scale: [draft.scale, draft.scale, draft.scale] } } })
3233
+ if (typeof draft.hideEntityId !== 'string' || typeof draft.makeSubject !== 'boolean') fail('model options')
3234
+ if (draft.hideEntityId) {
3235
+ const hidden = draft.scene.nodes.entities.find(entity => entity.id === draft.hideEntityId)
3236
+ if (!hidden || hidden.visible === false || hidden.locked || hidden.kind === 'empty') fail('existing object')
3237
+ if (draft.scene.project.reviewSubjectId === hidden.id && !draft.makeSubject) throw new Error(t('assets.hideSubjectError'))
3238
+ operations.push({ op: 'entity.visibility.set', entityId: hidden.id, visible: false })
3239
+ }
3240
+ if (draft.makeSubject) operations.push({ op: 'project.reviewSubject.set', entityId: draft.newEntityId })
2878
3241
  } else if (draft.kind === 'environment') {
2879
3242
  if (!Number.isFinite(draft.strength) || draft.strength < 0 || draft.strength > 1000 || !Number.isFinite(draft.rotation)) fail('environment')
2880
3243
  operations.push({ op: 'world.set', world: { ...editorClone(draft.world), strength: draft.strength,
@@ -2938,6 +3301,39 @@ window.__ModuleLoader__.load({
2938
3301
  && Number.isInteger(form.samples) && form.samples >= 1 && form.samples <= 512)
2939
3302
  }
2940
3303
 
3304
+ const reviewSelectionKey = state => JSON.stringify([state.projectsRoot, state.storeIdentity, state.activeProjectId])
3305
+ function reviewSelectionFor(state) {
3306
+ const scene = state.selected?.scene
3307
+ if (!scene) return null
3308
+ return state.reviewSelections?.[reviewSelectionKey(state)] || { baseRevision: scene.revision,
3309
+ mode: state.selectedReviewViewsSupported ? 'selected' : 'standard', views: [{ id: 'review-1',
3310
+ cameraId: scene.project.activeCamera || scene.nodes.cameras?.[0]?.id || '', frame: scene.project.frameStart ?? 1 }] }
3311
+ }
3312
+ function reviewSelectionValid(state, selection = reviewSelectionFor(state)) {
3313
+ const scene = state.selected?.scene
3314
+ if (!scene || scene.project?.id !== state.activeProjectId || !selection || !state.selectedReviewViewsSupported || selection.baseRevision !== scene.revision
3315
+ || !/^[a-f0-9]{64}$/.test(state.storeIdentity || '') || !/^[a-f0-9]{64}$/.test(scene.digest || '')
3316
+ || !Array.isArray(selection.views) || selection.views.length < 1 || selection.views.length > 4) return false
3317
+ const pairs = new Set()
3318
+ return selection.views.every(view => {
3319
+ const pair = JSON.stringify([view.cameraId, view.frame])
3320
+ if (!scene.nodes.cameras.some(camera => camera.id === view.cameraId) || !Number.isSafeInteger(view.frame)
3321
+ || view.frame < scene.project.frameStart || view.frame > scene.project.frameEnd || pairs.has(pair)) return false
3322
+ pairs.add(pair); return true
3323
+ })
3324
+ }
3325
+ function completedReviewViews(state) {
3326
+ const scene = state.selected?.scene
3327
+ if (!scene) return []
3328
+ const pairs = new Map()
3329
+ for (const job of snapshotImages(state, scene.revision).slice().sort((a, b) => String(a.jobId).localeCompare(String(b.jobId)))) {
3330
+ const cameraId = job.cameraId, frame = job.delivery.image.frame
3331
+ if (!scene.nodes.cameras.some(camera => camera.id === cameraId) || frame < scene.project.frameStart || frame > scene.project.frameEnd) continue
3332
+ const pair = JSON.stringify([cameraId, frame]); pairs.delete(pair); pairs.set(pair, { cameraId, frame })
3333
+ }
3334
+ return [...pairs.values()].slice(-4).map((view, i) => ({ id: `review-${i + 1}`, ...view }))
3335
+ }
3336
+
2941
3337
  const REFERENCE_PURPOSES = ['geometry', 'materials', 'lighting', 'goalFit']
2942
3338
  const REFERENCE_MAX_BYTES = 8 * 1024 * 1024
2943
3339
  function createBriefDraft(scene, projectId) {
@@ -2977,6 +3373,51 @@ window.__ModuleLoader__.load({
2977
3373
  frame: Math.min(scene.project.frameEnd ?? 24, Math.max(scene.project.frameStart ?? 1, 24)), marginPercent: 3,
2978
3374
  completeEntityIds: complete ? [...complete].sort() : null, touched: false, attempt: null, storageError: false }
2979
3375
  }
3376
+ const motionKey = state => JSON.stringify([state.projectsRoot, state.storeIdentity, state.activeProjectId])
3377
+ function wideFramePlan(scene) {
3378
+ if (!scene?.renderProfiles || !scene?.project) return null
3379
+ const profiles = []
3380
+ for (const name of ['preview', 'final']) {
3381
+ const resolution = scene.renderProfiles[name]?.resolution
3382
+ if (!Array.isArray(resolution) || resolution.length !== 2 || !resolution.every(value => Number.isSafeInteger(value) && value >= 16 && value <= 16384)) return null
3383
+ const [width, height] = resolution
3384
+ const wide = width * 9 === height * 16
3385
+ const newWidth = wide ? width : Math.floor(Math.min(width, Math.sqrt(width * height * 16 / 9)) / 16) * 16
3386
+ if (newWidth < 32 || newWidth > 16384) return null
3387
+ const after = wide ? [...resolution] : [newWidth, newWidth * 9 / 16]
3388
+ if (after[1] < 16 || after[0] * after[1] > width * height) return null
3389
+ profiles.push({ name, before: [...resolution], after })
3390
+ }
3391
+ return { profiles, changed: scene.project.aspectRatio !== '16:9' || profiles.some(item => !editorEqual(item.before, item.after)) }
3392
+ }
3393
+ const motionDraftFor = state => state.motionDrafts?.[motionKey(state)] || null
3394
+ function createMotionDraft(scene, projectId, projectsRoot, storeIdentity, source) {
3395
+ const fit = createCameraFitDraft(scene, projectId, projectsRoot, source)
3396
+ const tagged = fit.entities.filter(entity => entity.visible !== false && entity.tags?.includes('hero-product')).map(entity => entity.id).sort()
3397
+ const animated = new Set((scene.nodes.animationTracks || []).filter(track => track.targetKind === 'camera').map(track => track.targetId))
3398
+ const cameraRestrictions = Object.fromEntries((scene.nodes.cameras || []).flatMap(camera => animated.has(camera.id) ? [[camera.id, 'animated']]
3399
+ : camera.targetEntityId ? [[camera.id, 'targeted']] : []))
3400
+ return { projectId, projectsRoot, storeIdentity, baseRevision: scene.revision, entities: fit.entities,
3401
+ cameras: fit.cameras, cameraRestrictions, completeEntityIds: fit.completeEntityIds, taggedEntityIds: tagged.length <= 128 ? tagged : [], taggedOverflow: tagged.length > 128, entityIds: fit.entityIds, cameraId: fit.cameraId,
3402
+ seconds: '6', amount: '8', direction: 'forward', allowRangeExtension: false, result: null, storageError: false, touched: false }
3403
+ }
3404
+ function validMotionDraft(draft) {
3405
+ return Boolean(draft && draft.cameras.includes(draft.cameraId) && !draft.cameraRestrictions?.[draft.cameraId] && draft.entityIds.length > 0 && draft.entityIds.length <= 128
3406
+ && new Set(draft.entityIds).size === draft.entityIds.length && draft.entityIds.every(id => draft.entities.some(entity => entity.id === id && entity.visible !== false))
3407
+ && Number.isFinite(Number(draft.seconds)) && Number(draft.seconds) >= 1 && Number(draft.seconds) <= 10
3408
+ && Number.isFinite(Number(draft.amount)) && Number(draft.amount) >= 1 && Number(draft.amount) <= 20
3409
+ && ['forward', 'backward'].includes(draft.direction))
3410
+ }
3411
+ const motionStorageKey = (root, identity, id) => `deepblend.motion-preview/v1:${JSON.stringify([root, identity, id])}`
3412
+ function validMotionReceipt(receipt, draft) {
3413
+ return Boolean(receipt && /^[a-f0-9-]{36}$/.test(receipt.id || '') && /^[a-f0-9]{64}$/.test(receipt.intentSha256 || '')
3414
+ && receipt.projectId === draft.projectId && receipt.baseRevision === draft.baseRevision
3415
+ && /^[a-zA-Z][a-zA-Z0-9._-]{0,127}$/.test(receipt.cameraId || '') && receipt.sourceCameraId === draft.cameraId
3416
+ && Number.isSafeInteger(receipt.expiresAt) && Number.isSafeInteger(receipt.frameStart) && Number.isSafeInteger(receipt.frameEnd)
3417
+ && Number.isSafeInteger(receipt.fps) && receipt.video && /^[a-f0-9]{64}$/.test(receipt.video.sha256 || '')
3418
+ && Number.isSafeInteger(receipt.video.bytes) && receipt.video.bytes > 0 && receipt.video.bytes <= 32 * 1024 * 1024
3419
+ && Number.isSafeInteger(receipt.video.frames) && receipt.video.frames === receipt.frameEnd - receipt.frameStart + 1)
3420
+ }
2980
3421
  const cameraFitInvalid = draft => !draft || !draft.cameras.includes(draft.cameraId)
2981
3422
  || draft.entityIds.length < 1 || draft.entityIds.length > 64 || new Set(draft.entityIds).size !== draft.entityIds.length
2982
3423
  || draft.entityIds.some(id => !draft.entities.some(entity => entity.id === id))
@@ -3164,12 +3605,13 @@ window.__ModuleLoader__.load({
3164
3605
  }
3165
3606
 
3166
3607
  /** POST a JSON body and return the parsed payload. Errors come back as data. */
3167
- async function postJson(fetchImpl, path, body) {
3608
+ async function postJson(fetchImpl, path, body, signal) {
3168
3609
  try {
3169
3610
  const response = await fetchImpl(path, {
3170
3611
  method: 'POST',
3171
3612
  headers: { 'content-type': 'application/json', accept: 'application/json' },
3172
3613
  body: JSON.stringify(body || {}),
3614
+ ...(signal ? { signal } : {}),
3173
3615
  })
3174
3616
  const payload = await response.json()
3175
3617
  if (payload && payload.ok) return { ok: true, payload }
@@ -3222,9 +3664,13 @@ window.__ModuleLoader__.load({
3222
3664
  const snapshotEntry = state => state.editableSnapshots?.[snapshotContextKey(state)] || null
3223
3665
  const snapshotVideos = (state, revision) => (state.jobs || []).filter(job => job.status === 'completed'
3224
3666
  && job.revisionId === revision && typeof job.delivery?.videoPath === 'string' && job.delivery.videoPath.length > 0)
3667
+ const snapshotImages = (state, revision) => (state.jobs || []).filter(job => job.status === 'completed' && job.revisionId === revision
3668
+ && job.delivery?.kind === 'still' && job.delivery.verified === true && Number.isSafeInteger(job.delivery.image?.frame)
3669
+ && /^[a-f0-9]{64}$/.test(job.delivery.image?.sha256 || '') && /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$/.test(job.jobId || ''))
3225
3670
  const snapshotSupported = state => state.editableSnapshotProtocol === 1 && /^[a-f0-9]{64}$/.test(state.storeIdentity || '')
3226
3671
  && state.editableSnapshotAvailability?.available === true
3227
3672
  const snapshotSameSelection = entry => entry?.handle && entry.revision === entry.handle.revision && entry.videoJobId === entry.handle.videoJobId
3673
+ && JSON.stringify(entry.imageJobIds || []) === JSON.stringify(entry.handle.imageJobIds || [])
3228
3674
  const snapshotBytes = value => value >= 1048576 ? `${(value / 1048576).toFixed(1)} MiB` : value >= 1024 ? `${(value / 1024).toFixed(1)} KiB` : `${value} B`
3229
3675
  const snapshotExportId = async requestId => `snapshot-${(await imageByteHash(Uint8Array.from(requestId, char => char.charCodeAt(0)), undefined, true)).slice(0, 40)}`
3230
3676
  function validSnapshotHandle(handle) {
@@ -3232,10 +3678,14 @@ window.__ModuleLoader__.load({
3232
3678
  && /^snapshot-[a-f0-9]{40}$/.test(handle.exportId || '') && /^[a-f0-9]{64}$/.test(handle.storeIdentity || '')
3233
3679
  && typeof handle.projectId === 'string' && handle.projectId.length > 0 && handle.projectId.length <= 200
3234
3680
  && /^r[0-9]+$/.test(handle.revision || '') && (handle.videoJobId === null || typeof handle.videoJobId === 'string' && handle.videoJobId.length > 0 && handle.videoJobId.length <= 200)
3681
+ && (handle.imageJobIds === undefined || Array.isArray(handle.imageJobIds) && handle.imageJobIds.length > 0 && handle.imageJobIds.length <= 16
3682
+ && handle.imageJobIds.every(id => typeof id === 'string' && /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$/.test(id))
3683
+ && JSON.stringify([...new Set(handle.imageJobIds)].sort()) === JSON.stringify(handle.imageJobIds))
3235
3684
  }
3236
3685
  function validSnapshotReply(value, handle) {
3237
3686
  if (!value || !['preparing', 'ready', 'failed', 'cancelled'].includes(value.state)
3238
- || ['requestId', 'exportId', 'storeIdentity', 'projectId', 'revision', 'videoJobId'].some(key => value[key] !== handle[key])) return false
3687
+ || ['requestId', 'exportId', 'storeIdentity', 'projectId', 'revision', 'videoJobId'].some(key => value[key] !== handle[key])
3688
+ || JSON.stringify(value.imageJobIds || []) !== JSON.stringify(handle.imageJobIds || [])) return false
3239
3689
  if (value.state === 'ready') {
3240
3690
  const expected = projectRoute(handle.projectId, `/editable-snapshots/${handle.exportId}/download?storeIdentity=${handle.storeIdentity}`)
3241
3691
  if (value.downloadUrl !== expected || !Number.isSafeInteger(value.archive?.bytes) || value.archive.bytes <= 0
@@ -3254,8 +3704,16 @@ window.__ModuleLoader__.load({
3254
3704
  projects: [],
3255
3705
  projectsRoot: null,
3256
3706
  storeIdentity: null,
3707
+ projectStorage: null,
3257
3708
  editableSnapshotProtocol: null,
3258
3709
  editableSnapshotAvailability: null,
3710
+ snapshotImagesSupported: false,
3711
+ renderVideoDownloadSupported: false,
3712
+ renderFrameDownloadSupported: false,
3713
+ stillDeliveryPresetSupported: false,
3714
+ videoDeliveryPresetSupported: false,
3715
+ deliveryAspectPresetSupported: false,
3716
+ stillImageDeliverySupported: false,
3259
3717
  editableSnapshots: {},
3260
3718
  recipeCatalog: { recipes: [], errors: [] },
3261
3719
  selected: null,
@@ -3281,6 +3739,7 @@ window.__ModuleLoader__.load({
3281
3739
  creationWork: null,
3282
3740
  creationRequestProtocol: null,
3283
3741
  cameraTargetResetSupported: false,
3742
+ photographyBoundaryReuseSupported: false,
3284
3743
  creationDrafts: [],
3285
3744
  creationDraftStorageStatus: null,
3286
3745
  creationDraftMissingRecipe: null,
@@ -3299,6 +3758,8 @@ window.__ModuleLoader__.load({
3299
3758
  briefWork: {},
3300
3759
  visualRuns: {},
3301
3760
  visualIterations: {},
3761
+ reviewSelections: {},
3762
+ selectedReviewViewsSupported: false,
3302
3763
  photographyDrafts: {},
3303
3764
  photographyWork: {},
3304
3765
  photographyEdits: {},
@@ -3313,9 +3774,14 @@ window.__ModuleLoader__.load({
3313
3774
  cameraFitDrafts: {},
3314
3775
  cameraFitWork: {},
3315
3776
  cameraFitSupported: false,
3777
+ motionDrafts: {},
3778
+ motionWork: {},
3779
+ motionPreviewSupported: false,
3780
+ imageInputProbeSupported: false,
3781
+ imageInputProbe: { busy: false, result: null },
3316
3782
  patchDrafts: {},
3317
3783
  recipeChoices: [],
3318
- forms: { title: '', goal: '', recipe: null, recipeParameters: {}, patch: null, frameStart: '', frameEnd: '', profile: 'preview' },
3784
+ forms: { title: '', goal: '', recipe: null, recipeParameters: {}, patch: null, frameStart: '', frameEnd: '', profile: 'preview', renderCamera: '', stillPreset: '', deliveryKind: '' },
3319
3785
  busy: { create: false, patch: false, editor: false, assembly: false, placement: false, render: false, restore: false },
3320
3786
  notices: { projects: null, scene: null, preview: null, jobs: null, revisions: null },
3321
3787
  }
@@ -3387,6 +3853,10 @@ window.__ModuleLoader__.load({
3387
3853
  const placementControllers = new Map()
3388
3854
  const cameraFitControllers = new Map()
3389
3855
  const cameraFitStorage = settings.cameraFitStorage ?? preferenceStorage
3856
+ const motionControllers = new Map()
3857
+ let imageProbeController = null
3858
+ const motionStorage = settings.motionStorage ?? preferenceStorage
3859
+ const motionWork = (key, changes) => set({ motionWork: { ...data.motionWork, [key]: { ...data.motionWork[key], ...changes } } })
3390
3860
  const photographySourceControllers = new Map()
3391
3861
  let photographySourceSequence = 0
3392
3862
  const photographyWork = (projectId, changes) => set({ photographyWork: { ...data.photographyWork, [projectId]: { ...data.photographyWork[projectId], ...changes } } })
@@ -3549,10 +4019,22 @@ window.__ModuleLoader__.load({
3549
4019
  recipeCatalog: payload.recipeCatalog ?? { recipes: [], errors: [] },
3550
4020
  projectsRoot: payload.projectsRoot ?? null,
3551
4021
  storeIdentity: payload.storeIdentity ?? null,
4022
+ projectStorage: payload.projectStorage ?? null,
3552
4023
  editableSnapshotProtocol: payload.editableSnapshotProtocol ?? null,
3553
4024
  editableSnapshotAvailability: payload.editableSnapshotAvailability ?? null,
4025
+ snapshotImagesSupported: payload.snapshotImagesSupported === true,
4026
+ renderVideoDownloadSupported: payload.renderVideoDownloadSupported === true,
4027
+ renderFrameDownloadSupported: payload.renderFrameDownloadSupported === true,
4028
+ stillDeliveryPresetSupported: payload.stillDeliveryPresetSupported === true,
4029
+ videoDeliveryPresetSupported: payload.videoDeliveryPresetSupported === true,
4030
+ deliveryAspectPresetSupported: payload.deliveryAspectPresetSupported === true,
4031
+ stillImageDeliverySupported: payload.stillImageDeliverySupported === true,
4032
+ motionPreviewSupported: payload.motionPreviewSupported === true,
4033
+ imageInputProbeSupported: payload.imageInputProbeSupported === true,
4034
+ selectedReviewViewsSupported: payload.selectedReviewViewsSupported === true,
3554
4035
  creationRequestProtocol: payload.creationRequestProtocol ?? null,
3555
4036
  cameraTargetResetSupported: payload.cameraTargetResetSupported === true,
4037
+ photographyBoundaryReuseSupported: payload.photographyBoundaryReuseSupported === true,
3556
4038
  assemblyPlacementSupported: payload.assemblyPlacementSupported === true,
3557
4039
  cameraFitSupported: payload.cameraFitSupported === true,
3558
4040
  selected: payload.selected ?? null,
@@ -3599,8 +4081,23 @@ window.__ModuleLoader__.load({
3599
4081
  }
3600
4082
  if (sequence !== loadSequence || projectId !== target()) return
3601
4083
  if (active !== data.activeProjectId) patch.forms = { ...data.forms, patch: data.patchDrafts[active] ?? null }
4084
+ if (active !== data.activeProjectId || patch.projectsRoot !== data.projectsRoot || patch.storeIdentity !== data.storeIdentity)
4085
+ patch.forms = { ...(patch.forms || data.forms), renderCamera: '' }
3602
4086
  if (patch.selected?.scene && active) {
3603
4087
  const source = patch.selected.recipeParameters
4088
+ const motionContext = JSON.stringify([patch.projectsRoot, patch.storeIdentity, active])
4089
+ if (!data.motionDrafts[motionContext] && patch.storeIdentity) {
4090
+ const draft = createMotionDraft(patch.selected.scene, active, patch.projectsRoot, patch.storeIdentity, source)
4091
+ try {
4092
+ const raw = motionStorage?.getItem(motionStorageKey(patch.projectsRoot, patch.storeIdentity, active))
4093
+ if (raw && raw.length <= 8192) {
4094
+ const saved = JSON.parse(raw)
4095
+ const candidate = { ...draft, baseRevision: saved.baseRevision, cameraId: saved.sourceCameraId }
4096
+ if (validMotionReceipt(saved, candidate) && (saved.expiresAt > Date.now() || saved.saveAttempted === true)) Object.assign(draft, candidate, { result: saved })
4097
+ }
4098
+ } catch { draft.storageError = true }
4099
+ patch.motionDrafts = { ...data.motionDrafts, [motionContext]: draft }
4100
+ }
3604
4101
  const fitKey = JSON.stringify([patch.projectsRoot, active]), fitted = data.cameraFitDrafts[fitKey]
3605
4102
  if ((!fitted || !cameraFitDirty(fitted)) && !cameraFitControllers.has(fitKey)) {
3606
4103
  const next = createCameraFitDraft(patch.selected.scene, active, patch.projectsRoot, source)
@@ -3641,7 +4138,7 @@ window.__ModuleLoader__.load({
3641
4138
  if (creationDraftRoot !== null) {
3642
4139
  creationAttempt = null; restoredCreationSource = null; creationDraftId = newCreationKey()
3643
4140
  patch.creationWork = null; patch.creationDraftMissingRecipe = null; patch.recipeChoices = []
3644
- patch.forms = { ...data.forms, title: '', goal: '', recipe: null, recipeParameters: {} }
4141
+ patch.forms = { ...(patch.forms || data.forms), title: '', goal: '', recipe: null, recipeParameters: {} }
3645
4142
  }
3646
4143
  creationDraftRoot = typeof patch.projectsRoot === 'string' && patch.projectsRoot ? patch.projectsRoot : null
3647
4144
  persistedCreationSignature = null
@@ -3707,7 +4204,7 @@ window.__ModuleLoader__.load({
3707
4204
  let handle = null, storageUnavailable = false
3708
4205
  try { handle = storedSnapshots().find(record => record.key === key)?.handle || null } catch { storageUnavailable = true }
3709
4206
  if (handle && (handle.storeIdentity !== data.storeIdentity || handle.projectId !== data.activeProjectId)) handle = null
3710
- entry = { revision: handle?.revision || data.currentRevision, videoJobId: handle?.videoJobId || null, handle, result: null, issue: null, busy: {}, attempt: 0, storageUnavailable }
4207
+ entry = { revision: handle?.revision || data.currentRevision, videoJobId: handle?.videoJobId || null, imageJobIds: handle?.imageJobIds || [], handle, result: null, issue: null, busy: {}, attempt: 0, storageUnavailable }
3711
4208
  }
3712
4209
  changeSnapshot(key, { ...entry, busy: {} })
3713
4210
  if (entry.handle && running && snapshotSupported(data)) void snapshotRequest('check')
@@ -3720,7 +4217,8 @@ window.__ModuleLoader__.load({
3720
4217
  }
3721
4218
  async function snapshotControl(handle, kind, signal) {
3722
4219
  const suffix = kind === 'prepare' ? '' : `/${handle.exportId}${kind === 'cancel' ? '/cancel' : ''}`
3723
- const body = kind === 'prepare' ? { requestId: handle.requestId, revision: handle.revision, ...(handle.videoJobId ? { videoJobId: handle.videoJobId } : {}), expectedStoreIdentity: handle.storeIdentity }
4220
+ const body = kind === 'prepare' ? { requestId: handle.requestId, revision: handle.revision, ...(handle.videoJobId ? { videoJobId: handle.videoJobId } : {}),
4221
+ ...(handle.imageJobIds?.length ? { imageJobIds: handle.imageJobIds } : {}), expectedStoreIdentity: handle.storeIdentity }
3724
4222
  : kind === 'cancel' ? { expectedStoreIdentity: handle.storeIdentity } : null
3725
4223
  const response = await fetchImpl(projectRoute(handle.projectId, `/editable-snapshots${suffix}`), {
3726
4224
  method: body ? 'POST' : 'GET', cache: 'no-store', headers: { accept: 'application/json', ...(body ? { 'content-type': 'application/json' } : {}) },
@@ -3749,10 +4247,11 @@ window.__ModuleLoader__.load({
3749
4247
  let handle = entry.handle
3750
4248
  if (kind === 'prepare' && !snapshotSameSelection(entry)) {
3751
4249
  if (!(data.selected?.revisions || []).some(item => item.revision === entry.revision)
3752
- || entry.videoJobId && !snapshotVideos(data, entry.revision).some(job => job.jobId === entry.videoJobId)) throw Object.assign(new Error('Saved source unavailable'), { code: 'UI_SNAPSHOT_MISMATCH' })
4250
+ || entry.videoJobId && !snapshotVideos(data, entry.revision).some(job => job.jobId === entry.videoJobId)
4251
+ || entry.imageJobIds?.length && (!data.snapshotImagesSupported || entry.imageJobIds.some(id => !snapshotImages(data, entry.revision).some(job => job.jobId === id)))) throw Object.assign(new Error('Saved source unavailable'), { code: 'UI_SNAPSHOT_MISMATCH' })
3753
4252
  const requestId = newCreationKey().replace(/^create-/, 'copy-')
3754
4253
  handle = { requestId, exportId: await snapshotExportId(requestId), projectId: data.activeProjectId,
3755
- revision: entry.revision, videoJobId: entry.videoJobId, storeIdentity: data.storeIdentity }
4254
+ revision: entry.revision, videoJobId: entry.videoJobId, ...(entry.imageJobIds?.length ? { imageJobIds: [...entry.imageJobIds] } : {}), storeIdentity: data.storeIdentity }
3756
4255
  if (!stillCurrent()) return
3757
4256
  changeSnapshot(key, { handle, result: null })
3758
4257
  rememberSnapshot(key, handle)
@@ -3788,7 +4287,16 @@ window.__ModuleLoader__.load({
3788
4287
  if (!entry || entry.result?.state === 'preparing' || Object.values(entry.busy || {}).some(Boolean)) return
3789
4288
  if (field === 'revision' && !(data.selected?.revisions || []).some(item => item.revision === value)) return
3790
4289
  if (field === 'videoJobId' && value && !snapshotVideos(data, entry.revision).some(job => job.jobId === value)) return
3791
- changeSnapshot(key, { [field]: value || null, ...(field === 'revision' ? { videoJobId: null } : {}) })
4290
+ changeSnapshot(key, { [field]: value || null, ...(field === 'revision' ? { videoJobId: null, imageJobIds: [] } : {}) })
4291
+ }
4292
+ function setSnapshotImage(id, selected) {
4293
+ const key = snapshotContextKey(data), entry = data.editableSnapshots[key]
4294
+ if (!entry || !data.snapshotImagesSupported || entry.result?.state === 'preparing' || Object.values(entry.busy || {}).some(Boolean)) return
4295
+ const ids = new Set(entry.imageJobIds || [])
4296
+ if (selected && !snapshotImages(data, entry.revision).some(job => job.jobId === id) || !selected && !ids.has(id)) return
4297
+ if (selected && ids.size >= 16 && !ids.has(id)) return
4298
+ if (selected) ids.add(id); else ids.delete(id)
4299
+ changeSnapshot(key, { imageJobIds: [...ids].sort() })
3792
4300
  }
3793
4301
 
3794
4302
  const creationBody = () => creationRequestBody(data.forms)
@@ -3884,10 +4392,11 @@ window.__ModuleLoader__.load({
3884
4392
  photographySourceControllers.get(projectId)?.abort()
3885
4393
  const controller = new AbortController(), sequence = ++photographySourceSequence
3886
4394
  photographySourceControllers.set(projectId, controller)
3887
- const root = data.projectsRoot, baseRevision = draft.baseRevision, sourceProjectId = selection.sourceProjectId
4395
+ const root = data.projectsRoot, baseRevision = draft.baseRevision, sourceProjectId = selection.sourceProjectId, storeIdentity = data.storeIdentity
4396
+ const destinationEntityIds = photographyProductDefaults(data.selected?.scene, data.selected?.recipeParameters?.placement?.available ? data.selected.recipeParameters.placement.memberEntityIds : null)
3888
4397
  const alive = () => running && !controller.signal.aborted && photographySourceControllers.get(projectId) === controller && data.projectsRoot === root
3889
4398
  const update = changes => set({ photographyReuse: { ...data.photographyReuse, [projectId]: { ...data.photographyReuse[projectId], ...changes } } })
3890
- update({ source: null, loading: true, error: null, applied: false, unchanged: false, replaceDraft: false, projectsRoot: root, baseRevision, sequence })
4399
+ update({ source: null, loading: true, error: null, applied: false, unchanged: false, replaceDraft: false, projectsRoot: root, storeIdentity, baseRevision, sequence })
3891
4400
  const deadline = setTimeout(() => controller.abort(), 30000)
3892
4401
  const read = (path, route) => readRoute((url, options) => fetchImpl(url, { ...options, signal: controller.signal }), path, route)
3893
4402
  try {
@@ -3906,7 +4415,7 @@ window.__ModuleLoader__.load({
3906
4415
  || scene?.revision !== revision || scene?.project?.id !== sourceProjectId || scene.digest !== payload.digest
3907
4416
  || !/^[a-f0-9]{64}$/.test(payload.digest || '') || (saved.digest && saved.digest !== payload.digest)
3908
4417
  || !Array.isArray(scene.nodes?.cameras) || !Array.isArray(scene.nodes?.lights)) throw new Error(result.error?.message || t('photo.reuseUnavailable'))
3909
- update({ source: editorClone(scene), cameraId: scene.nodes.cameras.find(item => item.id === scene.project.activeCamera)?.id || scene.nodes.cameras[0]?.id || '', targetEntityId: '', error: null })
4418
+ update({ source: editorClone(scene), cameraId: scene.nodes.cameras.find(item => item.id === scene.project.activeCamera)?.id || scene.nodes.cameras[0]?.id || '', targetEntityId: '', error: null, sourceFrame: scene.project.frameStart, sourceEntityIds: photographyProductDefaults(scene, payload.assemblyPlacement?.available ? payload.assemblyPlacement.memberEntityIds : null), destinationEntityIds })
3910
4419
  } catch (error) {
3911
4420
  if (alive()) update({ source: null, error: error.message || String(error) })
3912
4421
  } finally {
@@ -3918,6 +4427,114 @@ window.__ModuleLoader__.load({
3918
4427
  }
3919
4428
  }
3920
4429
  const actions = {
4430
+ saveWideFrame: async () => {
4431
+ const projectId = data.activeProjectId, scene = data.selected?.scene, plan = wideFramePlan(scene)
4432
+ const key = motionKey(data), motion = motionDraftFor(data), motionBusy = data.motionWork[key]?.busy
4433
+ if (!projectId || !scene || scene.project?.id !== projectId || scene.revision !== data.currentRevision
4434
+ || !data.deliveryAspectPresetSupported || !/^[a-f0-9]{64}$/.test(data.storeIdentity || '')
4435
+ || !plan?.changed || projectHasUnsavedDrafts(data) || motion?.result || motion?.touched || motionBusy || Object.values(data.busy).some(Boolean)) return
4436
+ const root = data.projectsRoot, identity = data.storeIdentity, revision = scene.revision
4437
+ const operations = plan.profiles.filter(item => !editorEqual(item.before, item.after)).map(item => ({ op: 'render.profile.set', profileName: item.name, profile: { resolution: item.after } }))
4438
+ if (scene.project.aspectRatio !== '16:9') operations.push({ op: 'project.aspectRatio.set', aspectRatio: '16:9' })
4439
+ const patch = { projectId, baseRevision: revision, actor: 'ui', saveCheckpoint: true, renderPreview: true, operations }
4440
+ setIn('busy', 'patch', true)
4441
+ const outcome = await postJson(fetchImpl, projectRoute(projectId, '/patch'), { patch, expectedStoreIdentity: identity })
4442
+ setIn('busy', 'patch', false)
4443
+ if (outcome.ok && motion && data.motionDrafts[key] === motion) {
4444
+ const drafts = { ...data.motionDrafts }; delete drafts[key]; set({ motionDrafts: drafts })
4445
+ }
4446
+ if (data.activeProjectId === projectId && data.projectsRoot === root && data.storeIdentity === identity)
4447
+ setIn('notices', 'jobs', outcome.ok ? { ok: true, message: t('aspect.saved') } : { ok: false, message: `${outcome.error.code}: ${outcome.error.message}` })
4448
+ reload()
4449
+ },
4450
+ probeImageInput: async () => {
4451
+ if (imageProbeController || !data.imageInputProbeSupported || data.editableSnapshotAvailability?.available !== true) return
4452
+ const controller = new AbortController(); imageProbeController = controller
4453
+ const deadline = setTimeout(() => controller.abort(), 50000)
4454
+ set({ imageInputProbe: { busy: true, result: null } })
4455
+ try {
4456
+ const outcome = await postJson(fetchImpl, ROUTES.imageInputProbe, {}, controller.signal)
4457
+ const result = outcome.payload?.imageInput
4458
+ const statuses = ['pass', 'unavailable', 'unverified']
4459
+ const reasons = [null, 'authentication', 'credentials_missing', 'image_unsupported', 'provider_unavailable', 'model_unavailable', 'services_missing', 'route_missing', 'rate_limit', 'timeout', 'cancelled', 'busy', 'incorrect_response', 'incomplete_response', 'unreadable_response', 'response_limit', 'provider_error']
4460
+ if (!outcome.ok || !result || !statuses.includes(result.status) || !reasons.includes(result.reason)
4461
+ || result.status === 'pass' && result.reason !== null || result.status !== 'pass' && result.reason === null) throw Error('Invalid readiness result')
4462
+ if (running && imageProbeController === controller) set({ imageInputProbe: { busy: false, result: { status: result.status, reason: result.reason } } })
4463
+ } catch {
4464
+ if (running && imageProbeController === controller) set({ imageInputProbe: { busy: false, result: { status: 'unverified', reason: controller.signal.aborted ? 'timeout' : 'provider_error' } } })
4465
+ } finally { clearTimeout(deadline); if (imageProbeController === controller) imageProbeController = null }
4466
+ },
4467
+ setMotionValue: (field, value) => {
4468
+ const key = motionKey(data), draft = motionDraftFor(data), work = data.motionWork[key]
4469
+ if (!draft || draft.result || work?.busy || data.busy.patch || !['cameraId', 'entityIds', 'seconds', 'amount', 'direction', 'allowRangeExtension'].includes(field)) return
4470
+ if (field === 'cameraId' && (!draft.cameras.includes(value) || draft.cameraRestrictions?.[value])) return
4471
+ if (field === 'entityIds' && (!Array.isArray(value) || value.length > 128 || new Set(value).size !== value.length || value.some(id => !draft.entities.some(entity => entity.id === id && entity.visible !== false)))) return
4472
+ set({ motionDrafts: { ...data.motionDrafts, [key]: { ...draft, touched: true, [field]: field === 'entityIds' ? [...value].sort() : value } } })
4473
+ },
4474
+ cancelMotion: () => motionControllers.get(motionKey(data))?.abort(),
4475
+ previewMotion: async () => {
4476
+ const key = motionKey(data), draft = motionDraftFor(data), scene = data.selected?.scene
4477
+ if (!draft || draft.result || motionControllers.has(key) || !data.motionPreviewSupported || !data.editableSnapshotAvailability?.available
4478
+ || !validMotionDraft(draft) || draft.baseRevision !== data.currentRevision || draft.baseRevision !== scene?.revision || Object.values(data.busy).some(Boolean)) return
4479
+ const controller = new AbortController(); motionControllers.set(key, controller); motionWork(key, { busy: 'preview', error: null, message: null })
4480
+ const body = { baseRevision: draft.baseRevision, projectsRoot: draft.projectsRoot, sourceCameraId: draft.cameraId,
4481
+ seconds: Number(draft.seconds), fraction: Number(draft.amount) / 100, direction: draft.direction,
4482
+ entityIds: [...draft.entityIds].sort(), allowRangeExtension: draft.allowRangeExtension === true }
4483
+ try {
4484
+ const response = await fetchImpl(projectRoute(draft.projectId, '/motion-previews'), { method: 'POST', headers: { 'content-type': 'application/json', accept: 'application/json' }, body: JSON.stringify(body), signal: controller.signal })
4485
+ const payload = await response.json()
4486
+ if (!response.ok || !payload.ok) {
4487
+ if (payload.error?.code === 'MOTION_OUT_OF_FRAME') throw Object.assign(Error('MOTION_OUT_OF_FRAME'), { userMessage: t('motion.outOfFrame') })
4488
+ if (payload.error?.code === 'MOTION_FRAME_UNVERIFIABLE') throw Object.assign(Error('MOTION_FRAME_UNVERIFIABLE'), { userMessage: t('motion.unverifiable') })
4489
+ throw Error(`${payload.error?.code || 'MOTION_FAILED'}: ${payload.error?.message || response.status}`)
4490
+ }
4491
+ if (controller.signal.aborted || !validMotionReceipt(payload.preview, draft)) throw Error('MOTION_RECEIPT_MISMATCH')
4492
+ const receipt = { ...editorClone(payload.preview), saveAttempted: false }
4493
+ let storageError = false
4494
+ try { motionStorage.setItem(motionStorageKey(draft.projectsRoot, draft.storeIdentity, draft.projectId), JSON.stringify(receipt))
4495
+ if (motionStorage.getItem(motionStorageKey(draft.projectsRoot, draft.storeIdentity, draft.projectId)) !== JSON.stringify(receipt)) throw Error('storage mismatch')
4496
+ } catch { storageError = true }
4497
+ set({ motionDrafts: { ...data.motionDrafts, [key]: { ...draft, result: receipt, storageError } } })
4498
+ motionWork(key, { busy: null, error: storageError ? t('motion.storage') : null })
4499
+ } catch (error) { motionWork(key, { busy: null, error: controller.signal.aborted ? t('inspection.cancelled') : error.userMessage || t('motion.failed', { message: error.message || String(error) }) }) }
4500
+ finally { motionControllers.delete(key) }
4501
+ },
4502
+ discardMotion: async () => {
4503
+ const key = motionKey(data), draft = motionDraftFor(data), work = data.motionWork[key]
4504
+ if (!draft || work?.busy) return
4505
+ // An uncertain save may still be running; forget only the local handle.
4506
+ // Never ask the Host to remove a candidate while its commit is uncertain.
4507
+ if (draft.result && !draft.result.saveAttempted) {
4508
+ const outcome = await postJson(fetchImpl, projectRoute(draft.projectId, `/motion-previews/${draft.result.id}/discard`), {})
4509
+ if (!outcome.ok) { motionWork(key, { error: t('motion.failed', { message: outcome.error.message }) }); return }
4510
+ }
4511
+ try { motionStorage?.removeItem(motionStorageKey(draft.projectsRoot, draft.storeIdentity, draft.projectId)) } catch { motionWork(key, { error: t('motion.storage') }); return }
4512
+ const drafts = { ...data.motionDrafts }; delete drafts[key]; set({ motionDrafts: drafts, motionWork: { ...data.motionWork, [key]: {} } }); reload()
4513
+ },
4514
+ saveMotion: async () => {
4515
+ const key = motionKey(data), draft = motionDraftFor(data), result = draft?.result, work = data.motionWork[key]
4516
+ if (!draft || !result || work?.busy || draft.storageError || !validMotionReceipt(result, draft)
4517
+ || !result.saveAttempted && (draft.baseRevision !== data.currentRevision || result.expiresAt <= Date.now())) return
4518
+ const attempted = { ...result, saveAttempted: true }, storageKey = motionStorageKey(draft.projectsRoot, draft.storeIdentity, draft.projectId)
4519
+ try { motionStorage.setItem(storageKey, JSON.stringify(attempted)); if (motionStorage.getItem(storageKey) !== JSON.stringify(attempted)) throw Error('storage mismatch') }
4520
+ catch { motionWork(key, { error: t('motion.storage') }); return }
4521
+ set({ motionDrafts: { ...data.motionDrafts, [key]: { ...draft, result: attempted } } }); motionWork(key, { busy: 'save', error: null })
4522
+ const controller = new AbortController()
4523
+ const deadline = setTimeout(() => controller.abort(), 120000)
4524
+ let outcome
4525
+ try {
4526
+ outcome = await postJson(fetchImpl, projectRoute(draft.projectId, `/motion-previews/${result.id}/save`), { projectsRoot: draft.projectsRoot, intentSha256: result.intentSha256 }, controller.signal)
4527
+ } finally { clearTimeout(deadline) }
4528
+ const saved = outcome.payload?.saved
4529
+ if (outcome.ok && saved?.projectId === draft.projectId && saved?.sourceRevision === draft.baseRevision
4530
+ && saved?.cameraId === result.cameraId && /^r[0-9]{4,}$/.test(saved?.revision || '')) {
4531
+ try { motionStorage.removeItem(storageKey) } catch {}
4532
+ const drafts = { ...data.motionDrafts }; delete drafts[key]
4533
+ set({ motionDrafts: drafts, motionWork: { ...data.motionWork, [key]: { busy: null, message: t('motion.saved', { revision: saved.revision, camera: saved.cameraId }) } },
4534
+ ...(motionKey(data) === key ? { forms: { ...data.forms, renderCamera: saved.cameraId } } : {}) }); reload()
4535
+ } else motionWork(key, { busy: null, error: outcome.error?.code === 'MOTION_OUT_OF_FRAME' ? t('motion.savedOutOfFrame')
4536
+ : outcome.error?.code === 'MOTION_FRAME_UNVERIFIABLE' ? t('motion.savedUnverifiable') : t('motion.uncertain') })
4537
+ },
3921
4538
  setCameraFitValue: (field, value) => {
3922
4539
  const draft = cameraFitDraftFor(data), key = assemblyKey(data)
3923
4540
  if (!draft || draft.attempt || cameraFitControllers.has(key) || !['cameraId', 'frame', 'marginPercent', 'entityIds'].includes(field)) return
@@ -3934,7 +4551,7 @@ window.__ModuleLoader__.load({
3934
4551
  },
3935
4552
  cancelCameraFit: () => cameraFitControllers.get(assemblyKey(data))?.abort(),
3936
4553
  saveCameraFit: async () => {
3937
- const draft = cameraFitDraftFor(data), key = assemblyKey(data)
4554
+ const draft = cameraFitDraftFor(data), key = assemblyKey(data), identity = data.storeIdentity, sourceMotionKey = motionKey(data), sourceMotion = motionDraftFor(data)
3938
4555
  if (!draft || !data.cameraFitSupported || cameraFitControllers.has(key) || draft.storageError || Object.values(data.busy).some(Boolean)) return
3939
4556
  if (!draft.attempt && (cameraFitInvalid(draft) || draft.baseRevision !== data.currentRevision || draft.baseRevision !== data.selected?.scene?.revision
3940
4557
  || projectHasUnsavedDrafts({ ...data, cameraFitDrafts: {} }))) return
@@ -3972,10 +4589,20 @@ window.__ModuleLoader__.load({
3972
4589
  const drafts = { ...data.cameraFitDrafts }; delete drafts[key]
3973
4590
  set({ cameraFitDrafts: drafts, cameraFitWork: { ...data.cameraFitWork, [key]: { result } } })
3974
4591
  if (sameProject) {
4592
+ // Preserve a creator's edited motion intent. Only an untouched draft
4593
+ // bound to this exact source may follow the newly fitted camera.
4594
+ if (identity && data.storeIdentity === identity && data.motionDrafts[sourceMotionKey] === sourceMotion
4595
+ && sourceMotion && sourceMotion.baseRevision === body.baseRevision && !sourceMotion.touched && !sourceMotion.result
4596
+ && !data.motionWork[sourceMotionKey]?.busy && !motionControllers.has(sourceMotionKey)) {
4597
+ const entityIds = body.entityIds.every(id => sourceMotion.entities.some(entity => entity.id === id && entity.visible !== false))
4598
+ ? [...body.entityIds] : sourceMotion.entityIds
4599
+ set({ motionDrafts: { ...data.motionDrafts, [sourceMotionKey]: { ...sourceMotion, baseRevision: result.revision,
4600
+ cameras: [...new Set([...sourceMotion.cameras, body.fittedCameraId])], cameraId: body.fittedCameraId, entityIds } } })
4601
+ }
3975
4602
  const photography = data.photographyDrafts[draft.projectId]
3976
4603
  if (photography && photography.projectsRoot === draft.projectsRoot && !photographyDirty(photography)) set({ photographyDrafts: {
3977
4604
  ...data.photographyDrafts, [draft.projectId]: { ...photography, cameraId: body.fittedCameraId, frame: body.frame } } })
3978
- const notice = { ok: true, kind: 'camera-fit', projectId: draft.projectId, projectsRoot: draft.projectsRoot,
4605
+ const notice = { ok: true, kind: 'camera-fit', projectId: draft.projectId, projectsRoot: draft.projectsRoot, revision: result.revision,
3979
4606
  message: t('fit.saved', { count: body.entityIds.length, revision: result.revision, frame: body.frame }) }
3980
4607
  set({ view: 'preview', compareMode: 'result', notices: { ...data.notices, scene: notice, preview: notice } })
3981
4608
  }
@@ -4046,6 +4673,7 @@ window.__ModuleLoader__.load({
4046
4673
  },
4047
4674
  setSnapshotRevision: value => setSnapshotSelection('revision', value),
4048
4675
  setSnapshotVideo: value => setSnapshotSelection('videoJobId', value),
4676
+ setSnapshotImage,
4049
4677
  prepareEditableSnapshot: () => snapshotRequest('prepare'),
4050
4678
  checkEditableSnapshot: () => snapshotRequest('check'),
4051
4679
  cancelEditableSnapshot: () => snapshotRequest('cancel'),
@@ -4114,9 +4742,11 @@ window.__ModuleLoader__.load({
4114
4742
  beginNewWork: () => set({ view: 'projects', projectTask: 'new' }),
4115
4743
  selectProject: (projectId) => {
4116
4744
  if (projectId === data.activeProjectId) { reload(); return }
4745
+ motionControllers.get(motionKey(data))?.abort()
4117
4746
  const operation = bundleOperations.get(data.activeProjectId)
4118
4747
  if (operation && projectId !== data.activeProjectId) void cancelBundle(operation).catch(() => {})
4119
- set({ projectId, selected: null, activeProjectId: null, editorEntityId: null, editorComparison: null, diff: null, diffError: null, compareLeft: null, compareRight: null })
4748
+ set({ projectId, selected: null, activeProjectId: null, editorEntityId: null, editorComparison: null, diff: null, diffError: null, compareLeft: null, compareRight: null,
4749
+ forms: { ...data.forms, renderCamera: '' } })
4120
4750
  reload()
4121
4751
  },
4122
4752
  reload,
@@ -4326,7 +4956,7 @@ window.__ModuleLoader__.load({
4326
4956
  updateAsset: (field, value) => {
4327
4957
  const projectId = data.activeProjectId, current = data.assetDrafts[projectId]
4328
4958
  if (!current || data.assetWork[projectId]?.busy) return
4329
- const allowed = ['newEntityId', 'location', 'rotationEuler', 'scale', 'entityId', 'target', 'partId', 'slotIndex', 'scope', 'newMaterial', 'channel', 'binding', 'replaceTexture', 'strength', 'rotation']
4959
+ const allowed = ['newEntityId', 'location', 'rotationEuler', 'scale', 'hideEntityId', 'makeSubject', 'entityId', 'target', 'partId', 'slotIndex', 'scope', 'newMaterial', 'channel', 'binding', 'replaceTexture', 'strength', 'rotation']
4330
4960
  if (!allowed.includes(field)) return
4331
4961
  const draft = editorClone(current); draft[field] = editorClone(value)
4332
4962
  if (['entityId', 'target'].includes(field)) { draft.partId = ''; draft.slotIndex = '' }
@@ -4480,15 +5110,58 @@ window.__ModuleLoader__.load({
4480
5110
  setVisualIterations: value => {
4481
5111
  if (Number.isInteger(value) && value >= 1 && value <= 3) set({ visualIterations: { ...data.visualIterations, [data.activeProjectId]: value } })
4482
5112
  },
5113
+ setReviewMode: mode => {
5114
+ const choice = reviewSelectionFor(data)
5115
+ if (!choice || data.visualRuns[data.activeProjectId]?.busy || !['selected', 'standard'].includes(mode)
5116
+ || mode === 'selected' && !data.selectedReviewViewsSupported) return
5117
+ set({ reviewSelections: { ...data.reviewSelections, [reviewSelectionKey(data)]: { ...editorClone(choice), mode } } })
5118
+ },
5119
+ resetReviewSelection: () => {
5120
+ if (data.visualRuns[data.activeProjectId]?.busy) return
5121
+ const choices = { ...data.reviewSelections }; delete choices[reviewSelectionKey(data)]; set({ reviewSelections: choices })
5122
+ },
5123
+ updateReviewView: (index, field, value) => {
5124
+ const choice = reviewSelectionFor(data)
5125
+ if (!choice || choice.baseRevision !== data.selected?.scene?.revision || data.visualRuns[data.activeProjectId]?.busy
5126
+ || !['cameraId', 'frame'].includes(field) || !choice.views[index]) return
5127
+ const next = editorClone(choice); next.views[index][field] = value
5128
+ set({ reviewSelections: { ...data.reviewSelections, [reviewSelectionKey(data)]: next } })
5129
+ },
5130
+ addReviewView: () => {
5131
+ const choice = reviewSelectionFor(data), scene = data.selected?.scene
5132
+ if (!choice || choice.baseRevision !== scene?.revision || choice.views.length >= 4 || data.visualRuns[data.activeProjectId]?.busy) return
5133
+ const next = editorClone(choice), camera = scene.nodes.cameras.find(camera => !choice.views.some(view => view.cameraId === camera.id)) || scene.nodes.cameras[0]
5134
+ next.views.push({ id: `review-${next.views.length + 1}`, cameraId: camera?.id || '', frame: scene.project.frameStart })
5135
+ next.views = next.views.map((view, i) => ({ ...view, id: `review-${i + 1}` }))
5136
+ set({ reviewSelections: { ...data.reviewSelections, [reviewSelectionKey(data)]: next } })
5137
+ },
5138
+ removeReviewView: index => {
5139
+ const choice = reviewSelectionFor(data)
5140
+ if (!choice || choice.views.length <= 1 || !choice.views[index] || data.visualRuns[data.activeProjectId]?.busy) return
5141
+ const next = editorClone(choice); next.views.splice(index, 1); next.views = next.views.map((view, i) => ({ ...view, id: `review-${i + 1}` }))
5142
+ set({ reviewSelections: { ...data.reviewSelections, [reviewSelectionKey(data)]: next } })
5143
+ },
5144
+ useCompletedReviewViews: () => {
5145
+ const scene = data.selected?.scene, views = completedReviewViews(data)
5146
+ if (!scene || !views.length || !data.selectedReviewViewsSupported || data.visualRuns[data.activeProjectId]?.busy) return
5147
+ set({ reviewSelections: { ...data.reviewSelections, [reviewSelectionKey(data)]: { mode: 'selected', baseRevision: scene.revision, views } } })
5148
+ },
4483
5149
  runVisual: async mode => {
4484
5150
  const projectId = data.activeProjectId, revision = data.selected?.scene?.revision
4485
5151
  if (!projectId || !revision || !data.briefDrafts[projectId] || !['review', 'autofix'].includes(mode) || data.visualRuns[projectId]?.busy
4486
5152
  || data.briefWork[projectId]?.saving || data.briefWork[projectId]?.uploading || projectHasUnsavedDrafts(data)
4487
5153
  || data.busy.editor || data.busy.patch || data.busy.restore) return
5154
+ const choice = reviewSelectionFor(data), selected = choice?.mode === 'selected'
5155
+ if (selected && (mode !== 'review' || !reviewSelectionValid(data, choice))) return
5156
+ const views = selected ? editorClone(choice.views) : null, expectedDigest = data.selected.scene.digest
4488
5157
  set({ visualRuns: { ...data.visualRuns, [projectId]: { busy: true, mode, revision } } })
4489
5158
  const outcome = await postJson(fetchImpl, projectRoute(projectId, `/${mode}`), { revision,
5159
+ ...(selected ? { views, expectedStoreIdentity: data.storeIdentity, expectedDigest } : {}),
4490
5160
  ...(mode === 'autofix' ? { maxIterations: data.visualIterations[projectId] || 1 } : {}) })
4491
- const reviewerError = outcome.payload?.review?.reviewerError || outcome.payload?.review?.referenceInputError?.message
5161
+ const scope = outcome.payload?.review?.inputScope
5162
+ const sourceMismatch = selected && outcome.ok && (scope?.mode !== 'selected-views' || scope.sourceRevision !== revision || scope.sourceDigest !== expectedDigest
5163
+ || JSON.stringify(scope.views?.map(({ id, cameraId, frame }) => ({ id, cameraId, frame }))) !== JSON.stringify(views))
5164
+ const reviewerError = sourceMismatch ? t('reviewView.mismatch') : outcome.payload?.review?.reviewerError || outcome.payload?.review?.referenceInputError?.message
4492
5165
  const result = outcome.ok ? outcome.payload : null
4493
5166
  set({ visualRuns: { ...data.visualRuns, [projectId]: { busy: false, mode, revision, result,
4494
5167
  error: !outcome.ok ? `${outcome.error.code}: ${outcome.error.message}` : reviewerError || null } } })
@@ -4511,36 +5184,69 @@ window.__ModuleLoader__.load({
4511
5184
  setPhotographySource: (field, value) => {
4512
5185
  const projectId = data.activeProjectId, selection = data.photographyReuse[projectId] || {}
4513
5186
  if (!data.cameraTargetResetSupported || !photographyDraftFor(data) || photographyBusy(data.photographyWork[projectId])) return
5187
+ let changes, load = false, revision
4514
5188
  if (field === 'project') {
4515
5189
  if (value && !data.projects.some(item => item.projectId === value && !item.creationPending)) return
4516
- photographySourceControllers.get(projectId)?.abort(); photographySourceControllers.delete(projectId)
4517
- set({ photographyReuse: { ...data.photographyReuse, [projectId]: { sourceProjectId: value, source: null, revisions: [], revision: '', cameraId: '', targetEntityId: '', replaceDraft: false } } })
4518
- if (value) return loadPhotographySource()
4519
- } else if (field === 'revision') {
4520
- if (!selection.revisions?.some(item => item.revision === value)) return
4521
- return loadPhotographySource(value)
4522
- } else if (field === 'camera' && selection.source?.nodes.cameras.some(item => item.id === value)) {
4523
- set({ photographyReuse: { ...data.photographyReuse, [projectId]: { ...selection, cameraId: value, targetEntityId: '', applied: false, unchanged: false } } })
4524
- } else if (field === 'target' && (!value || photographyDraftFor(data).entities.some(item => item.id === value))) {
4525
- set({ photographyReuse: { ...data.photographyReuse, [projectId]: { ...selection, targetEntityId: value, applied: false, unchanged: false } } })
4526
- } else if (field === 'replace' && typeof value === 'boolean') {
4527
- set({ photographyReuse: { ...data.photographyReuse, [projectId]: { ...selection, replaceDraft: value } } })
5190
+ changes = { sourceProjectId: value, source: null, revisions: [], revision: '', cameraId: '', targetEntityId: '', replaceDraft: false }; load = Boolean(value)
5191
+ } else if (field === 'revision' && selection.revisions?.some(item => item.revision === value)) {
5192
+ changes = {}; load = true; revision = value
5193
+ } else if (field === 'camera' && selection.source?.nodes.cameras.some(item => item.id === value)) changes = { cameraId: value, targetEntityId: '', applied: false, unchanged: false }
5194
+ else if (field === 'target' && (!value || photographyDraftFor(data).entities.some(item => item.id === value))) changes = { targetEntityId: value, applied: false, unchanged: false }
5195
+ else if (field === 'replace' && typeof value === 'boolean') changes = { replaceDraft: value }
5196
+ else if (field === 'mode' && ['absolute', 'bounds'].includes(value) && (value !== 'bounds' || data.photographyBoundaryReuseSupported)) changes = { mode: value, applied: false, unchanged: false }
5197
+ else if (field === 'sourceFrame') changes = { sourceFrame: value, applied: false, unchanged: false }
5198
+ else if (['sourceEntityIds', 'destinationEntityIds'].includes(field) && Array.isArray(value) && value.length <= 128 && new Set(value).size === value.length) {
5199
+ const scene = field === 'sourceEntityIds' ? selection.source : data.selected?.scene
5200
+ if (value.every(id => photographyProductEntities(scene).some(e => e.id === id))) changes = { [field]: [...value].sort(), applied: false, unchanged: false }
4528
5201
  }
5202
+ if (!changes) return
5203
+ photographySourceControllers.get(projectId)?.abort(); photographySourceControllers.delete(projectId)
5204
+ set({ photographyReuse: { ...data.photographyReuse, [projectId]: { ...selection, planning: false, loading: false, error: null, ...changes } } })
5205
+ if (load) return loadPhotographySource(revision)
4529
5206
  },
4530
5207
  reloadPhotographySource: () => loadPhotographySource(data.photographyReuse[data.activeProjectId]?.revision),
4531
- reusePhotography: () => {
5208
+ cancelPhotographyReuse: () => {
5209
+ const projectId = data.activeProjectId
5210
+ photographySourceControllers.get(projectId)?.abort(); photographySourceControllers.delete(projectId)
5211
+ set({ photographyReuse: { ...data.photographyReuse, [projectId]: { ...data.photographyReuse[projectId], planning: false } } })
5212
+ },
5213
+ reusePhotography: async () => {
4532
5214
  const projectId = data.activeProjectId, selection = data.photographyReuse[projectId], draft = photographyDraftFor(data)
4533
- if (!data.cameraTargetResetSupported || !draft || !selection?.source || selection.loading || photographyBusy(data.photographyWork[projectId])
5215
+ if (!data.cameraTargetResetSupported || !draft || !selection?.source || selection.loading || selection.planning || photographyBusy(data.photographyWork[projectId])
4534
5216
  || selection.projectsRoot !== data.projectsRoot || draft.projectsRoot !== data.projectsRoot
4535
5217
  || selection.baseRevision !== draft.baseRevision || draft.baseRevision !== data.selected?.scene?.revision
4536
5218
  || (photographyDirty(draft) && !selection.replaceDraft)) return
5219
+ let controller
4537
5220
  try {
4538
- const next = reusePhotography(draft, selection.source, selection.cameraId, selection.targetEntityId)
5221
+ let next
5222
+ if (selection.mode === 'bounds') {
5223
+ const request = photographyBoundaryRequest(data, selection, draft)
5224
+ if (!request) throw new Error(t('photo.boundsInvalid'))
5225
+ const signature = creationSignature(draft), root = data.projectsRoot
5226
+ controller = new AbortController(); photographySourceControllers.set(projectId, controller)
5227
+ set({ photographyReuse: { ...data.photographyReuse, [projectId]: { ...selection, planning: true, error: null } } })
5228
+ const outcome = await postJson(fetchImpl, projectRoute(projectId, '/photography-reuse'), request, controller.signal)
5229
+ if (!running || controller.signal.aborted || photographySourceControllers.get(projectId) !== controller) return
5230
+ const current = data.photographyReuse[projectId], currentDraft = photographyDraftFor(data)
5231
+ if (data.activeProjectId !== projectId || data.projectsRoot !== root
5232
+ || creationSignature(currentDraft) !== signature
5233
+ || creationSignature(photographyBoundaryRequest(data, current, currentDraft)) !== creationSignature(request)) {
5234
+ if (data.activeProjectId === projectId && data.projectsRoot === root) throw new Error(t('photo.boundsChanged'))
5235
+ return
5236
+ }
5237
+ if (!outcome.ok) throw new Error(`${outcome.error.code}: ${outcome.error.message}`)
5238
+ next = applyBoundaryPhotography(draft, selection.source, outcome.payload.plan, request)
5239
+ } else next = reusePhotography(draft, selection.source, selection.cameraId, selection.targetEntityId)
4539
5240
  set({ photographyDrafts: { ...data.photographyDrafts, [projectId]: next }, photographyReuse: {
4540
- ...data.photographyReuse, [projectId]: { ...selection, replaceDraft: false, error: null, applied: photographyDirty(next), unchanged: !photographyDirty(next) },
5241
+ ...data.photographyReuse, [projectId]: { ...data.photographyReuse[projectId], replaceDraft: false, error: null, planning: false, applied: photographyDirty(next), unchanged: !photographyDirty(next) },
4541
5242
  } })
4542
5243
  } catch (error) {
4543
- set({ photographyReuse: { ...data.photographyReuse, [projectId]: { ...selection, applied: false, error: error.message || String(error) } } })
5244
+ if (!controller || !controller.signal.aborted) set({ photographyReuse: { ...data.photographyReuse, [projectId]: { ...data.photographyReuse[projectId], applied: false, planning: false, error: error.message || String(error) } } })
5245
+ } finally {
5246
+ if (controller && photographySourceControllers.get(projectId) === controller) {
5247
+ photographySourceControllers.delete(projectId)
5248
+ if (running) set({ photographyReuse: { ...data.photographyReuse, [projectId]: { ...data.photographyReuse[projectId], planning: false } } })
5249
+ }
4544
5250
  }
4545
5251
  },
4546
5252
  updatePhotography: (kind, path, value) => {
@@ -4683,7 +5389,8 @@ window.__ModuleLoader__.load({
4683
5389
  },
4684
5390
  updateEditor: (section, path, value) => {
4685
5391
  const current = editorDraftFor(data)
4686
- if (!current || data.busy.editor || !['transform', 'generator', 'modifiers', 'material'].includes(section)) return
5392
+ if (!current || data.busy.editor || !['transform', 'generator', 'modifiers', 'material', 'uvProjection'].includes(section)) return
5393
+ if (section === 'uvProjection' && (current.entity.kind !== 'generator' || current.entity.generator?.shape !== 'mesh')) return
4687
5394
  if (!Array.isArray(path) || path.some(key => ['__proto__', 'constructor', 'prototype'].includes(String(key)))) return
4688
5395
  if (section === 'generator' && path[0] === 'bevel' && path.length === 1 && value === undefined && current.entity.generator?.shape === 'rounded_box') return
4689
5396
  if (section === 'transform' && editorTrackLocked(current, 'entity', current.entityId, `${path[0]}.${EDITOR_AXES[path[1]]}`)) return
@@ -4692,7 +5399,7 @@ window.__ModuleLoader__.load({
4692
5399
  const draft = editorClone(current)
4693
5400
  if (section === 'material' && path.length === 1 && path[0] === 'id') editorSelectMaterial(draft, value)
4694
5401
  else {
4695
- const parent = section === 'material' ? draft : draft.entity
5402
+ const parent = ['material', 'uvProjection'].includes(section) ? draft : draft.entity
4696
5403
  if (path.length === 0) parent[section] = editorClone(value)
4697
5404
  else {
4698
5405
  let object = parent[section]
@@ -4992,6 +5699,31 @@ window.__ModuleLoader__.load({
4992
5699
  startRender: async (resumeJobId) => {
4993
5700
  const projectId = data.activeProjectId, scene = data.selected?.scene
4994
5701
  if (!projectId || !scene?.revision || data.busy.render) return
5702
+ const cameraId = data.forms.renderCamera || ''
5703
+ if (resumeJobId === undefined && cameraId && !scene.nodes?.cameras?.some(camera => camera.id === cameraId)) {
5704
+ setIn('notices', 'jobs', { ok: false, message: t('jobs.cameraMissing') }); return
5705
+ }
5706
+ const selectedSize = data.forms.stillPreset || ''
5707
+ const videoPreset = selectedSize === 'video-1920x1080' ? selectedSize : ''
5708
+ const stillPreset = videoPreset ? '' : selectedSize
5709
+ if (resumeJobId === undefined && stillPreset && !data.stillDeliveryPresetSupported) {
5710
+ setIn('notices', 'jobs', { ok: false, message: t('jobs.stillUnsupported') }); return
5711
+ }
5712
+ const deliveryKind = data.forms.deliveryKind || ''
5713
+ if (resumeJobId === undefined && deliveryKind && !data.stillImageDeliverySupported) {
5714
+ setIn('notices', 'jobs', { ok: false, message: t('jobs.stillKindUnsupported') }); return
5715
+ }
5716
+ if (resumeJobId === undefined && videoPreset && !data.videoDeliveryPresetSupported) {
5717
+ setIn('notices', 'jobs', { ok: false, message: t('jobs.videoPresetUnsupported') }); return
5718
+ }
5719
+ if (resumeJobId === undefined && videoPreset && deliveryKind) {
5720
+ setIn('notices', 'jobs', { ok: false, message: t('jobs.videoPresetInvalid') }); return
5721
+ }
5722
+ const start = data.forms.frameStart === '' ? scene.project.frameStart : Number(data.forms.frameStart)
5723
+ const end = data.forms.frameEnd === '' ? scene.project.frameEnd : Number(data.forms.frameEnd)
5724
+ if (resumeJobId === undefined && (stillPreset || deliveryKind) && (!Number.isSafeInteger(start) || start !== end)) {
5725
+ setIn('notices', 'jobs', { ok: false, message: t('jobs.stillRange') }); return
5726
+ }
4995
5727
  // Snapshot before notifying subscribers: a project switch or a concurrent
4996
5728
  // save must not change the scene or settings this click asked to render.
4997
5729
  const request = resumeJobId === undefined ? {
@@ -4999,6 +5731,10 @@ window.__ModuleLoader__.load({
4999
5731
  frameStart: data.forms.frameStart === '' ? undefined : Number(data.forms.frameStart),
5000
5732
  frameEnd: data.forms.frameEnd === '' ? undefined : Number(data.forms.frameEnd),
5001
5733
  profile: data.forms.profile,
5734
+ ...(stillPreset ? { stillPreset } : {}),
5735
+ ...(videoPreset ? { videoPreset } : {}),
5736
+ ...(deliveryKind ? { deliveryKind } : {}),
5737
+ ...(cameraId ? { cameraId } : {}),
5002
5738
  } : { resumeJobId }
5003
5739
  setIn('busy', 'render', true)
5004
5740
  const outcome = await postJson(fetchImpl, projectRoute(projectId, '/render'), request)
@@ -5065,8 +5801,15 @@ window.__ModuleLoader__.load({
5065
5801
  fileChoicesStopped = true
5066
5802
  data = { ...data, fileChoiceGeneration: data.fileChoiceGeneration + 1 }
5067
5803
  running = false
5804
+ imageProbeController?.abort(); imageProbeController = null
5805
+ data = { ...data, imageInputProbe: { busy: false, result: null } }
5806
+ snapshot = { ...snapshot, imageInputProbe: data.imageInputProbe }
5068
5807
  if (timer !== null) { clearInterval(timer); timer = null }
5808
+ for (const controller of photographySourceControllers.values()) controller.abort()
5809
+ photographySourceControllers.clear()
5069
5810
  for (const controller of photographyControllers.values()) controller.abort()
5811
+ for (const controller of motionControllers.values()) controller.abort()
5812
+ motionControllers.clear()
5070
5813
  photographyControllers.clear()
5071
5814
  for (const controller of placementControllers.values()) controller.abort()
5072
5815
  placementControllers.clear()
@@ -5161,6 +5904,7 @@ window.__ModuleLoader__.load({
5161
5904
  )
5162
5905
  return el('div', { 'data-view': 'projects' },
5163
5906
  ErrorBox({ error: state.error }),
5907
+ ProjectStorageNotice(state),
5164
5908
  el('section', { className: 'db-card db-project-create', 'aria-label': t('projects.create') },
5165
5909
  el('h2', { className: 'db-start-title' }, t('lighttable.beginTitle')),
5166
5910
  el('p', { className: 'db-start-intro' }, t('lighttable.beginHint')),
@@ -5177,7 +5921,7 @@ window.__ModuleLoader__.load({
5177
5921
  el('div', { className: 'db-inline' },
5178
5922
  Button({ action: 'retry-creation', disabled: state.busy.create, onClick: actions.retryCreation, children: t('projects.retryCreation') }),
5179
5923
  Button({ action: 'refresh-creation-projects', onClick: actions.reload, children: t('projects.refreshList') }),
5180
- ['BLENDER_NOT_FOUND', 'RUNTIME_UNAVAILABLE'].includes(state.creationWork.code)
5924
+ creationEnvironmentError(state.creationWork.code)
5181
5925
  ? el('a', { href: 'https://github.com/pearjelly/deep-blend/blob/main/deepblend/docs/environment-check.md', target: '_blank', rel: 'noreferrer' }, t('projects.environmentGuide')) : null),
5182
5926
  state.notices.projects?.technicalDetails ? el('details', { 'data-creation-diagnostics': true },
5183
5927
  el('summary', null, t('projects.creationDetails')), el('pre', { className: 'db-pre' }, state.notices.projects.technicalDetails)) : null,
@@ -5301,14 +6045,38 @@ window.__ModuleLoader__.load({
5301
6045
  const projectId = state.activeProjectId, run = state.visualRuns[projectId], work = state.briefWork[projectId]
5302
6046
  const dirty = projectHasUnsavedDrafts(state), disabled = !projectId || !state.briefDrafts[projectId] || run?.busy || work?.saving || work?.uploading || dirty
5303
6047
  || state.busy.editor || state.busy.patch || state.busy.restore
6048
+ const choice = reviewSelectionFor(state), scene = state.selected?.scene, selected = choice?.mode === 'selected'
6049
+ const stale = choice && choice.baseRevision !== scene?.revision, invalid = selected && !reviewSelectionValid(state, choice)
5304
6050
  return el('div', { className: 'db-card', 'data-visual-actions': true, 'data-review-busy': String(Boolean(run?.busy)) },
5305
- el('p', { className: 'db-muted' }, t('brief.reviewCost')),
6051
+ choice ? el('label', { className: 'db-row' }, t('reviewView.title'), el('select', { className: 'db-input', 'data-field': 'review-view-mode', value: choice.mode,
6052
+ disabled, onChange: event => actions.setReviewMode(event.target.value) },
6053
+ el('option', { value: 'selected', disabled: !state.selectedReviewViewsSupported }, t('reviewView.selected')),
6054
+ el('option', { value: 'standard' }, t('reviewView.standard')))) : null,
6055
+ selected ? el('div', { 'data-review-selection': choice.baseRevision },
6056
+ el('p', { className: 'db-muted' }, t('reviewView.help')),
6057
+ Button({ action: 'review-use-images', disabled: disabled || !completedReviewViews(state).length, onClick: actions.useCompletedReviewViews, children: t('reviewView.fromImages') }),
6058
+ choice.views.map((view, index) => el('div', { key: view.id, className: 'db-inline', style: { marginTop: '8px', flexWrap: 'wrap' } },
6059
+ el('label', { style: { minWidth: 0, flex: '1 1 220px', maxWidth: '100%' } }, t('inspection.camera'), el('select', { className: 'db-input', style: { width: '100%', maxWidth: '100%' }, 'data-field': `review-camera-${index}`, value: view.cameraId, disabled: disabled || stale,
6060
+ onChange: event => actions.updateReviewView(index, 'cameraId', event.target.value) },
6061
+ !scene.nodes.cameras.some(camera => camera.id === view.cameraId) ? el('option', { value: view.cameraId, disabled: true }, t('inspection.cameraUnavailable', { camera: view.cameraId })) : null,
6062
+ scene.nodes.cameras.map(camera => el('option', { key: camera.id, value: camera.id }, camera.id)))),
6063
+ el('label', null, t('inspection.frame'), el('input', { type: 'number', className: 'db-input', style: { width: '100px' }, 'data-field': `review-frame-${index}`,
6064
+ min: scene.project.frameStart, max: scene.project.frameEnd, step: 1, value: view.frame, disabled: disabled || stale,
6065
+ onChange: event => actions.updateReviewView(index, 'frame', event.target.value === '' ? '' : Number(event.target.value)) })),
6066
+ Button({ action: `review-remove-${index}`, disabled: disabled || choice.views.length <= 1 || stale, onClick: () => actions.removeReviewView(index), children: t('reviewView.remove') }))),
6067
+ el('div', { className: 'db-inline', style: { marginTop: '8px' } },
6068
+ Button({ action: 'review-add-view', disabled: disabled || choice.views.length >= 4 || stale, onClick: actions.addReviewView, children: t('reviewView.add') }),
6069
+ Button({ action: 'review-reset-views', disabled: Boolean(run?.busy), onClick: actions.resetReviewSelection, children: t('reviewView.reset') })),
6070
+ stale ? el('p', { className: 'db-error', role: 'status' }, t('reviewView.stale'))
6071
+ : invalid ? el('p', { className: 'db-error', role: 'status' }, t('reviewView.invalid')) : null,
6072
+ el('p', { className: 'db-muted' }, t('reviewView.noAutofix'))) : el('div', null,
6073
+ el('p', { className: 'db-muted' }, t('brief.reviewCost')), el('p', { className: 'db-muted' }, t('reviewView.standardHelp'))),
5306
6074
  dirty ? el('p', { className: 'db-muted' }, t('brief.pending')) : null,
5307
6075
  el('div', { className: 'db-inline' },
5308
- Button({ action: 'project-review', disabled, onClick: () => actions.runVisual('review'), children: t('brief.review') }),
6076
+ Button({ action: 'project-review', disabled: disabled || invalid, onClick: () => actions.runVisual('review'), children: t('brief.review') }),
5309
6077
  el('label', null, t('brief.iterations'), el('select', { className: 'db-input', 'data-field': 'review-iterations', value: state.visualIterations[projectId] || 1,
5310
- disabled, onChange: event => actions.setVisualIterations(Number(event.target.value)) }, [1, 2, 3].map(value => el('option', { key: value, value }, String(value))))),
5311
- Button({ action: 'project-autofix', disabled, onClick: () => actions.runVisual('autofix'), children: t('brief.autofix') })),
6078
+ disabled: disabled || selected, onChange: event => actions.setVisualIterations(Number(event.target.value)) }, [1, 2, 3].map(value => el('option', { key: value, value }, String(value))))),
6079
+ Button({ action: 'project-autofix', disabled: disabled || selected, onClick: () => actions.runVisual('autofix'), children: t('brief.autofix') })),
5312
6080
  run?.busy ? el('p', { role: 'status' }, run.mode === 'review' ? t('brief.reviewing') : t('brief.fixing')) : null,
5313
6081
  run?.error ? el('p', { className: 'db-error', role: 'alert', 'data-review-error': true }, run.error) : null,
5314
6082
  run?.result && !run.error ? el('p', { 'data-review-result': run.mode, className: 'db-muted' }, run.mode === 'review'
@@ -5372,8 +6140,11 @@ window.__ModuleLoader__.load({
5372
6140
  /** A result line, in the two shapes the panel already used. */
5373
6141
  function placementPreviewNotice(state) {
5374
6142
  const notice = state.notices?.preview
5375
- return ['assembly-placement', 'camera-fit'].includes(notice?.kind) && notice.projectId === state.activeProjectId
5376
- && notice.projectsRoot === state.projectsRoot ? notice : null
6143
+ if (!['assembly-placement', 'camera-fit'].includes(notice?.kind) || notice.projectId !== state.activeProjectId
6144
+ || notice.projectsRoot !== state.projectsRoot) return null
6145
+ if (notice.kind === 'camera-fit' && notice.revision && lighttableResult(state).artifact?.sourceRevision !== notice.revision)
6146
+ return { ...notice, message: t('fit.savedOtherPreview', { revision: notice.revision }) }
6147
+ return notice
5377
6148
  }
5378
6149
 
5379
6150
  function Notice(result, style) {
@@ -5491,7 +6262,7 @@ window.__ModuleLoader__.load({
5491
6262
  const numeric = (label, field, value, update, options = {}) => {
5492
6263
  const factor = options.factor ?? 1
5493
6264
  const displayed = Number.isFinite(value) ? Math.round(value * factor * 1e9) / 1e9 : ''
5494
- const invalid = !Number.isFinite(value) && !disabled && options.disabled !== true
6265
+ const invalid = (options.invalid === true || !Number.isFinite(value)) && !disabled && options.disabled !== true
5495
6266
  const errorId = `${draft.projectId}-${draft.entityId}-${field}-error`
5496
6267
  return el('label', { className: 'db-row', key: field }, el('span', null, label), el('span', { className: 'db-number-control' }, el('input', {
5497
6268
  className: 'db-input', type: 'number', 'data-field': field, 'aria-label': label,
@@ -5499,7 +6270,7 @@ window.__ModuleLoader__.load({
5499
6270
  value: displayed, step: options.step ?? (options.integer ? 1 : 'any'),
5500
6271
  min: options.min, max: options.max, disabled: disabled || options.disabled === true,
5501
6272
  style: { width: '125px' }, onChange: event => update(event.target.value === '' ? null : Number(event.target.value) / factor),
5502
- }), invalid ? el('span', { className: 'db-field-feedback', id: errorId }, t('editor.invalid', { field: label })) : null))
6273
+ }), invalid ? el('span', { className: 'db-field-feedback', id: errorId }, options.error || t('editor.invalid', { field: label })) : null))
5503
6274
  }
5504
6275
  const choose = (label, field, value, items, update, off = false) => el('label', { className: 'db-row', key: field }, el('span', null, label), el('select', {
5505
6276
  className: 'db-input', 'data-field': field, value, disabled: disabled || off, style: { maxWidth: '65%' }, onChange: event => update(event.target.value),
@@ -5580,7 +6351,22 @@ window.__ModuleLoader__.load({
5580
6351
  geometry ? [
5581
6352
  el('strong', { key: 'shape' }, geometry.shape === 'handled_cup' ? t('editor.handledCup') : geometry.shape === 'mesh' ? t('editor.mesh') : geometry.shape),
5582
6353
  geometry.shape === 'mesh' ? [el('p', { className: 'db-muted', key: 'mesh-counts' }, t('editor.meshCounts', { vertices: geometry.vertices?.length ?? 0, faces: geometry.faces?.length ?? 0 })),
5583
- toggle(t('editor.smoothSurface'), 'editor-generator-smooth', Boolean(geometry.smooth), value => actions.updateEditor('generator', ['smooth'], value))] : null,
6354
+ toggle(t('editor.smoothSurface'), 'editor-generator-smooth', Boolean(geometry.smooth), value => actions.updateEditor('generator', ['smooth'], value)),
6355
+ el('fieldset', { key: 'uv', 'data-uv-editor': true, disabled, style: { border: 0, padding: 0, margin: '16px 0' } },
6356
+ el('legend', null, t('editor.uv.title')),
6357
+ el('p', { className: 'db-muted' }, geometry.faceUvs ? t('editor.uv.saved') : t('editor.uv.automatic')),
6358
+ toggle(t('editor.uv.project'), 'editor-uv-project', draft.uvProjection != null,
6359
+ value => actions.updateEditor('uvProjection', [], value ? { quarterTurns: 0, scale: 1 } : null)),
6360
+ draft.uvProjection ? [
6361
+ el('p', { className: 'db-muted', key: 'uv-help' }, t('editor.uv.help')),
6362
+ choose(t('editor.uv.direction'), 'editor-uv-quarterTurns', String(draft.uvProjection.quarterTurns),
6363
+ [0, 1, 2, 3].map(turn => [String(turn), `${turn * 90}°`]), value => actions.updateEditor('uvProjection', ['quarterTurns'], Number(value))),
6364
+ numeric(t('editor.uv.scale'), 'editor-uv-scale', draft.uvProjection.scale,
6365
+ value => actions.updateEditor('uvProjection', ['scale'], value), { min: 0.0001, max: 10000, step: 0.1,
6366
+ invalid: draft.uvProjection.scale < 0.0001 || draft.uvProjection.scale > 10000,
6367
+ error: t('editor.uv.scaleInvalid') }),
6368
+ el('p', { className: 'db-muted', key: 'uv-scale-help' }, t('editor.uv.scaleHelp')),
6369
+ ] : null)] : null,
5584
6370
  el('p', { className: 'db-muted', key: 'local-size' }, t('editor.localDimensions', { scale: (draft.entity.transform.scale || [1, 1, 1]).join(' × ') })),
5585
6371
  geometry.shape === 'rounded_box' ? el('p', { className: 'db-muted', key: 'rounded' }, t('editor.roundedRequired')) : null,
5586
6372
  geometry.shape === 'handled_cup' ? el('p', { className: 'db-muted', key: 'cup-help' }, t('editor.cupHelp')) : null,
@@ -5702,6 +6488,9 @@ window.__ModuleLoader__.load({
5702
6488
  const projectId = state.activeProjectId, library = state.assetLibraries?.[projectId], work = state.assetWork?.[projectId] || {}
5703
6489
  const draft = state.assetDrafts?.[projectId], busy = Boolean(work.busy), limits = library?.limits, bundle = state.assetBundleSelections?.[projectId]
5704
6490
  const conflict = Boolean(draft && draft.baseRevision !== state.selected?.scene?.revision)
6491
+ const sizeText = (dimensions, scale = 1) => Array.isArray(dimensions) && dimensions.length === 3 && Number.isFinite(scale) && scale > 0
6492
+ && dimensions.every(value => Number.isFinite(value) && value >= 0 && Number.isFinite(value * scale))
6493
+ ? dimensions.map(value => Number((value * scale).toPrecision(6))).join(' × ') : null
5705
6494
  const update = (field, value) => actions.updateAsset(field, value)
5706
6495
  const text = (label, field, value, change, extra = {}) => el('label', { className: 'db-row' }, label,
5707
6496
  el('input', { className: 'db-input', 'aria-label': label, 'data-field': field, value, disabled: busy, onChange: event => change(event.target.value), ...extra }))
@@ -5769,7 +6558,8 @@ window.__ModuleLoader__.load({
5769
6558
  result ? el('div', null, el('img', { 'data-asset-preview': entry.asset.id, alt: entry.originalName || entry.asset.id,
5770
6559
  ...dimensions, src: artifactUrl(`/deepblend/artifacts/${encodeURIComponent(projectId)}/`, result.preview), style: { width: '100%', height: 'auto', maxHeight: '240px', objectFit: 'contain' } }),
5771
6560
  result.inspection.kind === 'environment' && result.preview.toneMapped ? el('p', { className: 'db-muted' }, t('assets.toneMapped')) : null,
5772
- result.inspection.dimensions ? el('p', null, `${t('assets.dimensions')}: ${result.inspection.dimensions.map(value => Number.isFinite(value) ? Number(value.toFixed(4)) : '—').join(' × ')}`) : null,
6561
+ sizeText(result.inspection.dimensions) !== null ? el('p', { 'data-asset-dimensions': true }, `${t('assets.dimensions')}: ${sizeText(result.inspection.dimensions)}`) : null,
6562
+ result.inspection.kind === 'model' ? el('p', { className: 'db-muted', 'data-asset-units': entry.asset.type }, entry.asset.type === 'obj' ? t('assets.unitsObj') : t('assets.unitsGltf')) : null,
5773
6563
  result.inspection.image ? el('p', null, `${result.inspection.image.width} × ${result.inspection.image.height}`) : null,
5774
6564
  result.inspection.warnings?.length ? el('h5', null, t('assets.inspectionWarnings')) : null,
5775
6565
  (result.inspection.warnings || []).map((warning, index) => el('p', { className: 'db-muted', key: index }, typeof warning === 'string' ? warning : warning.message || warning.code || '')),
@@ -5787,7 +6577,12 @@ window.__ModuleLoader__.load({
5787
6577
  el('p', { className: 'db-muted' }, t('assets.modelHelp')),
5788
6578
  text(t('assets.entityId'), 'asset-entity-id', draft.newEntityId, value => update('newEntityId', value)),
5789
6579
  vector(t('editor.position'), 'location', draft.location, 1000), vector(t('editor.rotation'), 'rotationEuler', draft.rotationEuler, 180 / Math.PI),
5790
- number(t('assets.scale'), 'asset-scale', draft.scale ?? '', value => update('scale', value), { min: 0.000001 })) : null,
6580
+ number(t('assets.scale'), 'asset-scale', draft.scale ?? '', value => update('scale', value), { min: 0.000001 }),
6581
+ sizeText(draft.inspection?.dimensions, draft.scale) !== null ? el('p', { 'data-asset-scaled-dimensions': true }, `${t('assets.scaledDimensions')}: ${sizeText(draft.inspection.dimensions, draft.scale)}`) : null,
6582
+ el('p', { className: 'db-muted' }, t('assets.hideHelp')),
6583
+ choose(t('assets.hideExisting'), 'asset-hide-existing', draft.hideEntityId, [['', t('assets.hideNone')],
6584
+ ...draft.scene.nodes.entities.filter(entity => entity.visible !== false && !entity.locked && entity.kind !== 'empty').map(entity => [entity.id, entity.id])], value => update('hideEntityId', value)),
6585
+ check(t('assets.makeSubject'), 'asset-make-subject', draft.makeSubject, value => update('makeSubject', value))) : null,
5791
6586
  draft.kind === 'environment' ? el('div', null,
5792
6587
  el('p', { className: 'db-muted' }, t('assets.environmentHelp')),
5793
6588
  number(t('assets.strength'), 'asset-world-strength', draft.strength ?? '', value => update('strength', value), { min: 0, max: 1000 }),
@@ -5863,7 +6658,7 @@ window.__ModuleLoader__.load({
5863
6658
  const draft = photographyDraftFor(state), projectId = state.activeProjectId, work = state.photographyWork?.[projectId] || {}, edit = state.photographyEdits?.[projectId]
5864
6659
  const busy = photographyBusy(work)
5865
6660
  const conflict = draft && draft.baseRevision !== state.selected?.scene?.revision
5866
- const disabled = busy || conflict, errors = draft ? photographyErrors(draft) : []
6661
+ const disabled = busy || conflict || state.photographyReuse?.[projectId]?.planning, errors = draft ? photographyErrors(draft) : []
5867
6662
  const camera = draft?.cameras.find(item => item.id === draft.cameraId), light = draft?.lights.find(item => item.id === draft.lightId)
5868
6663
  const update = (kind, path) => value => actions.updatePhotography(kind, path, value)
5869
6664
  const numeric = (label, field, value, change, options = {}) => el('label', { className: 'db-row' }, label, el('input', {
@@ -5882,6 +6677,20 @@ window.__ModuleLoader__.load({
5882
6677
  const aimLocked = camera && photographyAimLocked(draft, camera)
5883
6678
  const reuse = state.photographyReuse?.[projectId] || {}, sourceCamera = reuse.source?.nodes.cameras.find(item => item.id === reuse.cameraId)?.definition
5884
6679
  const reuseStale = reuse.source && (reuse.projectsRoot !== state.projectsRoot || reuse.baseRevision !== draft?.baseRevision || draft?.projectsRoot !== state.projectsRoot)
6680
+ const boundaryMode = reuse.mode === 'bounds', boundaryRequest = boundaryMode ? photographyBoundaryRequest(state, reuse, draft) : null
6681
+ const productMembers = (title, scene, field) => {
6682
+ const selected = reuse[field] || [], choices = photographyProductEntities(scene)
6683
+ const all = choices.filter(e => !e.tags?.includes('environment')).map(e => e.id)
6684
+ return Disclosure({ state, actions }, `photo-boundary:${field}`, title, { 'data-photography-members': field, style: { minWidth: 0 } },
6685
+ el('div', { className: 'db-inline' },
6686
+ Button({ action: `photo-members-all:${field}`, disabled: disabled || all.length > 128, onClick: () => actions.setPhotographySource(field, all), children: t('photo.boundsAll') }),
6687
+ Button({ action: `photo-members-clear:${field}`, disabled, onClick: () => actions.setPhotographySource(field, []), children: t('photo.boundsClear') })),
6688
+ el('div', { style: { maxHeight: '220px', overflowY: 'auto', minWidth: 0 } }, choices.map(e => el('label', { key: e.id, style: { display: 'flex', gap: '8px', margin: '6px 0', minWidth: 0 } },
6689
+ el('input', { type: 'checkbox', 'data-field': `photo-${field}:${e.id}`, checked: selected.includes(e.id), disabled: disabled || selected.length >= 128 && !selected.includes(e.id), style: { flex: 'none' },
6690
+ onChange: event => actions.setPhotographySource(field, event.target.checked ? [...selected, e.id] : selected.filter(id => id !== e.id)) }),
6691
+ el('span', { style: { overflowWrap: 'anywhere', minWidth: 0 } }, e.label || e.id)))))
6692
+ }
6693
+
5885
6694
  return el('section', { className: 'db-card', 'data-photography-editor': projectId },
5886
6695
  CameraFitEditor({ state, actions }),
5887
6696
  el('h4', null, t('photo.title')), el('p', { className: 'db-muted' }, t('photo.help')),
@@ -5889,23 +6698,34 @@ window.__ModuleLoader__.load({
5889
6698
  el('p', { className: 'db-muted', 'data-photography-base': draft.baseRevision }, t('photo.base', { revision: draft.baseRevision })),
5890
6699
  conflict ? el('p', { className: 'db-error', 'data-photography-conflict': true }, t('photo.conflict', { before: draft.baseRevision, current: state.selected?.scene?.revision })) : null,
5891
6700
  state.cameraTargetResetSupported ? el('div', { 'data-photography-reuse': true },
5892
- el('h4', null, t('photo.reuseTitle')), el('p', { className: 'db-muted' }, t('photo.reuseHelp')),
6701
+ el('h4', null, t('photo.reuseTitle')), el('p', { className: 'db-muted' }, boundaryMode ? t('photo.boundsHelp') : t('photo.reuseHelp')),
6702
+ state.photographyBoundaryReuseSupported ? choose(t('photo.reuseMode'), 'source-mode', reuse.mode || 'absolute', [['absolute', t('photo.reuseAbsolute')], ['bounds', t('photo.reuseBounds')]], value => actions.setPhotographySource('mode', value))
6703
+ : boundaryMode ? el('div', null, el('p', { className: 'db-error' }, t('photo.boundsUnavailable')), Button({ action: 'photo-use-absolute', onClick: () => actions.setPhotographySource('mode', 'absolute'), children: t('photo.reuseAbsolute') })) : null,
5893
6704
  choose(t('photo.reuseProject'), 'source-project', reuse.sourceProjectId || '', [['', '—'], ...state.projects.filter(item => !item.creationPending).map(item => [item.projectId, item.title || item.projectId])], value => actions.setPhotographySource('project', value)),
5894
6705
  choose(t('photo.reuseRevision'), 'source-revision', reuse.revision || '', [['', '—'], ...(reuse.revisions || []).map(item => [item.revision, item.revision])], value => actions.setPhotographySource('revision', value), reuse.loading || !reuse.revisions?.length),
5895
6706
  reuse.loading ? el('p', { role: 'status' }, t('photo.reuseReading')) : null,
5896
6707
  reuse.source ? el('div', { 'data-photography-source': `${reuse.sourceProjectId}:${reuse.revision}` },
5897
6708
  el('p', { className: 'db-muted' }, t('photo.reuseSource', { project: reuse.sourceProjectId, revision: reuse.revision, digest: shortDigest(reuse.source.digest), count: reuse.source.nodes.lights.length })),
5898
6709
  choose(t('photo.reuseCamera'), 'source-camera', reuse.cameraId, reuse.source.nodes.cameras.map(item => [item.id, item.id]), value => actions.setPhotographySource('camera', value)),
5899
- photographyAim(sourceCamera) === 'entity' ? choose(t('photo.reuseTarget'), 'source-target', reuse.targetEntityId || '', [['', '—'], ...draft.entities.map(item => [item.id, item.id])], value => actions.setPhotographySource('target', value)) : null,
6710
+ !boundaryMode && photographyAim(sourceCamera) === 'entity' ? choose(t('photo.reuseTarget'), 'source-target', reuse.targetEntityId || '', [['', '—'], ...draft.entities.map(item => [item.id, item.id])], value => actions.setPhotographySource('target', value)) : null,
6711
+ boundaryMode ? el('div', null,
6712
+ numeric(t('photo.boundsFrame'), 'source-frame', reuse.sourceFrame, value => actions.setPhotographySource('sourceFrame', value), { min: reuse.source.project.frameStart, max: reuse.source.project.frameEnd, step: 1 }),
6713
+ el('p', { className: 'db-muted' }, t('photo.boundsPick')),
6714
+ productMembers(t('photo.boundsSource', { count: (reuse.sourceEntityIds || []).length }), reuse.source, 'sourceEntityIds'),
6715
+ productMembers(t('photo.boundsDestination', { count: (reuse.destinationEntityIds || []).length }), state.selected?.scene, 'destinationEntityIds'),
6716
+ !boundaryRequest ? el('p', { className: 'db-muted' }, t('photo.boundsInvalid')) : null) : null,
5900
6717
  photographyDirty(draft) ? el('label', { className: 'db-row' }, el('input', { type: 'checkbox', 'data-field': 'photo-source-replace', checked: Boolean(reuse.replaceDraft), disabled: disabled || reuse.loading,
5901
6718
  onChange: event => actions.setPhotographySource('replace', Boolean(event.target.checked)) }), t('photo.reuseReplace')) : null,
5902
6719
  reuseStale ? el('p', { className: 'db-error' }, t('photo.reuseStale')) : null,
5903
- reuse.applied ? el('p', { role: 'status', 'data-photography-reused': true }, t('photo.reuseApplied')) : null,
6720
+ reuse.applied ? el('p', { role: 'status', 'data-photography-reused': true }, draft.boundaryReuse
6721
+ ? t('photo.boundsApplied', { scale: Number(draft.boundaryReuse.scale.toPrecision(5)), sourceCount: draft.boundaryReuse.sourceCount, destinationCount: draft.boundaryReuse.destinationCount, frame: draft.boundaryReuse.sourceFrame }) : t('photo.reuseApplied')) : null,
6722
+
5904
6723
  reuse.unchanged ? el('p', { role: 'status', 'data-photography-reuse-unchanged': true }, t('photo.reuseSame')) : null) : null,
6724
+ reuse.planning ? el('div', { role: 'status' }, t('photo.boundsPlanning'), Button({ action: 'photo-cancel-adaptation', onClick: actions.cancelPhotographyReuse, children: t('photo.boundsCancel') })) : null,
5905
6725
  reuse.error ? el('p', { className: 'db-error', role: 'status', 'data-photography-source-error': true }, reuse.error) : null,
5906
6726
  el('div', { className: 'db-inline' },
5907
6727
  Button({ action: 'photo-source-reload', disabled: disabled || !reuse.sourceProjectId || reuse.loading, onClick: actions.reloadPhotographySource, children: t('photo.reuseReload') }),
5908
- Button({ action: 'photo-reuse', disabled: disabled || reuse.loading || !reuse.source || reuseStale || (photographyDirty(draft) && !reuse.replaceDraft) || (photographyAim(sourceCamera) === 'entity' && !reuse.targetEntityId), onClick: actions.reusePhotography, children: t('photo.reuseApply') }))) : el('p', { className: 'db-muted' }, t('photo.reuseUpgrade')),
6728
+ Button({ action: 'photo-reuse', disabled: disabled || reuse.loading || !reuse.source || reuseStale || (photographyDirty(draft) && !reuse.replaceDraft) || (boundaryMode ? !boundaryRequest : photographyAim(sourceCamera) === 'entity' && !reuse.targetEntityId), onClick: actions.reusePhotography, children: t('photo.reuseApply') }))) : el('p', { className: 'db-muted' }, t('photo.reuseUpgrade')),
5909
6729
  el('div', { className: 'db-grid' },
5910
6730
  el('div', null,
5911
6731
  choose(t('photo.camera'), 'camera', draft.cameraId, draft.cameras.map(item => [item.id, item.id]), id => actions.selectPhotography('camera', id)),
@@ -6476,15 +7296,115 @@ window.__ModuleLoader__.load({
6476
7296
  )
6477
7297
  }
6478
7298
 
7299
+ function MotionEditor(ctx) {
7300
+ const { state, actions } = ctx, draft = motionDraftFor(state), work = state.motionWork?.[motionKey(state)] || {}
7301
+ if (!draft) return null
7302
+ const available = state.motionPreviewSupported && state.editableSnapshotAvailability?.available === true
7303
+ const busy = Boolean(work.busy), frozen = busy || Boolean(draft.result) || state.busy.patch, stale = draft.baseRevision !== state.currentRevision
7304
+ const invalid = !validMotionDraft(draft), result = draft.result
7305
+ const fullFrameChecked = result?.frameAudit?.schemaVersion === 'deepblend.motion-frame-audit-summary/v1' && result.frameAudit.scope === 'evaluated-mesh-vertices'
7306
+ && result.frameAudit.frameStart === result.frameStart && result.frameAudit.frameEnd === result.frameEnd
7307
+ && result.frameAudit.frameCount === result.video?.frames && result.frameAudit.cameraId === result.cameraId
7308
+ && Array.isArray(result.frameAudit.entityIds) && editorEqual(result.frameAudit.entityIds, [...draft.entityIds].sort())
7309
+ && /^[a-f0-9]{64}$/.test(result.frameAudit.checkpointSha256 || '')
7310
+ const value = (field, label, min, max, step) => el('label', { className: 'db-row' }, label, el('input', {
7311
+ className: 'db-input', type: 'number', 'data-field': `motion-${field}`, value: draft[field], min, max, step, disabled: frozen,
7312
+ onChange: event => actions.setMotionValue(field, event.target.value), style: { width: '100px' } }))
7313
+ return el('section', { className: 'db-card', 'data-motion-editor': true },
7314
+ el('h4', null, t('motion.title')), el('p', { className: 'db-muted' }, t('motion.help')),
7315
+ !available ? el('p', { role: 'status', className: 'db-muted' }, t('motion.local')) : null,
7316
+ el('label', { className: 'db-row' }, t('motion.camera'), el('select', { className: 'db-input', 'data-field': 'motion-camera', value: draft.cameraId, disabled: frozen,
7317
+ onChange: event => actions.setMotionValue('cameraId', event.target.value) }, draft.cameras.map(id => el('option', { key: id, value: id, disabled: Boolean(draft.cameraRestrictions?.[id]) },
7318
+ draft.cameraRestrictions?.[id] === 'animated' ? t('motion.cameraAnimatedOption', { camera: id })
7319
+ : draft.cameraRestrictions?.[id] === 'targeted' ? t('motion.cameraTargetedOption', { camera: id }) : id)))),
7320
+ draft.cameraRestrictions?.[draft.cameraId] ? el('p', { className: 'db-muted', role: 'status', 'data-motion-camera-restriction': draft.cameraRestrictions[draft.cameraId] },
7321
+ draft.cameraRestrictions[draft.cameraId] === 'animated' ? t('motion.cameraAnimated') : t('motion.cameraTargeted')) : null,
7322
+ draft.taggedOverflow ? el('p', { className: 'db-error', role: 'status' }, t('motion.tooMany')) : null,
7323
+ Disclosure(ctx, 'motion-parts', t('motion.subject'), {},
7324
+ draft.completeEntityIds?.length ? Button({ action: 'motion-whole-lamp', disabled: frozen, onClick: () => actions.setMotionValue('entityIds', draft.completeEntityIds), children: t('motion.wholeLamp') }) : null,
7325
+ draft.taggedEntityIds?.length ? Button({ action: 'motion-tagged', disabled: frozen, onClick: () => actions.setMotionValue('entityIds', draft.taggedEntityIds), children: t('motion.tagged') }) : null,
7326
+ draft.taggedEntityIds?.length ? el('p', { className: 'db-muted' }, t('motion.taggedHint')) : null,
7327
+ el('div', { style: { maxHeight: '200px', overflowY: 'auto' } }, draft.entities.map(entity => el('label', { className: 'db-row', key: entity.id },
7328
+ el('input', { type: 'checkbox', 'data-field': 'motion-part', 'data-entity-id': entity.id, checked: draft.entityIds.includes(entity.id),
7329
+ disabled: frozen || entity.visible === false || !draft.entityIds.includes(entity.id) && draft.entityIds.length >= 128,
7330
+ onChange: event => actions.setMotionValue('entityIds', event.target.checked ? [...draft.entityIds, entity.id] : draft.entityIds.filter(id => id !== entity.id)) }), entity.id, entity.visible === false ? t('motion.hidden') : '')))),
7331
+ value('seconds', t('motion.duration'), 1, 10, 1), value('amount', t('motion.amount'), 1, 20, 1),
7332
+ el('label', { className: 'db-row' }, t('motion.direction'), el('select', { className: 'db-input', 'data-field': 'motion-direction', value: draft.direction, disabled: frozen,
7333
+ onChange: event => actions.setMotionValue('direction', event.target.value) },
7334
+ el('option', { value: 'forward' }, t('motion.forward')), el('option', { value: 'backward' }, t('motion.backward')))),
7335
+ el('label', { className: 'db-row' }, el('input', { type: 'checkbox', 'data-field': 'motion-extend', checked: draft.allowRangeExtension, disabled: frozen,
7336
+ onChange: event => actions.setMotionValue('allowRangeExtension', event.target.checked) }), t('motion.extend')),
7337
+ result?.saveAttempted && !work.error && !busy ? el('p', { role: 'status', className: 'db-muted' }, t('motion.uncertain'))
7338
+ : stale && !result?.saveAttempted ? el('p', { className: 'db-error', role: 'status' }, t('motion.stale'))
7339
+ : invalid && !result ? el('p', { className: 'db-muted' }, t('motion.invalid')) : null,
7340
+ el('p', { className: 'db-muted' }, t('motion.limit')),
7341
+ fullFrameChecked ? el('p', { className: 'db-muted', 'data-motion-full-frame-check': true }, t('motion.fullCheck')) : null,
7342
+ fullFrameChecked && result.frameAudit.savedAuditSupported === true ? el('p', { className: 'db-muted', 'data-motion-saved-frame-check': true }, t('motion.savedCheck')) : null,
7343
+ result?.saveAttempted && !busy ? el('p', { className: 'db-muted' }, t('motion.abandonHelp')) : null,
7344
+ result ? el('video', { controls: true, preload: 'metadata', 'data-motion-video': result.id, style: { display: 'block', width: '100%', maxWidth: '480px' },
7345
+ src: projectRoute(draft.projectId, `/motion-previews/${result.id}/video`) }) : null,
7346
+ el('div', { className: 'db-inline', style: { flexWrap: 'wrap' } },
7347
+ !result ? Button({ action: 'motion-preview', tone: 'primary', disabled: !available || busy || stale || invalid || Object.values(state.busy).some(Boolean), onClick: actions.previewMotion, children: work.busy === 'preview' ? t('motion.generating') : t('motion.preview') }) : null,
7348
+ work.busy === 'preview' ? Button({ action: 'motion-cancel', onClick: actions.cancelMotion, children: t('motion.cancel') }) : null,
7349
+ result ? Button({ action: 'motion-save', tone: 'primary', disabled: !available || busy || draft.storageError || stale && !result.saveAttempted || result.expiresAt <= Date.now() && !result.saveAttempted,
7350
+ onClick: actions.saveMotion, children: work.busy === 'save' ? t('motion.saving') : result.saveAttempted ? t('motion.retry') : t('motion.save') }) : null,
7351
+ !busy ? Button({ action: 'motion-discard', onClick: actions.discardMotion, children: result?.saveAttempted ? t('motion.abandon') : result ? t('motion.discard') : t('motion.reset') }) : null),
7352
+ work.error ? el('p', { className: 'db-error', role: 'alert', 'data-motion-error': true }, work.error) : null,
7353
+ work.message ? el('p', { role: 'status', 'data-motion-message': true }, work.message) : null)
7354
+ }
7355
+
7356
+ function renderSingleFrameLink(state, job) {
7357
+ if (!state.renderFrameDownloadSupported || state.editableSnapshotAvailability?.available !== true
7358
+ || !/^[a-f0-9]{64}$/.test(state.storeIdentity || '') || job.status !== 'completed' || job.delivery?.verified !== true
7359
+ || !/^r[0-9]{4,}$/.test(job.revisionId || '') || !/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$/.test(job.jobId || '')
7360
+ || !Number.isSafeInteger(job.frameStart) || job.frameStart < 1 || job.frameStart > 999999 || job.frameStart !== job.frameEnd) return null
7361
+ // A published still receipt already pins its frame and digest. Polling may
7362
+ // skip provenance for a busy project; do not hide a valid still in that case.
7363
+ const frames = job.delivery?.kind === 'still' ? [job.delivery.image].filter(frame => frame?.frame === job.frameStart)
7364
+ : Array.isArray(job.provenance?.frames) ? job.provenance.frames.filter(frame => frame?.frame === job.frameStart) : []
7365
+ if (frames.length !== 1 || !/^[a-f0-9]{64}$/.test(frames[0].sha256 || '')) return null
7366
+ const sha256 = frames[0].sha256
7367
+ return el('a', { className: 'db-btn', 'data-action': `download-frame:${job.jobId}`,
7368
+ href: projectRoute(state.activeProjectId, `/jobs/${encodeURIComponent(job.jobId)}/frames/${job.frameStart}?revision=${encodeURIComponent(job.revisionId)}&sha256=${sha256}&storeIdentity=${state.storeIdentity}`),
7369
+ download: true }, t('jobs.downloadFrame', { revision: job.revisionId, frame: job.frameStart }))
7370
+ }
7371
+
7372
+ function WideFramePreparation({ state, actions }) {
7373
+ const plan = wideFramePlan(state.selected?.scene), motion = motionDraftFor(state)
7374
+ const available = state.deliveryAspectPresetSupported && /^[a-f0-9]{64}$/.test(state.storeIdentity || '') && plan
7375
+ const pending = available && (projectHasUnsavedDrafts(state) || Boolean(motion?.result || motion?.touched || state.motionWork[motionKey(state)]?.busy))
7376
+ return el('section', { className: 'db-card', 'data-wide-frame': available ? plan.changed ? 'change' : 'ready' : 'unavailable' },
7377
+ el('h4', null, t('aspect.title')),
7378
+ !available ? el('p', { className: 'db-muted' }, t('aspect.unavailable'))
7379
+ : !plan.changed ? el('p', { className: 'db-muted' }, t('aspect.done'))
7380
+ : el('div', null, el('p', { className: 'db-muted' }, t('aspect.help')),
7381
+ plan.profiles.map(item => el('p', { key: item.name, 'data-wide-profile': item.name }, t('aspect.change', { profile: item.name, before: item.before.join('×'), after: item.after.join('×') }))),
7382
+ pending ? el('p', { className: 'db-muted' }, t('aspect.pending')) : null,
7383
+ Button({ action: 'save-wide-frame', tone: 'primary', disabled: pending || Object.values(state.busy).some(Boolean), onClick: actions.saveWideFrame, children: t('aspect.apply') })))
7384
+ }
7385
+
6479
7386
  /** 任务: live progress, cancel, resume, and the approval threshold. */
6480
7387
  function JobsView(ctx) {
6481
7388
  const state = ctx.state
6482
7389
  const actions = ctx.actions
6483
7390
  if (state.activeProjectId === null) return el('div', { 'data-view': 'jobs', className: 'db-muted' }, t('common.noProject'))
6484
7391
  const jobs = state.jobs || []
7392
+ const scene = state.selected?.scene
7393
+ const frame = (value, fallback) => value === '' || value === undefined || value === null ? fallback : Number(value)
7394
+ const start = frame(state.forms.frameStart, scene?.project?.frameStart)
7395
+ const end = frame(state.forms.frameEnd, scene?.project?.frameEnd)
7396
+ const noDeclaredMotion = Array.isArray(scene?.nodes?.animationTracks) && scene.nodes.animationTracks.length === 0
7397
+ && Number.isSafeInteger(start) && Number.isSafeInteger(end) && end > start
7398
+ const wideOutput = ['still-2560x1440', 'video-1920x1080'].includes(state.forms.stillPreset)
7399
+ const profileSizes = ['preview', 'final'].map(name => scene?.renderProfiles?.[name]?.resolution)
7400
+ const sizeKnown = profileSizes.every(size => Array.isArray(size) && size.length === 2 && size.every(n => Number.isSafeInteger(n) && n > 0))
7401
+ const aspectWarning = !wideOutput ? null : !sizeKnown ? 'unknown' : profileSizes.some(([width, height]) => width * 9 !== height * 16) ? 'mismatch' : null
6485
7402
 
6486
7403
  return el('div', { 'data-view': 'jobs' },
6487
7404
  ErrorBox({ error: state.error }),
7405
+ ProjectStorageNotice(state),
7406
+ WideFramePreparation(ctx),
7407
+ MotionEditor(ctx),
6488
7408
  el('div', { className: 'db-card' },
6489
7409
  el('h4', null, t('tab.jobs')),
6490
7410
  jobs.length === 0
@@ -6494,6 +7414,7 @@ window.__ModuleLoader__.load({
6494
7414
  el('span', { className: 'db-mono' }, job.jobId),
6495
7415
  Badge({ tone: statusTone(job.status), children: job.status }),
6496
7416
  el('span', { className: 'db-muted' }, job.type),
7417
+ job.cameraId ? el('span', { className: 'db-muted', 'data-job-camera': job.cameraId }, `${t('jobs.camera')}: ${job.cameraId}`) : null,
6497
7418
  el('span', { className: 'db-muted db-mono' }, t('jobs.frameRange', { start: job.frameStart, end: job.frameEnd })),
6498
7419
  job.approval && job.approval.required ? Badge({ tone: 'warn', name: 'approval', children: t('jobs.approval', { frames: job.approval.frames, threshold: job.approval.threshold }) }) : null,
6499
7420
  job.deliverable ? Badge({ tone: 'ok', children: t('jobs.deliveryVerified') }) : null,
@@ -6504,13 +7425,29 @@ window.__ModuleLoader__.load({
6504
7425
  el('div', { className: 'db-muted', 'data-job-detail': job.jobId }, `${job.detail} · ${job.progress.percent}% · 缺失 ${job.progress.missing} · 损坏 ${job.progress.corrupt}`),
6505
7426
  el('div', { className: 'db-muted', 'data-job-provenance': job.jobId }, jobProvenanceText(job)),
6506
7427
  job.errorCode ? el('div', { className: 'db-error', style: { marginTop: '4px' } }, `${job.errorCode}: ${job.message || ''}`) : null,
6507
- job.delivery ? el('div', { className: 'db-muted db-mono' }, `video ${job.delivery.videoPath || ''}`) : null,
7428
+ renderSingleFrameLink(state, job),
7429
+ state.renderVideoDownloadSupported && state.editableSnapshotAvailability?.available === true
7430
+ && /^[a-f0-9]{64}$/.test(state.storeIdentity || '') && job.status === 'completed' && job.delivery?.verified === true
7431
+ && /^r[0-9]{4,}$/.test(job.revisionId || '') && /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$/.test(job.jobId || '')
7432
+ && /^[a-f0-9]{64}$/.test(job.delivery.sha256 || '')
7433
+ ? el('a', { className: 'db-btn', 'data-action': `download-video:${job.jobId}`,
7434
+ href: projectRoute(state.activeProjectId, `/jobs/${encodeURIComponent(job.jobId)}/video?revision=${encodeURIComponent(job.revisionId)}&sha256=${job.delivery.sha256}&storeIdentity=${state.storeIdentity}`),
7435
+ download: true }, t('jobs.downloadVideo', { revision: job.revisionId }))
7436
+ : job.delivery ? el('div', { className: 'db-muted db-mono' }, `video ${job.delivery.videoPath || ''}`) : null,
6508
7437
  ))),
6509
7438
  ),
6510
7439
 
6511
7440
  el('div', { className: 'db-card' },
6512
7441
  el('h4', null, t('jobs.startDelivery')),
7442
+ noDeclaredMotion ? el('p', { className: 'db-muted', role: 'status', 'data-motion-warning': 'no-declared-tracks' }, t('jobs.noDeclaredMotion')) : null,
6513
7443
  el('div', { className: 'db-inline' },
7444
+ el('label', { className: 'db-muted' }, t('jobs.camera')),
7445
+ el('select', { className: 'db-input', 'data-field': 'render-camera', 'aria-label': t('jobs.camera'), style: { width: 'auto' }, value: state.forms.renderCamera || '',
7446
+ onChange: event => actions.setForm('renderCamera', event.target.value) },
7447
+ el('option', { value: '' }, t('jobs.cameraDefault')),
7448
+ state.forms.renderCamera && !scene?.nodes?.cameras?.some(camera => camera.id === state.forms.renderCamera)
7449
+ ? el('option', { value: state.forms.renderCamera }, state.forms.renderCamera) : null,
7450
+ (scene?.nodes?.cameras || []).map(camera => el('option', { key: camera.id, value: camera.id }, camera.id))),
6514
7451
  el('label', { className: 'db-muted' }, t('jobs.frameStart')),
6515
7452
  el('input', { className: 'db-input', 'data-field': 'frame-start', 'aria-label': t('jobs.frameStart'), style: { width: '90px' }, value: state.forms.frameStart, onChange: event => actions.setForm('frameStart', event.target.value) }),
6516
7453
  el('label', { className: 'db-muted' }, t('jobs.frameEnd')),
@@ -6522,8 +7459,19 @@ window.__ModuleLoader__.load({
6522
7459
  },
6523
7460
  el('option', { value: 'preview' }, 'preview'),
6524
7461
  el('option', { value: 'final' }, 'final')),
7462
+ state.stillImageDeliverySupported ? el('label', { className: 'db-muted' }, t('jobs.deliveryKind')) : null,
7463
+ state.stillImageDeliverySupported ? el('select', { className: 'db-input', 'data-field': 'render-delivery-kind', 'aria-label': t('jobs.deliveryKind'), style: { width: 'auto' }, value: state.forms.deliveryKind || '', onChange: event => actions.setForm('deliveryKind', event.target.value) },
7464
+ el('option', { value: '' }, t('jobs.deliveryVideo')), el('option', { value: 'still' }, t('jobs.deliveryStill'))) : null,
7465
+ state.stillDeliveryPresetSupported || state.videoDeliveryPresetSupported ? el('label', { className: 'db-muted' }, t('jobs.stillPreset')) : null,
7466
+ state.stillDeliveryPresetSupported || state.videoDeliveryPresetSupported ? el('select', { className: 'db-input', 'data-field': 'render-still-preset', 'aria-label': t('jobs.stillPreset'), style: { width: 'auto' }, value: state.forms.stillPreset || '', onChange: event => actions.setForm('stillPreset', event.target.value) },
7467
+ el('option', { value: '' }, t('jobs.stillProfileSize')),
7468
+ state.stillDeliveryPresetSupported ? el('option', { value: 'still-2560x1440' }, t('jobs.still2560')) : null,
7469
+ state.videoDeliveryPresetSupported ? el('option', { value: 'video-1920x1080' }, t('jobs.video1080')) : null) : null,
6525
7470
  Button({ tone: 'primary', action: 'start-render', disabled: state.busy.render, onClick: () => actions.startRender(undefined), children: state.busy.render ? t('scene.submitting') : t('jobs.start') }),
6526
7471
  ),
7472
+ state.forms.stillPreset === 'video-1920x1080' ? el('p', { className: 'db-muted', role: 'status' }, t('jobs.videoPresetHelp', { fps: scene?.project?.fps ?? '—' }))
7473
+ : state.forms.stillPreset || state.forms.deliveryKind ? el('p', { className: 'db-muted', role: 'status' }, t('jobs.stillRange')) : null,
7474
+ aspectWarning ? el('p', { className: 'db-error', role: 'status', 'data-render-aspect-warning': aspectWarning }, aspectWarning === 'mismatch' ? t('aspect.outputMismatch') : t('aspect.outputUnknown')) : null,
6527
7475
  Notice(state.notices.jobs, { marginTop: '8px' }),
6528
7476
  ),
6529
7477
  )
@@ -6602,6 +7550,11 @@ window.__ModuleLoader__.load({
6602
7550
 
6603
7551
  el('div', { className: 'db-card' },
6604
7552
  el('h4', null, t('visual.title')),
7553
+ qa.visual.inputScope?.views?.length ? el('div', { 'data-review-input-scope': qa.visual.inputScope.mode },
7554
+ el('strong', null, t('reviewView.scope', { revision: qa.visual.inputScope.sourceRevision })),
7555
+ qa.visual.inputScope.views.map(view => el('p', { key: view.id, className: 'db-muted', style: { overflowWrap: 'anywhere' },
7556
+ 'data-reviewed-camera': view.cameraId, 'data-reviewed-frame': view.frame }, t('reviewView.scopeItem', {
7557
+ camera: view.cameraId, frame: view.frame, resolution: (view.resolution || []).join('×'), samples: view.samples ?? '—' })))) : null,
6605
7558
  qa.visual.available
6606
7559
  ? el('div', null,
6607
7560
  KeyValues({ entries: [
@@ -6630,7 +7583,8 @@ window.__ModuleLoader__.load({
6630
7583
  function EditableSnapshotView({ state, actions }) {
6631
7584
  const entry = snapshotEntry(state), result = entry?.result, busy = entry?.busy || {}
6632
7585
  const enabled = snapshotSupported(state), working = Object.values(busy).some(Boolean), preparing = result?.state === 'preparing'
6633
- const same = snapshotSameSelection(entry), videos = snapshotVideos(state, entry?.revision)
7586
+ const same = snapshotSameSelection(entry), videos = snapshotVideos(state, entry?.revision), images = snapshotImages(state, entry?.revision)
7587
+ const missingImages = (entry?.imageJobIds || []).filter(id => !images.some(job => job.jobId === id))
6634
7588
  const revisions = state.selected?.revisions || []
6635
7589
  const phases = { writing: t('snapshot.copying'), verifying: t('snapshot.verifying'), publishing: t('snapshot.publishing') }
6636
7590
  const done = result?.phase === 'verifying' ? result.verifiedBytes : result?.writtenBytes
@@ -6648,9 +7602,19 @@ window.__ModuleLoader__.load({
6648
7602
  entry?.videoJobId && !videos.some(job => job.jobId === entry.videoJobId) ? el('option', { value: entry.videoJobId }, entry.videoJobId) : null,
6649
7603
  videos.map(job => el('option', { key: job.jobId, value: job.jobId }, job.jobId))))),
6650
7604
  revisions.length === 0 ? el('p', { className: 'db-muted' }, t('snapshot.noRevision')) : null,
7605
+ state.snapshotImagesSupported ? el('fieldset', { className: 'db-field', style: { marginTop: '12px' }, 'data-snapshot-images': true, disabled: !enabled || working || preparing },
7606
+ el('legend', null, t('snapshot.images')),
7607
+ images.map(job => el('label', { className: 'db-inline', key: job.jobId },
7608
+ el('input', { type: 'checkbox', 'data-field': 'snapshot-image', 'data-job-id': job.jobId, checked: (entry?.imageJobIds || []).includes(job.jobId),
7609
+ disabled: !(entry?.imageJobIds || []).includes(job.jobId) && (entry?.imageJobIds || []).length >= 16,
7610
+ onChange: event => actions.setSnapshotImage(job.jobId, event.target.checked) }),
7611
+ el('span', null, `${job.jobId} · ${job.cameraId || '—'} · ${job.delivery.image.frame} · ${job.delivery.image.width}×${job.delivery.image.height}`))),
7612
+ missingImages.map(id => el('label', { className: 'db-inline db-error', key: id }, el('input', { type: 'checkbox', 'data-field': 'snapshot-image', 'data-job-id': id, checked: true,
7613
+ onChange: event => actions.setSnapshotImage(id, event.target.checked) }), el('span', null, t('snapshot.missingImage', { jobId: id })))),
7614
+ !images.length && !missingImages.length ? el('p', { className: 'db-muted' }, t('snapshot.noImages')) : null) : null,
6651
7615
  el('div', { 'aria-live': 'polite', role: 'status', style: { marginTop: '12px' } },
6652
7616
  busy.cancel ? el('p', null, t('snapshot.cancelling')) : busy.check && !result ? el('p', null, t('snapshot.checking')) : busy.prepare || preparing ? el('p', null, phases[result?.phase] || t('snapshot.preparing')) : null,
6653
- result?.state === 'ready' ? el('p', null, t('snapshot.ready', { revision: result.revision, bytes: snapshotBytes(result.archive.bytes) })) : null,
7617
+ same && result?.state === 'ready' ? el('p', null, t('snapshot.ready', { revision: result.revision, bytes: snapshotBytes(result.archive.bytes) })) : null,
6654
7618
  ['failed', 'cancelled'].includes(result?.state) ? el('p', { className: 'db-muted' }, result.error?.code === 'SNAPSHOT_INTERRUPTED' ? t('snapshot.interrupted') : result.state === 'failed' ? t('snapshot.failed') : t('snapshot.cancelled')) : null,
6655
7619
  result?.state === 'failed' && result.error?.message ? el('p', { className: 'db-error' }, result.error.message) : null,
6656
7620
  (preparing || busy.prepare) && entry?.handle ? el('p', { className: 'db-muted' }, t('snapshot.saved', entry.handle)) : null,
@@ -6660,7 +7624,7 @@ window.__ModuleLoader__.load({
6660
7624
  entry?.handle && !same ? el('p', { className: 'db-muted' }, t('snapshot.newSelection')) : null,
6661
7625
  entry?.storageUnavailable && entry.handle ? el('p', { className: 'db-muted' }, t('snapshot.storage')) : null,
6662
7626
  el('div', { className: 'db-inline', style: { marginTop: '12px' } },
6663
- enabled && result?.state === 'ready' && !entry.issue ? el('a', { className: 'db-btn', 'data-tone': 'primary', href: result.downloadUrl, download: true, 'data-action': 'snapshot-download' }, t('snapshot.download')) : null,
7627
+ enabled && same && result?.state === 'ready' && !entry.issue ? el('a', { className: 'db-btn', 'data-tone': 'primary', href: result.downloadUrl, download: true, 'data-action': 'snapshot-download' }, t('snapshot.download')) : null,
6664
7628
  preparing ? Button({ action: 'snapshot-cancel', disabled: !enabled || busy.cancel || busy.prepare, onClick: actions.cancelEditableSnapshot, children: t('snapshot.cancel') }) : null,
6665
7629
  entry?.issue || entry?.handle && !result ? Button({ action: 'snapshot-check', disabled: !enabled || working, onClick: actions.checkEditableSnapshot, children: t('snapshot.check') }) : null,
6666
7630
  (!preparing || entry?.issue) && !(same && result?.state === 'ready' && !entry.issue) ? Button({ action: 'snapshot-prepare', tone: 'primary', disabled: !enabled || !entry?.revision || working,
@@ -6777,6 +7741,37 @@ window.__ModuleLoader__.load({
6777
7741
  })))
6778
7742
  }
6779
7743
 
7744
+ function ProjectStorageNotice(state) {
7745
+ const storage = state.projectStorage
7746
+ const status = ['low', 'observed'].includes(storage?.status) && Number.isSafeInteger(storage.availableBytes) && storage.availableBytes >= 0
7747
+ ? storage.status : 'unknown'
7748
+ const space = status === 'unknown' ? null : assetBytes(storage.availableBytes)
7749
+ return el('section', { className: status === 'low' ? 'db-error' : 'db-muted', 'data-project-storage': status, role: 'status' },
7750
+ el('p', null, status === 'low' ? t('storage.low', { space }) : status === 'observed' ? t('storage.observed', { space }) : t('storage.unknown')), el('p', null, t('storage.limit')))
7751
+ }
7752
+
7753
+ function ImageInputReadiness({ state, actions }) {
7754
+ const probe = state.imageInputProbe || { busy: false, result: null }
7755
+ const available = state.imageInputProbeSupported && state.editableSnapshotAvailability?.available === true
7756
+ const result = available ? probe.result : null
7757
+ const message = result?.status === 'pass' ? t('readiness.imagePass')
7758
+ : result?.reason === 'authentication' ? t('readiness.imageAuth')
7759
+ : result?.reason === 'credentials_missing' ? t('readiness.imageCredentials')
7760
+ : result?.reason === 'image_unsupported' ? t('readiness.imageUnsupported')
7761
+ : result?.reason === 'model_unavailable' ? t('readiness.imageModel')
7762
+ : ['provider_unavailable', 'services_missing', 'route_missing'].includes(result?.reason) ? t('readiness.imageRoute')
7763
+ : result?.reason === 'rate_limit' ? t('readiness.imageRate')
7764
+ : ['timeout', 'cancelled'].includes(result?.reason) ? t('readiness.imageTimeout')
7765
+ : result?.reason === 'busy' ? t('readiness.imageBusy') : t('readiness.imageInconclusive')
7766
+ return el('section', { 'data-image-readiness': true },
7767
+ el('h4', null, t('readiness.imageTitle')),
7768
+ el('p', { className: 'db-muted' }, t('readiness.imageHelp')),
7769
+ !available ? el('p', { className: 'db-muted' }, t('readiness.imageLocal')) : null,
7770
+ Button({ action: 'probe-image-input', disabled: !available || probe.busy, onClick: actions.probeImageInput,
7771
+ children: probe.busy ? t('readiness.imageRunning') : t('readiness.imageRun') }),
7772
+ result ? el('p', { role: 'status', 'data-image-readiness-result': result.status, className: result.status === 'pass' ? 'db-muted' : 'db-error' }, message) : null)
7773
+ }
7774
+
6780
7775
  function LighttableWorkspace(ctx) {
6781
7776
  const { state, actions } = ctx, result = lighttableResult(state)
6782
7777
  const comparison = state.view === 'preview' && state.compareMode !== 'result'
@@ -6845,7 +7840,8 @@ window.__ModuleLoader__.load({
6845
7840
  el('label', { className: 'db-field' }, t('workbench.appearance'),
6846
7841
  el('select', { className: 'db-input db-theme', 'data-field': 'workbench-appearance', value: state.appearance || 'system', onChange: event => actions.setAppearance(event.target.value) },
6847
7842
  [['system', t('workbench.system')], ['light', t('workbench.light')], ['dark', t('workbench.dark')]].map(([theme, label]) => el('option', { value: theme }, label)))),
6848
- el('a', { className: 'db-btn', href: ROUTES.diagnostics, download: 'deepblend-diagnostics.json', 'data-action': 'export-diagnostics', title: t('diagnostics.exportHint') }, t('diagnostics.export')))))),
7843
+ el('a', { className: 'db-btn', href: ROUTES.diagnostics, download: 'deepblend-diagnostics.json', 'data-action': 'export-diagnostics', title: t('diagnostics.exportHint') }, t('diagnostics.export')),
7844
+ ImageInputReadiness(ctx))))),
6849
7845
  el('nav', { className: 'db-nav', 'aria-label': t('workbench.navigation') },
6850
7846
  el('div', { className: 'db-journey' }, primary.map(entry => nav(entry.id, entry.id === 'projects' && active && (state.view !== 'projects' || state.projectTask !== 'new') ? t('lighttable.brief') : entry.label))),
6851
7847
  el('div', { className: 'db-secondary-nav' }, secondary.map(entry => nav(entry.id, entry.label)))),
@@ -7445,7 +8441,7 @@ window.__ModuleLoader__.load({
7445
8441
  inspection: { form: inspectionForm, valid: inspectionFormValid },
7446
8442
  assetLibrary: { selection: assetBundleSelection, createDraft: createAssetDraft, buildPatch: buildAssetPatch, error: assetDraftError, key: assetKey },
7447
8443
  referenceBrief: { createDraft: createBriefDraft, buildPatch: buildBriefPatch, dirty: briefDirty, valid: briefValid },
7448
- photographyEditor: { createDraft: createPhotographyDraft, buildPatch: buildPhotographyPatch, errors: photographyErrors, dirty: photographyDirty, draftFor: photographyDraftFor, reuse: reusePhotography },
8444
+ photographyEditor: { boundaryRequest: photographyBoundaryRequest, applyBoundary: applyBoundaryPhotography, createDraft: createPhotographyDraft, buildPatch: buildPhotographyPatch, errors: photographyErrors, dirty: photographyDirty, draftFor: photographyDraftFor, reuse: reusePhotography },
7449
8445
  sceneEditor: { createDraft: createEditorDraft, buildPatch: buildEditorPatch, errors: editorErrors, dirty: editorDirty, previewPair: editorPreviewPair, draftFor: editorDraftFor },
7450
8446
  renderView,
7451
8447
  mountStandalone,