@deepblend/dsh-blender-bundle 0.23.0 → 0.25.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/README.md +15 -17
- package/lib/client.js +1217 -68
- package/lib/doctor-cli.js +12 -2
- package/lib/doctor.js +9 -0
- package/lib/functional-probe.js +69 -0
- package/package.json +7 -7
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": "来源保存版本",
|
|
@@ -499,6 +540,24 @@ window.__ModuleLoader__.load({
|
|
|
499
540
|
'editor.uv.scale': '纹理重复',
|
|
500
541
|
'editor.uv.scaleInvalid': '请输入 0.0001 到 10000 之间的重复次数。',
|
|
501
542
|
'editor.uv.scaleHelp': '最长局部网格边界跨度内的重复次数。只改变纹理坐标,保存后查看实际预览。',
|
|
543
|
+
'editor.halfLap.title': '半搭接',
|
|
544
|
+
'editor.halfLap.partner': '搭接对象',
|
|
545
|
+
'editor.halfLap.none': '无搭接',
|
|
546
|
+
'editor.halfLap.role': '当前木条组',
|
|
547
|
+
'editor.halfLap.lower': '保留下半部',
|
|
548
|
+
'editor.halfLap.upper': '保留上半部',
|
|
549
|
+
'editor.halfLap.help': '两组木条须正交,顶面和底面分别等高。',
|
|
550
|
+
'editor.halfLap.invalid': '半搭接需要静态长方体网格。请移除不支持的修饰器,或将搭接对象设为「无搭接」。',
|
|
551
|
+
'editor.halfLap.inspect': '预览槽口',
|
|
552
|
+
'editor.halfLap.inspecting': '正在渲染槽口…',
|
|
553
|
+
'editor.halfLap.inspectError': '槽口预览失败。{message}',
|
|
554
|
+
'editor.halfLap.partial': '分开查看同一处端部搭接的两侧。搭接草稿尚未保存。',
|
|
555
|
+
'editor.halfLap.full': '分开查看同一处搭接的两侧。搭接草稿尚未保存。',
|
|
556
|
+
'editor.halfLap.count': '{count} 处交叉,其中 {partial} 处未跨满木条宽度',
|
|
557
|
+
'editor.halfLap.lowerPart': '下半部 · {name}',
|
|
558
|
+
'editor.halfLap.upperPart': '上半部 · {name}',
|
|
559
|
+
'editor.halfLap.lowerFace': '从上面查看下半部木条的槽口',
|
|
560
|
+
'editor.halfLap.upperFace': '从下面查看上半部木条的槽口',
|
|
502
561
|
'editor.subdivision': '曲面细分',
|
|
503
562
|
'editor.surfaceScatter': '封闭表面布置',
|
|
504
563
|
'editor.scatterTargets': '依附物体(逗号分隔)',
|
|
@@ -651,6 +710,7 @@ window.__ModuleLoader__.load({
|
|
|
651
710
|
'projects.recovered': '已打开之前创建的 {id},未重复创建或渲染',
|
|
652
711
|
'projects.replyMissing': '未能收到创建结果。输入已保留;重试上次创建会检查同一次请求。',
|
|
653
712
|
'projects.environmentFailed': 'Blender 环境尚未就绪。输入已保留;请先检查安装和路径,修复后再重试。',
|
|
713
|
+
'projects.environmentAllowlist': 'Blender 路径未获许可。输入已保留;请在 DSH 配置中指定 Blender 的绝对路径,或授权该程序所在目录,然后重试。',
|
|
654
714
|
'projects.creationFailed': '未能确认创建结果。输入已保留;可重试上次创建,或刷新列表检查已保存的项目。',
|
|
655
715
|
'projects.retryCreation': '重试上次创建',
|
|
656
716
|
'projects.originalTitle': '上次创建:{title}',
|
|
@@ -716,6 +776,83 @@ window.__ModuleLoader__.load({
|
|
|
716
776
|
'preview.identical': '结构完全相同',
|
|
717
777
|
'jobs.empty': '还没有渲染任务。',
|
|
718
778
|
'jobs.deliveryVerified': '交付已校验',
|
|
779
|
+
'jobs.downloadVideo': '下载 MP4 · 版本 {revision}',
|
|
780
|
+
'jobs.downloadFrame': '下载 PNG · 版本 {revision} · 第 {frame} 帧',
|
|
781
|
+
'jobs.camera': '渲染相机',
|
|
782
|
+
'jobs.cameraDefault': '场景默认相机',
|
|
783
|
+
'jobs.cameraMissing': '所选相机在当前版本中不存在,请重新选择。',
|
|
784
|
+
'motion.title': '制作相机推进',
|
|
785
|
+
'readiness.imageTitle': '模型图片输入检查',
|
|
786
|
+
'readiness.imageHelp': '主动发送一张随机测试图到当前视觉评审模型,可能产生模型费用;不会修改作品。切换模型或服务后请重新检查。',
|
|
787
|
+
'readiness.imageRun': '检查模型是否能看图',
|
|
788
|
+
'readiness.imageRunning': '正在检查…',
|
|
789
|
+
'readiness.imagePass': '本次测试图识别正确。该检查不评价作品质量,也不能保证所有图片都能识别。',
|
|
790
|
+
'readiness.imageAuth': '模型鉴权失败。请在 DSH 中检查当前服务的凭据,再重新检查。',
|
|
791
|
+
'readiness.imageCredentials': '当前模型服务尚未配置可用凭据。请在当前工作台使用的 DSH 配置中完成服务凭据设置,再重新检查。',
|
|
792
|
+
'readiness.imageUnsupported': '当前评审模型未声明支持图片输入。请在 DSH 中检查视觉评审模型配置。',
|
|
793
|
+
'readiness.imageModel': '当前服务的模型目录中找不到所选模型。请核对当前工作台使用的 DSH 配置,并选择目录中的模型标识;模型显示名可能与标识不同。保存后重新检查。',
|
|
794
|
+
'readiness.imageRoute': '评审模型或服务不可用。请检查当前 DSH 配置和服务状态。',
|
|
795
|
+
'readiness.imageRate': '模型服务暂时限流,请稍后重试。',
|
|
796
|
+
'readiness.imageTimeout': '本次检查超时或被取消,无法确认模型能否看图。',
|
|
797
|
+
'readiness.imageBusy': '上一次检查仍未结束;请稍后重试,若持续不结束,请重启 DSH。',
|
|
798
|
+
'readiness.imageInconclusive': '本次无法确认模型是否识别了测试图,请检查模型服务后重试。',
|
|
799
|
+
'readiness.imageLocal': '请在本机工作台检查;旧版 Host 需要重启或更新。',
|
|
800
|
+
'storage.low': '项目磁盘本次测得可用 {space},低于 2 GiB;多帧渲染可能中断。请先释放空间并刷新。',
|
|
801
|
+
'storage.observed': '项目磁盘本次测得可用 {space}。渲染可能需要更多空间。',
|
|
802
|
+
'storage.unknown': '暂时无法测量项目磁盘空间。请在渲染前检查项目所在磁盘。',
|
|
803
|
+
'storage.limit': '这是最近一次刷新时的估计,不是空间预留;系统保留、配额、临时目录和其他任务可能影响实际可写空间。',
|
|
804
|
+
'aspect.title': '为 16:9 交付准备画幅',
|
|
805
|
+
'aspect.help': '切换会创建新版本,并调整预览与正式配置的画幅;已保存相机和模型保持,但构图可能改变。请重新完整取景并检查画面。',
|
|
806
|
+
'aspect.change': '{profile}:{before} → {after}',
|
|
807
|
+
'aspect.apply': '保存 16:9 画幅',
|
|
808
|
+
'aspect.done': '预览和正式配置已是 16:9。仍需检查实际取景和影片。',
|
|
809
|
+
'aspect.unavailable': '当前配置无法安全计算 16:9 尺寸,或宿主需要更新;请检查项目配置。',
|
|
810
|
+
'aspect.pending': '请先保存或放弃其他草稿,并保存或重置运动草稿。',
|
|
811
|
+
'aspect.saved': '已保存新的画幅版本;请重新取景并检查。',
|
|
812
|
+
'aspect.outputMismatch': '所选交付是 16:9,但工程预览或正式画幅不是 16:9,画面可能裁切。请先准备 16:9 画幅并重新取景,或明确检查裁切结果。',
|
|
813
|
+
'aspect.outputUnknown': '无法确认工程预览和正式画幅;请先检查 16:9 交付的实际构图。',
|
|
814
|
+
'motion.help': '先从已完整取景的静态相机生成低质量运动预览,确认后保存新相机和运动;原作品与原相机保留。',
|
|
815
|
+
'motion.camera': '起始相机',
|
|
816
|
+
'motion.cameraAnimated': '这个相机已有动画,请选择静态相机;也可以先用「完整取景」生成新机位。',
|
|
817
|
+
'motion.cameraTargeted': '这个相机跟踪场景中的对象,请先用「完整取景」生成静态机位。',
|
|
818
|
+
'motion.cameraAnimatedOption': '{camera}(已有动画)',
|
|
819
|
+
'motion.cameraTargetedOption': '{camera}(跟踪对象)',
|
|
820
|
+
'motion.subject': '检查哪些产品部件',
|
|
821
|
+
'motion.wholeLamp': '选择完整台灯',
|
|
822
|
+
'motion.tagged': '选择标记为产品的可见部件',
|
|
823
|
+
'motion.taggedHint': '请核对是否包括整件可见产品;标签不保证完整,隐藏部件不参与入镜检查。',
|
|
824
|
+
'motion.hidden': '(已隐藏,不参与入镜检查)',
|
|
825
|
+
'motion.tooMany': '标记为产品的可见部件超过 128 个,无法一次检查全部部件;请调整场景或自行检查未选部分。',
|
|
826
|
+
'motion.duration': '时长(秒)',
|
|
827
|
+
'motion.amount': '推进幅度(%)',
|
|
828
|
+
'motion.direction': '方向',
|
|
829
|
+
'motion.forward': '向前推进',
|
|
830
|
+
'motion.backward': '向后拉远',
|
|
831
|
+
'motion.extend': '如有需要,允许延长项目时间范围;已有动画需要重新检查',
|
|
832
|
+
'motion.preview': '生成运动预览',
|
|
833
|
+
'motion.generating': '正在生成预览…',
|
|
834
|
+
'motion.cancel': '取消预览',
|
|
835
|
+
'motion.save': '确认并保存运动',
|
|
836
|
+
'motion.retry': '重试并找回保存结果',
|
|
837
|
+
'motion.abandon': '停止找回并重新选择',
|
|
838
|
+
'motion.abandonHelp': '如果无法找回,可以停止找回并重新选择。先检查版本记录:之前的保存仍可能完成。',
|
|
839
|
+
'motion.saving': '正在保存…',
|
|
840
|
+
'motion.discard': '放弃候选',
|
|
841
|
+
'motion.reset': '重新选择',
|
|
842
|
+
'motion.stale': '作品版本已改变,请重新选择并生成预览。',
|
|
843
|
+
'motion.invalid': '请选择静态相机和至少一个完整部件,并检查时长与幅度。',
|
|
844
|
+
'motion.outOfFrame': '所选部件在运动中超出画面。可减少推进幅度、选择向后拉远,或先调整静态取景后重试;没有保存新版本。',
|
|
845
|
+
'motion.unverifiable': '无法逐帧核验所选部件。请检查是否含隐藏部件、实例或模拟几何,并选择受支持的可见网格;没有保存新版本。',
|
|
846
|
+
'motion.limit': '预览为低采样画面;请看完整视频并检查遮挡、位移贴图、闪烁和最终画幅。',
|
|
847
|
+
'motion.fullCheck': '已逐帧核对预览中所选部件的求值网格。',
|
|
848
|
+
'motion.savedCheck': '确认保存时,将对重新编译的工程再逐帧检查,未通过则保留原版本。',
|
|
849
|
+
'motion.savedOutOfFrame': '保存前的逐帧检查发现所选部件出画,未保存新版本。可停止找回并重新选择,调整取景或幅度后再次预览。',
|
|
850
|
+
'motion.savedUnverifiable': '保存前无法逐帧核验所选部件,未保存新版本。可停止找回并重新选择,检查可见网格和取景后再次预览。',
|
|
851
|
+
'motion.local': '运动预览需要本机工作台和支持此功能的 Host。',
|
|
852
|
+
'motion.storage': '无法安全保存恢复信息;请启用浏览器存储后重试。',
|
|
853
|
+
'motion.uncertain': '未能确认保存结果;请使用同一候选重试,系统会查找已保存的版本。',
|
|
854
|
+
'motion.saved': '运动已保存到 {revision};请在渲染相机中选择 {camera}。',
|
|
855
|
+
'motion.failed': '未完成:{message}',
|
|
719
856
|
'jobs.provenanceUnknown': '帧来源未知',
|
|
720
857
|
'jobs.provenanceUnchecked': '{count} 帧未在本次状态读取中复核;交付时的记录见交付清单',
|
|
721
858
|
'jobs.provenanceMixed': '混合配置:{details}',
|
|
@@ -727,9 +864,23 @@ window.__ModuleLoader__.load({
|
|
|
727
864
|
'jobs.cancel': '取消',
|
|
728
865
|
'jobs.resume': '继续渲染',
|
|
729
866
|
'jobs.startDelivery': '启动交付渲染',
|
|
867
|
+
'jobs.noDeclaredMotion': '当前场景没有声明动画轨道。增加帧数不会自动产生运动;导入素材可能自带动画,请先预览并确认。',
|
|
730
868
|
'jobs.frameStart': '起始帧',
|
|
731
869
|
'jobs.frameEnd': '结束帧',
|
|
732
870
|
'jobs.profile': '渲染配置',
|
|
871
|
+
'jobs.stillPreset': '交付尺寸',
|
|
872
|
+
'jobs.stillProfileSize': '使用渲染配置尺寸',
|
|
873
|
+
'jobs.still2560': '正式静帧 2560×1440(单帧)',
|
|
874
|
+
'jobs.stillRange': '图片交付或 2560×1440 静帧规格需要起始帧与结束帧相同;引擎与采样沿用所选渲染配置,采样受预算限制。',
|
|
875
|
+
'jobs.stillUnsupported': '当前 Host 不支持此静帧规格,请更新后重试。',
|
|
876
|
+
'jobs.video1080': '视频 1920×1080',
|
|
877
|
+
'jobs.videoPresetHelp': '视频使用项目帧率 {fps} fps;1–144 帧在 24 fps 时为 6 秒。采样、引擎受所选配置及预算控制。',
|
|
878
|
+
'jobs.videoPresetInvalid': '1080p 视频尺寸只用于视频交付;请切换交付类型或选择其他尺寸。',
|
|
879
|
+
'jobs.videoPresetUnsupported': '当前 Host 不支持此视频规格,请更新后重试。',
|
|
880
|
+
'jobs.deliveryKind': '交付类型',
|
|
881
|
+
'jobs.deliveryVideo': '视频 MP4',
|
|
882
|
+
'jobs.deliveryStill': '图片 PNG(单帧,无需视频编码)',
|
|
883
|
+
'jobs.stillKindUnsupported': '当前 Host 不支持独立图片交付,请更新后重试。',
|
|
733
884
|
'jobs.start': '启动',
|
|
734
885
|
'qa.passed': '技术校验通过',
|
|
735
886
|
'qa.none': '无技术校验记录',
|
|
@@ -775,10 +926,13 @@ window.__ModuleLoader__.load({
|
|
|
775
926
|
"snapshot.title": "保存可编辑副本",
|
|
776
927
|
"snapshot.scope": "包含 Blender 工程、源文件与相关外部素材。",
|
|
777
928
|
"snapshot.details": "副本范围",
|
|
778
|
-
"snapshot.detailText": "
|
|
929
|
+
"snapshot.detailText": "仅包含选定的已保存版本。仅用于观察的外部参考图不另行附带;工程内嵌内容未另行检查。可附带同版本的已完成影片和图片。未保存的编辑不会进入副本。",
|
|
779
930
|
"snapshot.revision": "已保存版本",
|
|
780
931
|
"snapshot.video": "附带影片",
|
|
781
932
|
"snapshot.noVideo": "不附带影片",
|
|
933
|
+
"snapshot.images": "附带已完成图片(最多 16 张)",
|
|
934
|
+
"snapshot.noImages": "该版本没有可附带的图片任务。",
|
|
935
|
+
"snapshot.missingImage": "{jobId} 不再可用;取消勾选或刷新后重试。",
|
|
782
936
|
"snapshot.prepare": "准备下载",
|
|
783
937
|
"snapshot.preparing": "正在准备副本…",
|
|
784
938
|
"snapshot.checking": "正在检查已有副本…",
|
|
@@ -1014,9 +1168,17 @@ window.__ModuleLoader__.load({
|
|
|
1014
1168
|
"assets.reset": "Discard asset draft",
|
|
1015
1169
|
"assets.saved": "Asset applied in {revision}.",
|
|
1016
1170
|
"assets.model": "Place in scene (preserve materials)",
|
|
1171
|
+
'assets.hideExisting': 'Hide an existing object when importing (optional)',
|
|
1172
|
+
'assets.hideNone': 'Keep every object visible',
|
|
1173
|
+
'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.',
|
|
1174
|
+
'assets.makeSubject': 'Make the new model the creative subject',
|
|
1175
|
+
'assets.hideSubjectError': 'To hide the explicitly selected subject, first choose the new model as the creative subject.',
|
|
1017
1176
|
"assets.image": "Bind image material",
|
|
1018
1177
|
"assets.environment": "Use for environment lighting",
|
|
1019
|
-
"assets.dimensions": "
|
|
1178
|
+
"assets.dimensions": "Imported first-frame bounds (scene metres)",
|
|
1179
|
+
"assets.unitsObj": "OBJ does not record physical units. Compare with the real object; scale = real size ÷ the corresponding size above.",
|
|
1180
|
+
"assets.unitsGltf": "glTF uses metres by convention. Check the model against the real object; scale = real size ÷ the corresponding size above.",
|
|
1181
|
+
"assets.scaledDimensions": "Scaled first-frame bounds (metres, before this rotation)",
|
|
1020
1182
|
"assets.toneMapped": "This tone-mapped preview shows environment lighting; applying uses original HDR / EXR data.",
|
|
1021
1183
|
"assets.modelHelp": "Position refers to the source origin and scale is relative to the source. Preserve its materials, hierarchy and objects; keep the camera.",
|
|
1022
1184
|
"assets.entityId": "New object ID",
|
|
@@ -1088,6 +1250,21 @@ window.__ModuleLoader__.load({
|
|
|
1088
1250
|
'brief.review': "Review saved revision",
|
|
1089
1251
|
'brief.autofix': "Correct using references",
|
|
1090
1252
|
'brief.reviewCost': "Clicking renders 640 × 480 previews at 16 samples and calls the vision model. Corrections may create or restore revisions.",
|
|
1253
|
+
'reviewView.title': 'Review images',
|
|
1254
|
+
'reviewView.selected': 'Selected saved cameras',
|
|
1255
|
+
'reviewView.standard': 'Standard view group',
|
|
1256
|
+
'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.',
|
|
1257
|
+
'reviewView.standardHelp': 'Standard views choose cameras by role and do not automatically match delivered images.',
|
|
1258
|
+
'reviewView.fromImages': 'Use cameras from up to 4 recent completed images',
|
|
1259
|
+
'reviewView.add': 'Add camera',
|
|
1260
|
+
'reviewView.remove': 'Remove camera',
|
|
1261
|
+
'reviewView.invalid': 'Choose 1–4 distinct saved camera/frame pairs within the project range. Refresh if the saved source is unavailable.',
|
|
1262
|
+
'reviewView.stale': 'This selection belongs to an older revision. Reset it to the current saved revision before reviewing.',
|
|
1263
|
+
'reviewView.reset': 'Reset to current revision',
|
|
1264
|
+
'reviewView.noAutofix': 'Selected-camera review returns feedback only. Automatic correction uses standard views.',
|
|
1265
|
+
'reviewView.scope': 'Actual inspected images · {revision}',
|
|
1266
|
+
'reviewView.scopeItem': '{camera} · frame {frame} · {resolution} · {samples} samples',
|
|
1267
|
+
'reviewView.mismatch': 'The returned review image sources do not match this selection. Refresh and check again.',
|
|
1091
1268
|
'brief.iterations': "Maximum correction rounds",
|
|
1092
1269
|
'brief.reviewing': "Rendering and reviewing…",
|
|
1093
1270
|
'brief.fixing': "Running bounded corrections…",
|
|
@@ -1111,6 +1288,7 @@ window.__ModuleLoader__.load({
|
|
|
1111
1288
|
'fit.reset': 'Read current revision again',
|
|
1112
1289
|
'fit.cancel': 'Cancel save',
|
|
1113
1290
|
'fit.saved': 'Complete view saved: {revision} · frame {frame} · {count} parts. Review the preview.',
|
|
1291
|
+
'fit.savedOtherPreview': 'Complete view saved: {revision}. Its preview is not currently displayed. Check the image source; refresh if it has not updated.',
|
|
1114
1292
|
'fit.unconfirmed': 'The save is unconfirmed. Retry reuses this request and camera, including after a page refresh.',
|
|
1115
1293
|
'fit.stale': 'The current revision changed. Read it again before saving.',
|
|
1116
1294
|
'fit.failed': 'The complete view could not be saved. Check the details, adjust the parts, camera or margin, and retry.',
|
|
@@ -1161,6 +1339,23 @@ window.__ModuleLoader__.load({
|
|
|
1161
1339
|
"photo.restoreFailed": "Restore failed; the photography record is retained: {message}",
|
|
1162
1340
|
"photo.reuseUnavailable": "Complete photography settings are unavailable. Select the source again.",
|
|
1163
1341
|
"photo.reuseTitle": "Reuse photography from saved work",
|
|
1342
|
+
"photo.reuseMode": "Reuse coordinates",
|
|
1343
|
+
"photo.reuseAbsolute": "Original coordinates",
|
|
1344
|
+
"photo.reuseBounds": "Adapt to product bounds",
|
|
1345
|
+
"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.",
|
|
1346
|
+
"photo.boundsAll": "Select visible non-environment parts",
|
|
1347
|
+
"photo.boundsClear": "Clear selection",
|
|
1348
|
+
"photo.boundsUnavailable": "This Host does not support boundary adaptation. The draft was kept. Update the plugin or explicitly choose original coordinates.",
|
|
1349
|
+
"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.",
|
|
1350
|
+
"photo.boundsSource": "Source product parts ({count})",
|
|
1351
|
+
"photo.boundsDestination": "Destination product parts ({count})",
|
|
1352
|
+
"photo.boundsFrame": "Source inspection frame",
|
|
1353
|
+
"photo.boundsPlanning": "Reading native bounds from both saved works…",
|
|
1354
|
+
"photo.boundsCancel": "Cancel adaptation",
|
|
1355
|
+
"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.",
|
|
1356
|
+
"photo.boundsInvalid": "Select a valid inspection frame and complete source and destination product parts.",
|
|
1357
|
+
"photo.boundsMismatch": "The adaptation does not match these saved inputs. The photography draft was kept.",
|
|
1358
|
+
"photo.boundsChanged": "The selection or draft changed while inspecting. Current inputs were kept; adapt again.",
|
|
1164
1359
|
"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.",
|
|
1165
1360
|
"photo.reuseProject": "Source work",
|
|
1166
1361
|
"photo.reuseRevision": "Saved source version",
|
|
@@ -1261,6 +1456,24 @@ window.__ModuleLoader__.load({
|
|
|
1261
1456
|
'editor.uv.scale': 'Texture repetitions',
|
|
1262
1457
|
'editor.uv.scaleInvalid': 'Enter repetitions from 0.0001 to 10000.',
|
|
1263
1458
|
'editor.uv.scaleHelp': 'Repetitions across the longest local mesh extent. Only texture coordinates change; check the saved preview.',
|
|
1459
|
+
'editor.halfLap.title': 'Half lap',
|
|
1460
|
+
'editor.halfLap.partner': 'Join with',
|
|
1461
|
+
'editor.halfLap.none': 'No joint',
|
|
1462
|
+
'editor.halfLap.role': 'Selected timber group',
|
|
1463
|
+
'editor.halfLap.lower': 'Keep the lower half',
|
|
1464
|
+
'editor.halfLap.upper': 'Keep the upper half',
|
|
1465
|
+
'editor.halfLap.help': 'The groups must cross at right angles and share top and bottom heights.',
|
|
1466
|
+
'editor.halfLap.invalid': 'Half laps need static box meshes. Remove unsupported modifiers or set Join with to “No joint.”',
|
|
1467
|
+
'editor.halfLap.inspect': 'Preview recesses',
|
|
1468
|
+
'editor.halfLap.inspecting': 'Rendering recesses…',
|
|
1469
|
+
'editor.halfLap.inspectError': 'Could not render the recess preview. {message}',
|
|
1470
|
+
'editor.halfLap.partial': 'Two isolated faces of the same end lap. The draft is unsaved.',
|
|
1471
|
+
'editor.halfLap.full': 'Two isolated faces of the same joint. The draft is unsaved.',
|
|
1472
|
+
'editor.halfLap.count': 'Crossings: {count}. Partial-width crossings: {partial}.',
|
|
1473
|
+
'editor.halfLap.lowerPart': 'Lower half · {name}',
|
|
1474
|
+
'editor.halfLap.upperPart': 'Upper half · {name}',
|
|
1475
|
+
'editor.halfLap.lowerFace': 'Recess in the lower timber, seen from above',
|
|
1476
|
+
'editor.halfLap.upperFace': 'Recess in the upper timber, seen from below',
|
|
1264
1477
|
'editor.subdivision': 'Surface subdivision',
|
|
1265
1478
|
'editor.surfaceScatter': 'Closed surface placement',
|
|
1266
1479
|
'editor.scatterTargets': 'Support objects (comma separated)',
|
|
@@ -1413,6 +1626,7 @@ window.__ModuleLoader__.load({
|
|
|
1413
1626
|
'projects.recovered': 'Opened the previously created {id}; no duplicate creation or render',
|
|
1414
1627
|
'projects.replyMissing': 'The creation result could not be received. Your inputs are kept; retry the previous creation to check the same request.',
|
|
1415
1628
|
'projects.environmentFailed': 'Blender is not ready. Your inputs are kept; check its installation and path, then retry.',
|
|
1629
|
+
'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.',
|
|
1416
1630
|
'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.',
|
|
1417
1631
|
'projects.retryCreation': 'Retry previous creation',
|
|
1418
1632
|
'projects.originalTitle': 'Previous creation: {title}',
|
|
@@ -1478,6 +1692,83 @@ window.__ModuleLoader__.load({
|
|
|
1478
1692
|
'preview.identical': 'structurally identical',
|
|
1479
1693
|
'jobs.empty': 'No render jobs yet.',
|
|
1480
1694
|
'jobs.deliveryVerified': 'delivery verified',
|
|
1695
|
+
'jobs.downloadVideo': 'Download MP4 · revision {revision}',
|
|
1696
|
+
'jobs.downloadFrame': 'Download PNG · revision {revision} · frame {frame}',
|
|
1697
|
+
'jobs.camera': 'Render camera',
|
|
1698
|
+
'jobs.cameraDefault': 'Scene default camera',
|
|
1699
|
+
'jobs.cameraMissing': 'The selected camera is not in this revision. Choose a camera again.',
|
|
1700
|
+
'motion.title': 'Create a camera push',
|
|
1701
|
+
'readiness.imageTitle': 'Model image-input check',
|
|
1702
|
+
'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.',
|
|
1703
|
+
'readiness.imageRun': 'Check model image input',
|
|
1704
|
+
'readiness.imageRunning': 'Checking…',
|
|
1705
|
+
'readiness.imagePass': 'The test image was identified correctly. This does not review artwork or guarantee recognition of every image.',
|
|
1706
|
+
'readiness.imageAuth': 'Model authentication failed. Check the current service credentials in DSH, then retry.',
|
|
1707
|
+
'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.',
|
|
1708
|
+
'readiness.imageUnsupported': 'The configured review model does not declare image input. Check its DSH configuration.',
|
|
1709
|
+
'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.',
|
|
1710
|
+
'readiness.imageRoute': 'The configured review model or service is unavailable. Check DSH configuration and service status.',
|
|
1711
|
+
'readiness.imageRate': 'The model service is rate limited. Try again later.',
|
|
1712
|
+
'readiness.imageTimeout': 'The check timed out or was cancelled; image input is not verified.',
|
|
1713
|
+
'readiness.imageBusy': 'The previous check has not finished. Try again later; restart DSH if it remains stuck.',
|
|
1714
|
+
'readiness.imageInconclusive': 'This check could not confirm the test image was recognized. Check the model service and try again.',
|
|
1715
|
+
'readiness.imageLocal': 'Run the check in the local workbench; older Hosts need a restart or update.',
|
|
1716
|
+
'storage.low': 'The project disk reported {space} available, below 2 GiB; a multi-frame render may stop. Free space and refresh.',
|
|
1717
|
+
'storage.observed': 'The project disk reported {space} available. Rendering may need more.',
|
|
1718
|
+
'storage.unknown': 'Project disk space could not be measured. Check the project disk before rendering.',
|
|
1719
|
+
'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.',
|
|
1720
|
+
'aspect.title': 'Prepare a 16:9 delivery frame',
|
|
1721
|
+
'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.',
|
|
1722
|
+
'aspect.change': '{profile}: {before} → {after}',
|
|
1723
|
+
'aspect.apply': 'Save 16:9 frame',
|
|
1724
|
+
'aspect.done': 'Preview and final profiles are already 16:9. Inspect the framing and video.',
|
|
1725
|
+
'aspect.unavailable': 'A safe 16:9 size cannot be calculated, or the Host needs an update; check the project configuration.',
|
|
1726
|
+
'aspect.pending': 'Save or discard other drafts and save or reset the motion draft first.',
|
|
1727
|
+
'aspect.saved': 'Saved a new frame version; refit and inspect the result.',
|
|
1728
|
+
'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.',
|
|
1729
|
+
'aspect.outputUnknown': 'The project preview and final frame shapes could not be verified. Check the actual 16:9 composition first.',
|
|
1730
|
+
'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.',
|
|
1731
|
+
'motion.camera': 'Starting camera',
|
|
1732
|
+
'motion.cameraAnimated': 'This camera already has animation. Choose a static camera, or create one with Complete view first.',
|
|
1733
|
+
'motion.cameraTargeted': 'This camera tracks an object. Create a static camera with Complete view first.',
|
|
1734
|
+
'motion.cameraAnimatedOption': '{camera} (animated)',
|
|
1735
|
+
'motion.cameraTargetedOption': '{camera} (tracks an object)',
|
|
1736
|
+
'motion.subject': 'Product parts to check',
|
|
1737
|
+
'motion.wholeLamp': 'Select complete lamp',
|
|
1738
|
+
'motion.tagged': 'Select visible parts marked as product',
|
|
1739
|
+
'motion.taggedHint': 'Check the visible product is complete; tags do not guarantee completeness and hidden parts are not inspected.',
|
|
1740
|
+
'motion.hidden': ' (hidden, not checked for framing)',
|
|
1741
|
+
'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.',
|
|
1742
|
+
'motion.duration': 'Duration (seconds)',
|
|
1743
|
+
'motion.amount': 'Move amount (%)',
|
|
1744
|
+
'motion.direction': 'Direction',
|
|
1745
|
+
'motion.forward': 'Push forward',
|
|
1746
|
+
'motion.backward': 'Pull back',
|
|
1747
|
+
'motion.extend': 'Allow extending the project timeline if needed; review existing animation',
|
|
1748
|
+
'motion.preview': 'Generate motion preview',
|
|
1749
|
+
'motion.generating': 'Generating preview…',
|
|
1750
|
+
'motion.cancel': 'Cancel preview',
|
|
1751
|
+
'motion.save': 'Accept and save motion',
|
|
1752
|
+
'motion.retry': 'Retry and recover saved result',
|
|
1753
|
+
'motion.abandon': 'Stop recovery and choose again',
|
|
1754
|
+
'motion.abandonHelp': 'If recovery is unavailable, you can stop trying and choose again. Check revision history first: the earlier save may still complete.',
|
|
1755
|
+
'motion.saving': 'Saving…',
|
|
1756
|
+
'motion.discard': 'Discard candidate',
|
|
1757
|
+
'motion.reset': 'Choose again',
|
|
1758
|
+
'motion.stale': 'The saved work changed. Choose again and generate a new preview.',
|
|
1759
|
+
'motion.invalid': 'Choose a static camera and at least one complete part; check duration and amount.',
|
|
1760
|
+
'motion.outOfFrame': 'Selected parts leave the frame. Reduce the move, pull back, or adjust the static view and retry; no revision was saved.',
|
|
1761
|
+
'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.',
|
|
1762
|
+
'motion.limit': 'This is a low-sample preview. Watch the full video and inspect occlusion, displacement, flicker and delivery framing.',
|
|
1763
|
+
'motion.fullCheck': 'Selected evaluated meshes were checked throughout the preview.',
|
|
1764
|
+
'motion.savedCheck': 'Saving checks every frame of the recompiled project; the original revision is kept if it fails.',
|
|
1765
|
+
'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.',
|
|
1766
|
+
'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.',
|
|
1767
|
+
'motion.local': 'Motion preview requires a local workbench and a compatible Host.',
|
|
1768
|
+
'motion.storage': 'Recovery information could not be stored safely. Enable browser storage and retry.',
|
|
1769
|
+
'motion.uncertain': 'Save could not be confirmed. Retry the same candidate to recover any saved version.',
|
|
1770
|
+
'motion.saved': 'Motion saved to {revision}; choose {camera} as the render camera.',
|
|
1771
|
+
'motion.failed': 'Not completed: {message}',
|
|
1481
1772
|
'jobs.provenanceUnknown': 'Frame provenance unknown',
|
|
1482
1773
|
'jobs.provenanceUnchecked': '{count} frames not rechecked in this status read; see the delivery manifest for publication-time evidence',
|
|
1483
1774
|
'jobs.provenanceMixed': 'Mixed configurations: {details}',
|
|
@@ -1489,9 +1780,23 @@ window.__ModuleLoader__.load({
|
|
|
1489
1780
|
'jobs.cancel': 'Cancel',
|
|
1490
1781
|
'jobs.resume': 'Resume render',
|
|
1491
1782
|
'jobs.startDelivery': 'Start a delivery render',
|
|
1783
|
+
'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.',
|
|
1492
1784
|
'jobs.frameStart': 'from frame',
|
|
1493
1785
|
'jobs.frameEnd': 'to frame',
|
|
1494
1786
|
'jobs.profile': 'Render profile',
|
|
1787
|
+
'jobs.stillPreset': 'Delivery size',
|
|
1788
|
+
'jobs.stillProfileSize': 'Use render profile size',
|
|
1789
|
+
'jobs.still2560': 'Delivery still 2560×1440 (one frame)',
|
|
1790
|
+
'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.',
|
|
1791
|
+
'jobs.stillUnsupported': 'This Host does not support the still preset. Update it and retry.',
|
|
1792
|
+
'jobs.video1080': 'Video 1920×1080',
|
|
1793
|
+
'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.',
|
|
1794
|
+
'jobs.videoPresetInvalid': 'The 1080p video size requires video delivery. Change the delivery type or size.',
|
|
1795
|
+
'jobs.videoPresetUnsupported': 'This Host does not support the video size preset. Update it and retry.',
|
|
1796
|
+
'jobs.deliveryKind': 'Delivery type',
|
|
1797
|
+
'jobs.deliveryVideo': 'Video MP4',
|
|
1798
|
+
'jobs.deliveryStill': 'Image PNG (single frame; no video encoding)',
|
|
1799
|
+
'jobs.stillKindUnsupported': 'This Host does not support image delivery. Update it and retry.',
|
|
1495
1800
|
'jobs.start': 'Start',
|
|
1496
1801
|
'qa.passed': 'technical checks passed',
|
|
1497
1802
|
'qa.none': 'no technical check recorded',
|
|
@@ -1537,10 +1842,13 @@ window.__ModuleLoader__.load({
|
|
|
1537
1842
|
"snapshot.title": "Save an editable copy",
|
|
1538
1843
|
"snapshot.scope": "Includes the Blender project, source files and relevant external assets.",
|
|
1539
1844
|
"snapshot.details": "What the copy includes",
|
|
1540
|
-
"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
|
|
1845
|
+
"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.",
|
|
1541
1846
|
"snapshot.revision": "Saved version",
|
|
1542
1847
|
"snapshot.video": "Include a video",
|
|
1543
1848
|
"snapshot.noVideo": "No video",
|
|
1849
|
+
"snapshot.images": "Include completed images (up to 16)",
|
|
1850
|
+
"snapshot.noImages": "No completed image jobs for this revision.",
|
|
1851
|
+
"snapshot.missingImage": "{jobId} is no longer available; deselect it or refresh and retry.",
|
|
1544
1852
|
"snapshot.prepare": "Prepare download",
|
|
1545
1853
|
"snapshot.preparing": "Preparing the copy…",
|
|
1546
1854
|
"snapshot.checking": "Checking the existing copy…",
|
|
@@ -1750,6 +2058,7 @@ window.__ModuleLoader__.load({
|
|
|
1750
2058
|
// the header, so the BROWSER makes the request and writes the file. `contract/diagnostics.test.mjs`
|
|
1751
2059
|
// holds these four paths to the route table the Host actually matches.
|
|
1752
2060
|
diagnostics: '/deepblend/diagnostics',
|
|
2061
|
+
imageInputProbe: '/deepblend/readiness/image-input',
|
|
1753
2062
|
}
|
|
1754
2063
|
|
|
1755
2064
|
/** Route for one project's own surfaces. */
|
|
@@ -1887,9 +2196,12 @@ window.__ModuleLoader__.load({
|
|
|
1887
2196
|
return { entries, available: true }
|
|
1888
2197
|
} catch { return { entries: [], available: false } }
|
|
1889
2198
|
}
|
|
2199
|
+
const creationEnvironmentError = code => ['BLENDER_NOT_FOUND', 'RUNTIME_UNAVAILABLE', 'BLENDER_RUNTIME_UNAVAILABLE',
|
|
2200
|
+
'BLENDER_EXECUTABLE_NOT_EXECUTABLE', 'BLENDER_EXECUTABLE_OUTSIDE_ALLOWLIST'].includes(code)
|
|
1890
2201
|
function creationErrorMessage(code) {
|
|
1891
2202
|
if (code === 'UI_FETCH_FAILED' || /^HTTP_/.test(code)) return t('projects.replyMissing')
|
|
1892
|
-
if (code === '
|
|
2203
|
+
if (code === 'BLENDER_EXECUTABLE_OUTSIDE_ALLOWLIST') return t('projects.environmentAllowlist')
|
|
2204
|
+
if (creationEnvironmentError(code)) return t('projects.environmentFailed')
|
|
1893
2205
|
if (code === 'CREATION_REQUEST_CONFLICT') return t('projects.creationConflict')
|
|
1894
2206
|
if (code === 'UI_HOST_API_STALE') return t('projects.hostNeedsRestart')
|
|
1895
2207
|
return t('projects.creationFailed')
|
|
@@ -2454,6 +2766,29 @@ window.__ModuleLoader__.load({
|
|
|
2454
2766
|
&& (track.property === property || (property === 'baseColor' && track.property?.startsWith('baseColor.'))))
|
|
2455
2767
|
}
|
|
2456
2768
|
|
|
2769
|
+
function editorHalfLapPartner(pair, entityId) {
|
|
2770
|
+
if (pair?.lowerEntityId === entityId) return pair.upperEntityId
|
|
2771
|
+
if (pair?.upperEntityId === entityId) return pair.lowerEntityId
|
|
2772
|
+
return ''
|
|
2773
|
+
}
|
|
2774
|
+
|
|
2775
|
+
function editorTimberCandidate(entity, tracks) {
|
|
2776
|
+
const mesh = entity?.generator
|
|
2777
|
+
return entity?.kind === 'generator' && mesh?.shape === 'mesh' && mesh.vertices?.length === 8 && mesh.faces?.length === 6
|
|
2778
|
+
&& !(entity.modifiers || []).some(modifier => !['array', 'mirror'].includes(modifier.type))
|
|
2779
|
+
&& !(entity.transform?.scale || []).some(value => value <= 0)
|
|
2780
|
+
&& !tracks.some(track => track.targetKind === 'entity' && track.targetId === entity.id
|
|
2781
|
+
&& ['location', 'rotationEuler', 'scale'].includes(track.property?.split('.')[0]))
|
|
2782
|
+
}
|
|
2783
|
+
|
|
2784
|
+
function editorHalfLapPartners(draft) {
|
|
2785
|
+
const saved = editorHalfLapPartner(draft.originalHalfLap, draft.entityId)
|
|
2786
|
+
const canJoin = editorTimberCandidate(draft.entity, draft.tracks) && (saved || (draft.halfLaps?.length ?? 0) < 32)
|
|
2787
|
+
const used = new Set((draft.halfLaps || []).flatMap(pair => [pair.lowerEntityId, pair.upperEntityId]))
|
|
2788
|
+
return draft.entities.filter(entity => entity.id === saved || (canJoin && entity.id !== draft.entityId
|
|
2789
|
+
&& !used.has(entity.id) && editorTimberCandidate(entity, draft.tracks)))
|
|
2790
|
+
}
|
|
2791
|
+
|
|
2457
2792
|
function createEditorDraft(scene, projectId, entityId) {
|
|
2458
2793
|
const entity = scene.nodes.entities.find(item => item.id === entityId)
|
|
2459
2794
|
if (!entity) return null
|
|
@@ -2462,11 +2797,14 @@ window.__ModuleLoader__.load({
|
|
|
2462
2797
|
original.modifiers ||= []
|
|
2463
2798
|
original.materialBindings ||= []
|
|
2464
2799
|
const material = scene.nodes.materials.find(item => item.id === entity.materialId)
|
|
2800
|
+
const halfLaps = editorClone(scene.halfLaps || [])
|
|
2801
|
+
const originalHalfLap = halfLaps.find(pair => editorHalfLapPartner(pair, entityId)) || null
|
|
2465
2802
|
let cloneId
|
|
2466
2803
|
do { cloneId = `ui-material-${Date.now().toString(36)}-${++editorSequence}` }
|
|
2467
2804
|
while (scene.nodes.materials.some(item => item.id === cloneId))
|
|
2468
2805
|
return { projectId, entityId, baseRevision: scene.revision, original, entity: editorClone(original),
|
|
2469
2806
|
uvProjection: null,
|
|
2807
|
+
halfLaps, originalHalfLap, halfLap: editorClone(originalHalfLap),
|
|
2470
2808
|
materials: editorClone(scene.nodes.materials), entities: editorClone(scene.nodes.entities),
|
|
2471
2809
|
tracks: editorClone(scene.nodes.animationTracks || []), cloneId,
|
|
2472
2810
|
material: { id: material?.id || '', definition: editorClone(material?.definition || null),
|
|
@@ -2528,6 +2866,12 @@ window.__ModuleLoader__.load({
|
|
|
2528
2866
|
scalar(draft.uvProjection.quarterTurns, t('editor.uv.direction'), 0, 3, true)
|
|
2529
2867
|
scalar(draft.uvProjection.scale, t('editor.uv.scale'), 0.0001, 10000)
|
|
2530
2868
|
}
|
|
2869
|
+
if (draft.halfLap) {
|
|
2870
|
+
const partner = editorHalfLapPartner(draft.halfLap, draft.entityId)
|
|
2871
|
+
if (!editorTimberCandidate(draft.entity, draft.tracks) || !editorHalfLapPartners(draft).some(entity => entity.id === partner)) {
|
|
2872
|
+
errors.push(t('editor.halfLap.invalid'))
|
|
2873
|
+
}
|
|
2874
|
+
}
|
|
2531
2875
|
if (generator) {
|
|
2532
2876
|
if (generator.dimensions !== undefined) {
|
|
2533
2877
|
if (!['cube', 'rounded_box'].includes(generator.shape) || generator.size !== undefined
|
|
@@ -2653,6 +2997,13 @@ window.__ModuleLoader__.load({
|
|
|
2653
2997
|
if (!editorEqual(entity.generator, original.generator)) operations.push({ op: 'entity.generator.set', entityId: draft.entityId, generator: editorClone(entity.generator) })
|
|
2654
2998
|
if (draft.uvProjection != null) operations.push({ op: 'entity.uv.project', entityId: draft.entityId, ...editorClone(draft.uvProjection) })
|
|
2655
2999
|
if (!editorEqual(entity.modifiers, original.modifiers)) operations.push({ op: 'entity.modifiers.set', entityId: draft.entityId, modifiers: editorClone(entity.modifiers) })
|
|
3000
|
+
const { halfLap, originalHalfLap } = draft
|
|
3001
|
+
if (halfLap?.lowerEntityId !== originalHalfLap?.lowerEntityId || halfLap?.upperEntityId !== originalHalfLap?.upperEntityId) {
|
|
3002
|
+
if (originalHalfLap && editorHalfLapPartner(originalHalfLap, draft.entityId) !== editorHalfLapPartner(halfLap, draft.entityId)) {
|
|
3003
|
+
operations.push({ op: 'joint.halfLap.set', ...originalHalfLap, enabled: false })
|
|
3004
|
+
}
|
|
3005
|
+
if (halfLap) operations.push({ op: 'joint.halfLap.set', ...halfLap })
|
|
3006
|
+
}
|
|
2656
3007
|
const material = draft.material.definition, baseMaterial = editorMaterialOriginal(draft)
|
|
2657
3008
|
const changedProperties = material && baseMaterial ? ['baseColor', 'roughness'].filter(key => !editorEqual(material.parameters?.[key], baseMaterial.parameters?.[key])) : []
|
|
2658
3009
|
const textureChanged = material && baseMaterial && !editorEqual(material.texture, baseMaterial.texture)
|
|
@@ -2688,6 +3039,29 @@ window.__ModuleLoader__.load({
|
|
|
2688
3039
|
return state.editorDrafts?.[editorKey(state.activeProjectId, state.editorEntityId)] || null
|
|
2689
3040
|
}
|
|
2690
3041
|
|
|
3042
|
+
function halfLapPreviewIntent(state, draft = editorDraftFor(state), patch) {
|
|
3043
|
+
const scene = state.selected?.scene
|
|
3044
|
+
if (!state.halfLapPreviewSupported || state.view !== 'scene' || !draft?.halfLap || !scene || draft.baseRevision !== scene.revision
|
|
3045
|
+
|| !/^[a-f0-9]{64}$/.test(scene.digest ?? '') || !/^[a-f0-9]{64}$/.test(state.storeIdentity ?? '')) return null
|
|
3046
|
+
try { patch ??= buildEditorPatch(draft) } catch { return null }
|
|
3047
|
+
const change = patch.operations.find(operation => operation.op === 'joint.halfLap.set' && operation.enabled !== false)
|
|
3048
|
+
if (!change) return null
|
|
3049
|
+
const key = JSON.stringify([state.storeIdentity, scene.digest, draft.entityId, patch])
|
|
3050
|
+
return { key, patch, expectedDigest: scene.digest, expectedStoreIdentity: state.storeIdentity, joint: draft.halfLap }
|
|
3051
|
+
}
|
|
3052
|
+
|
|
3053
|
+
function verifiedHalfLapPreview(preview, intent) {
|
|
3054
|
+
const isImage = image => image?.width === 480 && image.height === 320 && /^[a-f0-9]{64}$/.test(image.sha256 ?? '')
|
|
3055
|
+
&& typeof image.pngBase64 === 'string' && image.pngBase64.length <= 699052 && /^iVBORw0KGgo[A-Za-z0-9+/]+=*$/.test(image.pngBase64)
|
|
3056
|
+
return preview?.schemaVersion === 'deepblend.half-lap-inspection/v1' && preview.projectId === intent.patch.projectId
|
|
3057
|
+
&& preview.baseRevision === intent.patch.baseRevision && preview.baseDigest === intent.expectedDigest
|
|
3058
|
+
&& preview.storeIdentity === intent.expectedStoreIdentity && /^[a-f0-9]{64}$/.test(preview.candidateSpecHash ?? '')
|
|
3059
|
+
&& preview.joint?.lowerEntityId === intent.joint.lowerEntityId && preview.joint?.upperEntityId === intent.joint.upperEntityId
|
|
3060
|
+
&& Number.isSafeInteger(preview.crossings) && preview.crossings > 0 && Number.isSafeInteger(preview.partialCrossings)
|
|
3061
|
+
&& preview.partialCrossings >= 0 && preview.partialCrossings <= preview.crossings
|
|
3062
|
+
&& preview.sample === (preview.partialCrossings ? 'partial' : 'full') && isImage(preview.lower) && isImage(preview.upper)
|
|
3063
|
+
}
|
|
3064
|
+
|
|
2691
3065
|
function createPhotographyDraft(scene, projectId, previous = {}, projectsRoot = null) {
|
|
2692
3066
|
const cameras = (scene.nodes.cameras || []).map(item => editorClone(item.definition)).filter(Boolean)
|
|
2693
3067
|
const lights = (scene.nodes.lights || []).map(item => editorClone(item.definition)).filter(Boolean)
|
|
@@ -2719,6 +3093,7 @@ window.__ModuleLoader__.load({
|
|
|
2719
3093
|
}
|
|
2720
3094
|
if (kind === 'camera') {
|
|
2721
3095
|
if (!number(editorNumberDefault(item.lens, 50), 0, false)) bad(`${item.id}.lens`)
|
|
3096
|
+
if (!editorEqual(item.focusDistance, original?.focusDistance) && !number(item.focusDistance, 0, false)) bad(`${item.id}.focusDistance`)
|
|
2722
3097
|
if (item.targetEntityId !== undefined && !draft.entities.some(entity => entity.id === item.targetEntityId)) bad(`${item.id}.targetEntityId`)
|
|
2723
3098
|
if (item.targetPoint !== undefined && !vector(item.targetPoint)) bad(`${item.id}.targetPoint`)
|
|
2724
3099
|
if (item.targetEntityId !== undefined && item.targetPoint !== undefined) bad(`${item.id}.target`)
|
|
@@ -2743,7 +3118,7 @@ window.__ModuleLoader__.load({
|
|
|
2743
3118
|
if (errors.length) throw new Error(t('photo.invalid', { fields: errors.join(', ') }))
|
|
2744
3119
|
const operations = []
|
|
2745
3120
|
const replaceLights = draft.reusedLights && !photographySameLights(draft.lights, draft.original.lights)
|
|
2746
|
-
for (const [kind, items, fields] of [['camera', draft.cameras, ['lens', 'targetEntityId', 'targetPoint']], ['light', draft.lights, ['energy', 'color', 'size']]]) {
|
|
3121
|
+
for (const [kind, items, fields] of [['camera', draft.cameras, ['lens', 'targetEntityId', 'targetPoint', 'focusDistance']], ['light', draft.lights, ['energy', 'color', 'size']]]) {
|
|
2747
3122
|
if (kind === 'light' && replaceLights) {
|
|
2748
3123
|
for (const light of draft.original.lights) operations.push({ op: 'light.remove', lightId: light.id })
|
|
2749
3124
|
for (const light of items) operations.push({ op: 'light.add', light: editorClone(light) })
|
|
@@ -2761,7 +3136,8 @@ window.__ModuleLoader__.load({
|
|
|
2761
3136
|
if (Object.keys(changes).length) operations.push({ op: `${kind}.update`, [`${kind}Id`]: item.id, ...changes })
|
|
2762
3137
|
}
|
|
2763
3138
|
}
|
|
2764
|
-
const note = draft.reuseSource ? t('photo.reuseNote', draft.reuseSource)
|
|
3139
|
+
const note = draft.reuseSource ? t('photo.reuseNote', draft.reuseSource)
|
|
3140
|
+
+ (draft.reuseSource.normalization ? `\n${JSON.stringify(draft.reuseSource.normalization)}` : '') : null
|
|
2765
3141
|
return { projectId: draft.projectId, baseRevision: draft.baseRevision, actor: 'ui', saveCheckpoint: true, renderPreview: false, operations, ...(note ? { note } : {}) }
|
|
2766
3142
|
}
|
|
2767
3143
|
function photographyDirty(draft) {
|
|
@@ -2791,11 +3167,63 @@ window.__ModuleLoader__.load({
|
|
|
2791
3167
|
if (next.lights.some(item => !item)) throw new Error(t('photo.reuseUnavailable'))
|
|
2792
3168
|
next.lightId = next.lights.some(item => item.id === next.lightId) ? next.lightId : next.lights[0]?.id || ''
|
|
2793
3169
|
next.reusedLights = true
|
|
3170
|
+
delete next.boundaryReuse
|
|
2794
3171
|
next.reuseSource = { project: source.project.id, revision: source.revision, digest: source.digest, camera: cameraId, target: targetEntityId || '—' }
|
|
2795
3172
|
const errors = photographyErrors(next)
|
|
2796
3173
|
if (errors.length) throw new Error(t('photo.invalid', { fields: errors.join(', ') }))
|
|
2797
3174
|
return next
|
|
2798
3175
|
}
|
|
3176
|
+
const photographyProductEntities = scene => (scene?.nodes?.entities || []).filter(e => ['generator', 'asset-instance'].includes(e.kind) && e.visible !== false)
|
|
3177
|
+
function photographyProductDefaults(scene, complete) {
|
|
3178
|
+
const choices = photographyProductEntities(scene), ids = choices.map(e => e.id)
|
|
3179
|
+
if (complete?.length && complete.length <= 128 && complete.every(id => ids.includes(id))) return [...complete].sort()
|
|
3180
|
+
const tagged = choices.filter(e => e.tags?.some(tag => ['hero-product', 'subject', 'subject-part'].includes(tag))).map(e => e.id)
|
|
3181
|
+
if (tagged.length && tagged.length <= 128) return tagged.sort()
|
|
3182
|
+
return choices.length === 1 ? [choices[0].id] : []
|
|
3183
|
+
}
|
|
3184
|
+
function photographyBoundaryRequest(state, selection, draft) {
|
|
3185
|
+
const source = selection?.source, scene = state.selected?.scene
|
|
3186
|
+
const valid = (values, nodes) => Array.isArray(values) && values.length >= 1 && values.length <= 128
|
|
3187
|
+
&& new Set(values).size === values.length && values.every(id => photographyProductEntities(nodes).some(e => e.id === id))
|
|
3188
|
+
if (!state.photographyBoundaryReuseSupported || !draft || selection?.mode !== 'bounds'
|
|
3189
|
+
|| !/^[a-f0-9]{64}$/.test(state.storeIdentity || '') || selection.storeIdentity !== state.storeIdentity || !/^[a-f0-9]{64}$/.test(scene?.digest || '')
|
|
3190
|
+
|| !/^[a-f0-9]{64}$/.test(source?.digest || '') || source.project?.id !== selection.sourceProjectId
|
|
3191
|
+
|| source.revision !== selection.revision || draft.baseRevision !== scene.revision
|
|
3192
|
+
|| !source.nodes.cameras.some(c => c.id === selection.cameraId) || !draft.cameras.some(c => c.id === draft.cameraId)
|
|
3193
|
+
|| !valid(selection.sourceEntityIds, source) || !valid(selection.destinationEntityIds, scene)
|
|
3194
|
+
|| !Number.isSafeInteger(selection.sourceFrame) || selection.sourceFrame < source.project.frameStart || selection.sourceFrame > source.project.frameEnd
|
|
3195
|
+
|| !Number.isSafeInteger(draft.frame) || draft.frame < draft.frameStart || draft.frame > draft.frameEnd) return null
|
|
3196
|
+
return { projectId: draft.projectId, baseRevision: draft.baseRevision, expectedDigest: scene.digest, expectedStoreIdentity: state.storeIdentity,
|
|
3197
|
+
cameraId: draft.cameraId, frame: draft.frame, entityIds: [...selection.destinationEntityIds].sort(),
|
|
3198
|
+
source: { projectId: source.project.id, revision: source.revision, digest: source.digest, cameraId: selection.cameraId,
|
|
3199
|
+
frame: selection.sourceFrame, entityIds: [...selection.sourceEntityIds].sort() } }
|
|
3200
|
+
}
|
|
3201
|
+
function applyBoundaryPhotography(draft, source, plan, request) {
|
|
3202
|
+
if (!plan || plan.schemaVersion !== 'deepblend.photography-reuse/v1' || creationSignature(plan.request) !== creationSignature(request)
|
|
3203
|
+
|| plan.camera?.id !== draft.cameraId || !Number.isFinite(plan.scale) || plan.scale < .001 || plan.scale > 1000
|
|
3204
|
+
|| plan.provenance?.mode !== 'product-bounds-v1' || plan.provenance.sourceDigest !== request.source.digest
|
|
3205
|
+
|| plan.provenance.destinationDigest !== request.expectedDigest || plan.provenance.scale !== plan.scale
|
|
3206
|
+
|| plan.provenance.sourceProject !== request.source.projectId || plan.provenance.sourceRevision !== request.source.revision
|
|
3207
|
+
|| plan.provenance.sourceCamera !== request.source.cameraId || plan.provenance.sourceFrame !== request.source.frame
|
|
3208
|
+
|| plan.provenance.destinationFrame !== request.frame || plan.provenance.storeIdentity !== request.expectedStoreIdentity || !Array.isArray(plan.lights)
|
|
3209
|
+
|| creationSignature(plan.lights.map(l => l.id).sort()) !== creationSignature(source.nodes.lights.map(l => l.id).sort())) throw new Error(t('photo.boundsMismatch'))
|
|
3210
|
+
const next = editorClone(draft), camera = next.cameras.find(c => c.id === next.cameraId)
|
|
3211
|
+
camera.lens = plan.camera.lens
|
|
3212
|
+
camera.transform ||= {}
|
|
3213
|
+
camera.transform.location = editorClone(plan.camera.transform?.location)
|
|
3214
|
+
camera.transform.rotationEuler = editorClone(plan.camera.transform?.rotationEuler)
|
|
3215
|
+
if (camera.fStop !== undefined) camera.focusDistance = plan.camera.focusDistance
|
|
3216
|
+
delete camera.targetEntityId; delete camera.targetPoint
|
|
3217
|
+
next.lights = editorClone(plan.lights); next.reusedLights = true
|
|
3218
|
+
next.lightId = next.lights.some(l => l.id === next.lightId) ? next.lightId : next.lights[0]?.id || ''
|
|
3219
|
+
next.reuseSource = { project: request.source.projectId, revision: request.source.revision, digest: request.source.digest,
|
|
3220
|
+
camera: request.source.cameraId, target: '—', normalization: editorClone(plan.provenance) }
|
|
3221
|
+
next.boundaryReuse = { scale: plan.scale, sourceFrame: request.source.frame, sourceCameraStatic: plan.sourceStaticCamera,
|
|
3222
|
+
sourceCount: request.source.entityIds.length, destinationCount: request.entityIds.length }
|
|
3223
|
+
const errors = photographyErrors(next)
|
|
3224
|
+
if (errors.length) throw new Error(t('photo.invalid', { fields: errors.join(', ') }))
|
|
3225
|
+
return next
|
|
3226
|
+
}
|
|
2799
3227
|
function inspectionReceiptValid(receipt, request, digest) {
|
|
2800
3228
|
const artifacts = receipt?.artifacts, view = request.views[0]
|
|
2801
3229
|
return Boolean(receipt?.revision === request.revision && receipt?.sourceRevision === request.revision && receipt?.mode === request.mode
|
|
@@ -2869,7 +3297,7 @@ window.__ModuleLoader__.load({
|
|
|
2869
3297
|
const id = `ui-asset-${Date.now().toString(36)}-${++editorSequence}`
|
|
2870
3298
|
const draft = { projectId, baseRevision: scene.revision, scene: editorClone(scene), entry: editorClone(entry),
|
|
2871
3299
|
inspection: editorClone(inspection), kind: assetKind(entry.asset), newEntityId: id, newMaterialId: `${id}-material`,
|
|
2872
|
-
location: [0, 0, 0], rotationEuler: [0, 0, 0], scale: 1,
|
|
3300
|
+
location: [0, 0, 0], rotationEuler: [0, 0, 0], scale: 1, hideEntityId: '', makeSubject: false,
|
|
2873
3301
|
entityId: entityId || scene.nodes.entities.find(item => item.kind !== 'empty')?.id || '',
|
|
2874
3302
|
target: 'entity', partId: '', slotIndex: '', scope: 'local', newMaterial: false,
|
|
2875
3303
|
channel: 'baseColor', binding: {}, replaceTexture: false,
|
|
@@ -2900,6 +3328,14 @@ window.__ModuleLoader__.load({
|
|
|
2900
3328
|
if (!Number.isFinite(draft.scale) || draft.scale <= 0) fail('scale')
|
|
2901
3329
|
operations.push({ op: 'entity.add', entity: { id: draft.newEntityId, type: 'asset-instance', assetId: asset.id,
|
|
2902
3330
|
transform: { location: [...draft.location], rotationEuler: [...draft.rotationEuler], scale: [draft.scale, draft.scale, draft.scale] } } })
|
|
3331
|
+
if (typeof draft.hideEntityId !== 'string' || typeof draft.makeSubject !== 'boolean') fail('model options')
|
|
3332
|
+
if (draft.hideEntityId) {
|
|
3333
|
+
const hidden = draft.scene.nodes.entities.find(entity => entity.id === draft.hideEntityId)
|
|
3334
|
+
if (!hidden || hidden.visible === false || hidden.locked || hidden.kind === 'empty') fail('existing object')
|
|
3335
|
+
if (draft.scene.project.reviewSubjectId === hidden.id && !draft.makeSubject) throw new Error(t('assets.hideSubjectError'))
|
|
3336
|
+
operations.push({ op: 'entity.visibility.set', entityId: hidden.id, visible: false })
|
|
3337
|
+
}
|
|
3338
|
+
if (draft.makeSubject) operations.push({ op: 'project.reviewSubject.set', entityId: draft.newEntityId })
|
|
2903
3339
|
} else if (draft.kind === 'environment') {
|
|
2904
3340
|
if (!Number.isFinite(draft.strength) || draft.strength < 0 || draft.strength > 1000 || !Number.isFinite(draft.rotation)) fail('environment')
|
|
2905
3341
|
operations.push({ op: 'world.set', world: { ...editorClone(draft.world), strength: draft.strength,
|
|
@@ -2963,6 +3399,39 @@ window.__ModuleLoader__.load({
|
|
|
2963
3399
|
&& Number.isInteger(form.samples) && form.samples >= 1 && form.samples <= 512)
|
|
2964
3400
|
}
|
|
2965
3401
|
|
|
3402
|
+
const reviewSelectionKey = state => JSON.stringify([state.projectsRoot, state.storeIdentity, state.activeProjectId])
|
|
3403
|
+
function reviewSelectionFor(state) {
|
|
3404
|
+
const scene = state.selected?.scene
|
|
3405
|
+
if (!scene) return null
|
|
3406
|
+
return state.reviewSelections?.[reviewSelectionKey(state)] || { baseRevision: scene.revision,
|
|
3407
|
+
mode: state.selectedReviewViewsSupported ? 'selected' : 'standard', views: [{ id: 'review-1',
|
|
3408
|
+
cameraId: scene.project.activeCamera || scene.nodes.cameras?.[0]?.id || '', frame: scene.project.frameStart ?? 1 }] }
|
|
3409
|
+
}
|
|
3410
|
+
function reviewSelectionValid(state, selection = reviewSelectionFor(state)) {
|
|
3411
|
+
const scene = state.selected?.scene
|
|
3412
|
+
if (!scene || scene.project?.id !== state.activeProjectId || !selection || !state.selectedReviewViewsSupported || selection.baseRevision !== scene.revision
|
|
3413
|
+
|| !/^[a-f0-9]{64}$/.test(state.storeIdentity || '') || !/^[a-f0-9]{64}$/.test(scene.digest || '')
|
|
3414
|
+
|| !Array.isArray(selection.views) || selection.views.length < 1 || selection.views.length > 4) return false
|
|
3415
|
+
const pairs = new Set()
|
|
3416
|
+
return selection.views.every(view => {
|
|
3417
|
+
const pair = JSON.stringify([view.cameraId, view.frame])
|
|
3418
|
+
if (!scene.nodes.cameras.some(camera => camera.id === view.cameraId) || !Number.isSafeInteger(view.frame)
|
|
3419
|
+
|| view.frame < scene.project.frameStart || view.frame > scene.project.frameEnd || pairs.has(pair)) return false
|
|
3420
|
+
pairs.add(pair); return true
|
|
3421
|
+
})
|
|
3422
|
+
}
|
|
3423
|
+
function completedReviewViews(state) {
|
|
3424
|
+
const scene = state.selected?.scene
|
|
3425
|
+
if (!scene) return []
|
|
3426
|
+
const pairs = new Map()
|
|
3427
|
+
for (const job of snapshotImages(state, scene.revision).slice().sort((a, b) => String(a.jobId).localeCompare(String(b.jobId)))) {
|
|
3428
|
+
const cameraId = job.cameraId, frame = job.delivery.image.frame
|
|
3429
|
+
if (!scene.nodes.cameras.some(camera => camera.id === cameraId) || frame < scene.project.frameStart || frame > scene.project.frameEnd) continue
|
|
3430
|
+
const pair = JSON.stringify([cameraId, frame]); pairs.delete(pair); pairs.set(pair, { cameraId, frame })
|
|
3431
|
+
}
|
|
3432
|
+
return [...pairs.values()].slice(-4).map((view, i) => ({ id: `review-${i + 1}`, ...view }))
|
|
3433
|
+
}
|
|
3434
|
+
|
|
2966
3435
|
const REFERENCE_PURPOSES = ['geometry', 'materials', 'lighting', 'goalFit']
|
|
2967
3436
|
const REFERENCE_MAX_BYTES = 8 * 1024 * 1024
|
|
2968
3437
|
function createBriefDraft(scene, projectId) {
|
|
@@ -3002,6 +3471,51 @@ window.__ModuleLoader__.load({
|
|
|
3002
3471
|
frame: Math.min(scene.project.frameEnd ?? 24, Math.max(scene.project.frameStart ?? 1, 24)), marginPercent: 3,
|
|
3003
3472
|
completeEntityIds: complete ? [...complete].sort() : null, touched: false, attempt: null, storageError: false }
|
|
3004
3473
|
}
|
|
3474
|
+
const motionKey = state => JSON.stringify([state.projectsRoot, state.storeIdentity, state.activeProjectId])
|
|
3475
|
+
function wideFramePlan(scene) {
|
|
3476
|
+
if (!scene?.renderProfiles || !scene?.project) return null
|
|
3477
|
+
const profiles = []
|
|
3478
|
+
for (const name of ['preview', 'final']) {
|
|
3479
|
+
const resolution = scene.renderProfiles[name]?.resolution
|
|
3480
|
+
if (!Array.isArray(resolution) || resolution.length !== 2 || !resolution.every(value => Number.isSafeInteger(value) && value >= 16 && value <= 16384)) return null
|
|
3481
|
+
const [width, height] = resolution
|
|
3482
|
+
const wide = width * 9 === height * 16
|
|
3483
|
+
const newWidth = wide ? width : Math.floor(Math.min(width, Math.sqrt(width * height * 16 / 9)) / 16) * 16
|
|
3484
|
+
if (newWidth < 32 || newWidth > 16384) return null
|
|
3485
|
+
const after = wide ? [...resolution] : [newWidth, newWidth * 9 / 16]
|
|
3486
|
+
if (after[1] < 16 || after[0] * after[1] > width * height) return null
|
|
3487
|
+
profiles.push({ name, before: [...resolution], after })
|
|
3488
|
+
}
|
|
3489
|
+
return { profiles, changed: scene.project.aspectRatio !== '16:9' || profiles.some(item => !editorEqual(item.before, item.after)) }
|
|
3490
|
+
}
|
|
3491
|
+
const motionDraftFor = state => state.motionDrafts?.[motionKey(state)] || null
|
|
3492
|
+
function createMotionDraft(scene, projectId, projectsRoot, storeIdentity, source) {
|
|
3493
|
+
const fit = createCameraFitDraft(scene, projectId, projectsRoot, source)
|
|
3494
|
+
const tagged = fit.entities.filter(entity => entity.visible !== false && entity.tags?.includes('hero-product')).map(entity => entity.id).sort()
|
|
3495
|
+
const animated = new Set((scene.nodes.animationTracks || []).filter(track => track.targetKind === 'camera').map(track => track.targetId))
|
|
3496
|
+
const cameraRestrictions = Object.fromEntries((scene.nodes.cameras || []).flatMap(camera => animated.has(camera.id) ? [[camera.id, 'animated']]
|
|
3497
|
+
: camera.targetEntityId ? [[camera.id, 'targeted']] : []))
|
|
3498
|
+
return { projectId, projectsRoot, storeIdentity, baseRevision: scene.revision, entities: fit.entities,
|
|
3499
|
+
cameras: fit.cameras, cameraRestrictions, completeEntityIds: fit.completeEntityIds, taggedEntityIds: tagged.length <= 128 ? tagged : [], taggedOverflow: tagged.length > 128, entityIds: fit.entityIds, cameraId: fit.cameraId,
|
|
3500
|
+
seconds: '6', amount: '8', direction: 'forward', allowRangeExtension: false, result: null, storageError: false, touched: false }
|
|
3501
|
+
}
|
|
3502
|
+
function validMotionDraft(draft) {
|
|
3503
|
+
return Boolean(draft && draft.cameras.includes(draft.cameraId) && !draft.cameraRestrictions?.[draft.cameraId] && draft.entityIds.length > 0 && draft.entityIds.length <= 128
|
|
3504
|
+
&& new Set(draft.entityIds).size === draft.entityIds.length && draft.entityIds.every(id => draft.entities.some(entity => entity.id === id && entity.visible !== false))
|
|
3505
|
+
&& Number.isFinite(Number(draft.seconds)) && Number(draft.seconds) >= 1 && Number(draft.seconds) <= 10
|
|
3506
|
+
&& Number.isFinite(Number(draft.amount)) && Number(draft.amount) >= 1 && Number(draft.amount) <= 20
|
|
3507
|
+
&& ['forward', 'backward'].includes(draft.direction))
|
|
3508
|
+
}
|
|
3509
|
+
const motionStorageKey = (root, identity, id) => `deepblend.motion-preview/v1:${JSON.stringify([root, identity, id])}`
|
|
3510
|
+
function validMotionReceipt(receipt, draft) {
|
|
3511
|
+
return Boolean(receipt && /^[a-f0-9-]{36}$/.test(receipt.id || '') && /^[a-f0-9]{64}$/.test(receipt.intentSha256 || '')
|
|
3512
|
+
&& receipt.projectId === draft.projectId && receipt.baseRevision === draft.baseRevision
|
|
3513
|
+
&& /^[a-zA-Z][a-zA-Z0-9._-]{0,127}$/.test(receipt.cameraId || '') && receipt.sourceCameraId === draft.cameraId
|
|
3514
|
+
&& Number.isSafeInteger(receipt.expiresAt) && Number.isSafeInteger(receipt.frameStart) && Number.isSafeInteger(receipt.frameEnd)
|
|
3515
|
+
&& Number.isSafeInteger(receipt.fps) && receipt.video && /^[a-f0-9]{64}$/.test(receipt.video.sha256 || '')
|
|
3516
|
+
&& Number.isSafeInteger(receipt.video.bytes) && receipt.video.bytes > 0 && receipt.video.bytes <= 32 * 1024 * 1024
|
|
3517
|
+
&& Number.isSafeInteger(receipt.video.frames) && receipt.video.frames === receipt.frameEnd - receipt.frameStart + 1)
|
|
3518
|
+
}
|
|
3005
3519
|
const cameraFitInvalid = draft => !draft || !draft.cameras.includes(draft.cameraId)
|
|
3006
3520
|
|| draft.entityIds.length < 1 || draft.entityIds.length > 64 || new Set(draft.entityIds).size !== draft.entityIds.length
|
|
3007
3521
|
|| draft.entityIds.some(id => !draft.entities.some(entity => entity.id === id))
|
|
@@ -3189,12 +3703,13 @@ window.__ModuleLoader__.load({
|
|
|
3189
3703
|
}
|
|
3190
3704
|
|
|
3191
3705
|
/** POST a JSON body and return the parsed payload. Errors come back as data. */
|
|
3192
|
-
async function postJson(fetchImpl, path, body) {
|
|
3706
|
+
async function postJson(fetchImpl, path, body, signal) {
|
|
3193
3707
|
try {
|
|
3194
3708
|
const response = await fetchImpl(path, {
|
|
3195
3709
|
method: 'POST',
|
|
3196
3710
|
headers: { 'content-type': 'application/json', accept: 'application/json' },
|
|
3197
3711
|
body: JSON.stringify(body || {}),
|
|
3712
|
+
...(signal ? { signal } : {}),
|
|
3198
3713
|
})
|
|
3199
3714
|
const payload = await response.json()
|
|
3200
3715
|
if (payload && payload.ok) return { ok: true, payload }
|
|
@@ -3247,9 +3762,13 @@ window.__ModuleLoader__.load({
|
|
|
3247
3762
|
const snapshotEntry = state => state.editableSnapshots?.[snapshotContextKey(state)] || null
|
|
3248
3763
|
const snapshotVideos = (state, revision) => (state.jobs || []).filter(job => job.status === 'completed'
|
|
3249
3764
|
&& job.revisionId === revision && typeof job.delivery?.videoPath === 'string' && job.delivery.videoPath.length > 0)
|
|
3765
|
+
const snapshotImages = (state, revision) => (state.jobs || []).filter(job => job.status === 'completed' && job.revisionId === revision
|
|
3766
|
+
&& job.delivery?.kind === 'still' && job.delivery.verified === true && Number.isSafeInteger(job.delivery.image?.frame)
|
|
3767
|
+
&& /^[a-f0-9]{64}$/.test(job.delivery.image?.sha256 || '') && /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$/.test(job.jobId || ''))
|
|
3250
3768
|
const snapshotSupported = state => state.editableSnapshotProtocol === 1 && /^[a-f0-9]{64}$/.test(state.storeIdentity || '')
|
|
3251
3769
|
&& state.editableSnapshotAvailability?.available === true
|
|
3252
3770
|
const snapshotSameSelection = entry => entry?.handle && entry.revision === entry.handle.revision && entry.videoJobId === entry.handle.videoJobId
|
|
3771
|
+
&& JSON.stringify(entry.imageJobIds || []) === JSON.stringify(entry.handle.imageJobIds || [])
|
|
3253
3772
|
const snapshotBytes = value => value >= 1048576 ? `${(value / 1048576).toFixed(1)} MiB` : value >= 1024 ? `${(value / 1024).toFixed(1)} KiB` : `${value} B`
|
|
3254
3773
|
const snapshotExportId = async requestId => `snapshot-${(await imageByteHash(Uint8Array.from(requestId, char => char.charCodeAt(0)), undefined, true)).slice(0, 40)}`
|
|
3255
3774
|
function validSnapshotHandle(handle) {
|
|
@@ -3257,10 +3776,14 @@ window.__ModuleLoader__.load({
|
|
|
3257
3776
|
&& /^snapshot-[a-f0-9]{40}$/.test(handle.exportId || '') && /^[a-f0-9]{64}$/.test(handle.storeIdentity || '')
|
|
3258
3777
|
&& typeof handle.projectId === 'string' && handle.projectId.length > 0 && handle.projectId.length <= 200
|
|
3259
3778
|
&& /^r[0-9]+$/.test(handle.revision || '') && (handle.videoJobId === null || typeof handle.videoJobId === 'string' && handle.videoJobId.length > 0 && handle.videoJobId.length <= 200)
|
|
3779
|
+
&& (handle.imageJobIds === undefined || Array.isArray(handle.imageJobIds) && handle.imageJobIds.length > 0 && handle.imageJobIds.length <= 16
|
|
3780
|
+
&& handle.imageJobIds.every(id => typeof id === 'string' && /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$/.test(id))
|
|
3781
|
+
&& JSON.stringify([...new Set(handle.imageJobIds)].sort()) === JSON.stringify(handle.imageJobIds))
|
|
3260
3782
|
}
|
|
3261
3783
|
function validSnapshotReply(value, handle) {
|
|
3262
3784
|
if (!value || !['preparing', 'ready', 'failed', 'cancelled'].includes(value.state)
|
|
3263
|
-
|| ['requestId', 'exportId', 'storeIdentity', 'projectId', 'revision', 'videoJobId'].some(key => value[key] !== handle[key])
|
|
3785
|
+
|| ['requestId', 'exportId', 'storeIdentity', 'projectId', 'revision', 'videoJobId'].some(key => value[key] !== handle[key])
|
|
3786
|
+
|| JSON.stringify(value.imageJobIds || []) !== JSON.stringify(handle.imageJobIds || [])) return false
|
|
3264
3787
|
if (value.state === 'ready') {
|
|
3265
3788
|
const expected = projectRoute(handle.projectId, `/editable-snapshots/${handle.exportId}/download?storeIdentity=${handle.storeIdentity}`)
|
|
3266
3789
|
if (value.downloadUrl !== expected || !Number.isSafeInteger(value.archive?.bytes) || value.archive.bytes <= 0
|
|
@@ -3279,8 +3802,16 @@ window.__ModuleLoader__.load({
|
|
|
3279
3802
|
projects: [],
|
|
3280
3803
|
projectsRoot: null,
|
|
3281
3804
|
storeIdentity: null,
|
|
3805
|
+
projectStorage: null,
|
|
3282
3806
|
editableSnapshotProtocol: null,
|
|
3283
3807
|
editableSnapshotAvailability: null,
|
|
3808
|
+
snapshotImagesSupported: false,
|
|
3809
|
+
renderVideoDownloadSupported: false,
|
|
3810
|
+
renderFrameDownloadSupported: false,
|
|
3811
|
+
stillDeliveryPresetSupported: false,
|
|
3812
|
+
videoDeliveryPresetSupported: false,
|
|
3813
|
+
deliveryAspectPresetSupported: false,
|
|
3814
|
+
stillImageDeliverySupported: false,
|
|
3284
3815
|
editableSnapshots: {},
|
|
3285
3816
|
recipeCatalog: { recipes: [], errors: [] },
|
|
3286
3817
|
selected: null,
|
|
@@ -3306,6 +3837,7 @@ window.__ModuleLoader__.load({
|
|
|
3306
3837
|
creationWork: null,
|
|
3307
3838
|
creationRequestProtocol: null,
|
|
3308
3839
|
cameraTargetResetSupported: false,
|
|
3840
|
+
photographyBoundaryReuseSupported: false,
|
|
3309
3841
|
creationDrafts: [],
|
|
3310
3842
|
creationDraftStorageStatus: null,
|
|
3311
3843
|
creationDraftMissingRecipe: null,
|
|
@@ -3324,12 +3856,16 @@ window.__ModuleLoader__.load({
|
|
|
3324
3856
|
briefWork: {},
|
|
3325
3857
|
visualRuns: {},
|
|
3326
3858
|
visualIterations: {},
|
|
3859
|
+
reviewSelections: {},
|
|
3860
|
+
selectedReviewViewsSupported: false,
|
|
3327
3861
|
photographyDrafts: {},
|
|
3328
3862
|
photographyWork: {},
|
|
3329
3863
|
photographyEdits: {},
|
|
3330
3864
|
photographyReuse: {},
|
|
3331
3865
|
editorEntityId: null,
|
|
3332
3866
|
editorDrafts: {},
|
|
3867
|
+
halfLapPreviewSupported: false,
|
|
3868
|
+
halfLapPreview: null,
|
|
3333
3869
|
geometryMeasurements: {},
|
|
3334
3870
|
editorLastEdits: {},
|
|
3335
3871
|
editorComparison: null,
|
|
@@ -3338,9 +3874,14 @@ window.__ModuleLoader__.load({
|
|
|
3338
3874
|
cameraFitDrafts: {},
|
|
3339
3875
|
cameraFitWork: {},
|
|
3340
3876
|
cameraFitSupported: false,
|
|
3877
|
+
motionDrafts: {},
|
|
3878
|
+
motionWork: {},
|
|
3879
|
+
motionPreviewSupported: false,
|
|
3880
|
+
imageInputProbeSupported: false,
|
|
3881
|
+
imageInputProbe: { busy: false, result: null },
|
|
3341
3882
|
patchDrafts: {},
|
|
3342
3883
|
recipeChoices: [],
|
|
3343
|
-
forms: { title: '', goal: '', recipe: null, recipeParameters: {}, patch: null, frameStart: '', frameEnd: '', profile: 'preview' },
|
|
3884
|
+
forms: { title: '', goal: '', recipe: null, recipeParameters: {}, patch: null, frameStart: '', frameEnd: '', profile: 'preview', renderCamera: '', stillPreset: '', deliveryKind: '' },
|
|
3344
3885
|
busy: { create: false, patch: false, editor: false, assembly: false, placement: false, render: false, restore: false },
|
|
3345
3886
|
notices: { projects: null, scene: null, preview: null, jobs: null, revisions: null },
|
|
3346
3887
|
}
|
|
@@ -3412,6 +3953,11 @@ window.__ModuleLoader__.load({
|
|
|
3412
3953
|
const placementControllers = new Map()
|
|
3413
3954
|
const cameraFitControllers = new Map()
|
|
3414
3955
|
const cameraFitStorage = settings.cameraFitStorage ?? preferenceStorage
|
|
3956
|
+
const motionControllers = new Map()
|
|
3957
|
+
let halfLapPreviewController
|
|
3958
|
+
let imageProbeController = null
|
|
3959
|
+
const motionStorage = settings.motionStorage ?? preferenceStorage
|
|
3960
|
+
const motionWork = (key, changes) => set({ motionWork: { ...data.motionWork, [key]: { ...data.motionWork[key], ...changes } } })
|
|
3415
3961
|
const photographySourceControllers = new Map()
|
|
3416
3962
|
let photographySourceSequence = 0
|
|
3417
3963
|
const photographyWork = (projectId, changes) => set({ photographyWork: { ...data.photographyWork, [projectId]: { ...data.photographyWork[projectId], ...changes } } })
|
|
@@ -3492,7 +4038,13 @@ window.__ModuleLoader__.load({
|
|
|
3492
4038
|
if (['projectsRoot', 'storeIdentity', 'activeProjectId'].some(key => Object.hasOwn(patch, key) && patch[key] !== data[key])) retireSnapshotContext()
|
|
3493
4039
|
if (['projectsRoot', 'storeIdentity', 'activeProjectId', 'currentRevision'].some(key => Object.hasOwn(patch, key) && patch[key] !== data[key])
|
|
3494
4040
|
|| Object.hasOwn(patch, 'view') && patch.view !== 'preview') patch = { ...patch, lighttableSelection: null }
|
|
3495
|
-
|
|
4041
|
+
const next = { ...data, ...patch }
|
|
4042
|
+
if (next.halfLapPreview && halfLapPreviewIntent(next)?.key !== next.halfLapPreview.key) {
|
|
4043
|
+
halfLapPreviewController?.abort()
|
|
4044
|
+
halfLapPreviewController = undefined
|
|
4045
|
+
next.halfLapPreview = null
|
|
4046
|
+
}
|
|
4047
|
+
data = next; notify()
|
|
3496
4048
|
}
|
|
3497
4049
|
/** Change one nested table. @param {'forms'|'busy'|'notices'} table @param {string} key @param {any} value */
|
|
3498
4050
|
const setIn = (table, key, value) => { data = { ...data, [table]: { ...data[table], [key]: value } }; notify() }
|
|
@@ -3574,10 +4126,23 @@ window.__ModuleLoader__.load({
|
|
|
3574
4126
|
recipeCatalog: payload.recipeCatalog ?? { recipes: [], errors: [] },
|
|
3575
4127
|
projectsRoot: payload.projectsRoot ?? null,
|
|
3576
4128
|
storeIdentity: payload.storeIdentity ?? null,
|
|
4129
|
+
projectStorage: payload.projectStorage ?? null,
|
|
3577
4130
|
editableSnapshotProtocol: payload.editableSnapshotProtocol ?? null,
|
|
3578
4131
|
editableSnapshotAvailability: payload.editableSnapshotAvailability ?? null,
|
|
4132
|
+
snapshotImagesSupported: payload.snapshotImagesSupported === true,
|
|
4133
|
+
renderVideoDownloadSupported: payload.renderVideoDownloadSupported === true,
|
|
4134
|
+
renderFrameDownloadSupported: payload.renderFrameDownloadSupported === true,
|
|
4135
|
+
stillDeliveryPresetSupported: payload.stillDeliveryPresetSupported === true,
|
|
4136
|
+
videoDeliveryPresetSupported: payload.videoDeliveryPresetSupported === true,
|
|
4137
|
+
deliveryAspectPresetSupported: payload.deliveryAspectPresetSupported === true,
|
|
4138
|
+
stillImageDeliverySupported: payload.stillImageDeliverySupported === true,
|
|
4139
|
+
motionPreviewSupported: payload.motionPreviewSupported === true,
|
|
4140
|
+
halfLapPreviewSupported: payload.halfLapPreviewSupported === true,
|
|
4141
|
+
imageInputProbeSupported: payload.imageInputProbeSupported === true,
|
|
4142
|
+
selectedReviewViewsSupported: payload.selectedReviewViewsSupported === true,
|
|
3579
4143
|
creationRequestProtocol: payload.creationRequestProtocol ?? null,
|
|
3580
4144
|
cameraTargetResetSupported: payload.cameraTargetResetSupported === true,
|
|
4145
|
+
photographyBoundaryReuseSupported: payload.photographyBoundaryReuseSupported === true,
|
|
3581
4146
|
assemblyPlacementSupported: payload.assemblyPlacementSupported === true,
|
|
3582
4147
|
cameraFitSupported: payload.cameraFitSupported === true,
|
|
3583
4148
|
selected: payload.selected ?? null,
|
|
@@ -3624,8 +4189,23 @@ window.__ModuleLoader__.load({
|
|
|
3624
4189
|
}
|
|
3625
4190
|
if (sequence !== loadSequence || projectId !== target()) return
|
|
3626
4191
|
if (active !== data.activeProjectId) patch.forms = { ...data.forms, patch: data.patchDrafts[active] ?? null }
|
|
4192
|
+
if (active !== data.activeProjectId || patch.projectsRoot !== data.projectsRoot || patch.storeIdentity !== data.storeIdentity)
|
|
4193
|
+
patch.forms = { ...(patch.forms || data.forms), renderCamera: '' }
|
|
3627
4194
|
if (patch.selected?.scene && active) {
|
|
3628
4195
|
const source = patch.selected.recipeParameters
|
|
4196
|
+
const motionContext = JSON.stringify([patch.projectsRoot, patch.storeIdentity, active])
|
|
4197
|
+
if (!data.motionDrafts[motionContext] && patch.storeIdentity) {
|
|
4198
|
+
const draft = createMotionDraft(patch.selected.scene, active, patch.projectsRoot, patch.storeIdentity, source)
|
|
4199
|
+
try {
|
|
4200
|
+
const raw = motionStorage?.getItem(motionStorageKey(patch.projectsRoot, patch.storeIdentity, active))
|
|
4201
|
+
if (raw && raw.length <= 8192) {
|
|
4202
|
+
const saved = JSON.parse(raw)
|
|
4203
|
+
const candidate = { ...draft, baseRevision: saved.baseRevision, cameraId: saved.sourceCameraId }
|
|
4204
|
+
if (validMotionReceipt(saved, candidate) && (saved.expiresAt > Date.now() || saved.saveAttempted === true)) Object.assign(draft, candidate, { result: saved })
|
|
4205
|
+
}
|
|
4206
|
+
} catch { draft.storageError = true }
|
|
4207
|
+
patch.motionDrafts = { ...data.motionDrafts, [motionContext]: draft }
|
|
4208
|
+
}
|
|
3629
4209
|
const fitKey = JSON.stringify([patch.projectsRoot, active]), fitted = data.cameraFitDrafts[fitKey]
|
|
3630
4210
|
if ((!fitted || !cameraFitDirty(fitted)) && !cameraFitControllers.has(fitKey)) {
|
|
3631
4211
|
const next = createCameraFitDraft(patch.selected.scene, active, patch.projectsRoot, source)
|
|
@@ -3666,7 +4246,7 @@ window.__ModuleLoader__.load({
|
|
|
3666
4246
|
if (creationDraftRoot !== null) {
|
|
3667
4247
|
creationAttempt = null; restoredCreationSource = null; creationDraftId = newCreationKey()
|
|
3668
4248
|
patch.creationWork = null; patch.creationDraftMissingRecipe = null; patch.recipeChoices = []
|
|
3669
|
-
patch.forms = { ...data.forms, title: '', goal: '', recipe: null, recipeParameters: {} }
|
|
4249
|
+
patch.forms = { ...(patch.forms || data.forms), title: '', goal: '', recipe: null, recipeParameters: {} }
|
|
3670
4250
|
}
|
|
3671
4251
|
creationDraftRoot = typeof patch.projectsRoot === 'string' && patch.projectsRoot ? patch.projectsRoot : null
|
|
3672
4252
|
persistedCreationSignature = null
|
|
@@ -3732,7 +4312,7 @@ window.__ModuleLoader__.load({
|
|
|
3732
4312
|
let handle = null, storageUnavailable = false
|
|
3733
4313
|
try { handle = storedSnapshots().find(record => record.key === key)?.handle || null } catch { storageUnavailable = true }
|
|
3734
4314
|
if (handle && (handle.storeIdentity !== data.storeIdentity || handle.projectId !== data.activeProjectId)) handle = null
|
|
3735
|
-
entry = { revision: handle?.revision || data.currentRevision, videoJobId: handle?.videoJobId || null, handle, result: null, issue: null, busy: {}, attempt: 0, storageUnavailable }
|
|
4315
|
+
entry = { revision: handle?.revision || data.currentRevision, videoJobId: handle?.videoJobId || null, imageJobIds: handle?.imageJobIds || [], handle, result: null, issue: null, busy: {}, attempt: 0, storageUnavailable }
|
|
3736
4316
|
}
|
|
3737
4317
|
changeSnapshot(key, { ...entry, busy: {} })
|
|
3738
4318
|
if (entry.handle && running && snapshotSupported(data)) void snapshotRequest('check')
|
|
@@ -3745,7 +4325,8 @@ window.__ModuleLoader__.load({
|
|
|
3745
4325
|
}
|
|
3746
4326
|
async function snapshotControl(handle, kind, signal) {
|
|
3747
4327
|
const suffix = kind === 'prepare' ? '' : `/${handle.exportId}${kind === 'cancel' ? '/cancel' : ''}`
|
|
3748
|
-
const body = kind === 'prepare' ? { requestId: handle.requestId, revision: handle.revision, ...(handle.videoJobId ? { videoJobId: handle.videoJobId } : {}),
|
|
4328
|
+
const body = kind === 'prepare' ? { requestId: handle.requestId, revision: handle.revision, ...(handle.videoJobId ? { videoJobId: handle.videoJobId } : {}),
|
|
4329
|
+
...(handle.imageJobIds?.length ? { imageJobIds: handle.imageJobIds } : {}), expectedStoreIdentity: handle.storeIdentity }
|
|
3749
4330
|
: kind === 'cancel' ? { expectedStoreIdentity: handle.storeIdentity } : null
|
|
3750
4331
|
const response = await fetchImpl(projectRoute(handle.projectId, `/editable-snapshots${suffix}`), {
|
|
3751
4332
|
method: body ? 'POST' : 'GET', cache: 'no-store', headers: { accept: 'application/json', ...(body ? { 'content-type': 'application/json' } : {}) },
|
|
@@ -3774,10 +4355,11 @@ window.__ModuleLoader__.load({
|
|
|
3774
4355
|
let handle = entry.handle
|
|
3775
4356
|
if (kind === 'prepare' && !snapshotSameSelection(entry)) {
|
|
3776
4357
|
if (!(data.selected?.revisions || []).some(item => item.revision === entry.revision)
|
|
3777
|
-
|| entry.videoJobId && !snapshotVideos(data, entry.revision).some(job => job.jobId === entry.videoJobId)
|
|
4358
|
+
|| entry.videoJobId && !snapshotVideos(data, entry.revision).some(job => job.jobId === entry.videoJobId)
|
|
4359
|
+
|| 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' })
|
|
3778
4360
|
const requestId = newCreationKey().replace(/^create-/, 'copy-')
|
|
3779
4361
|
handle = { requestId, exportId: await snapshotExportId(requestId), projectId: data.activeProjectId,
|
|
3780
|
-
revision: entry.revision, videoJobId: entry.videoJobId, storeIdentity: data.storeIdentity }
|
|
4362
|
+
revision: entry.revision, videoJobId: entry.videoJobId, ...(entry.imageJobIds?.length ? { imageJobIds: [...entry.imageJobIds] } : {}), storeIdentity: data.storeIdentity }
|
|
3781
4363
|
if (!stillCurrent()) return
|
|
3782
4364
|
changeSnapshot(key, { handle, result: null })
|
|
3783
4365
|
rememberSnapshot(key, handle)
|
|
@@ -3813,7 +4395,16 @@ window.__ModuleLoader__.load({
|
|
|
3813
4395
|
if (!entry || entry.result?.state === 'preparing' || Object.values(entry.busy || {}).some(Boolean)) return
|
|
3814
4396
|
if (field === 'revision' && !(data.selected?.revisions || []).some(item => item.revision === value)) return
|
|
3815
4397
|
if (field === 'videoJobId' && value && !snapshotVideos(data, entry.revision).some(job => job.jobId === value)) return
|
|
3816
|
-
changeSnapshot(key, { [field]: value || null, ...(field === 'revision' ? { videoJobId: null } : {}) })
|
|
4398
|
+
changeSnapshot(key, { [field]: value || null, ...(field === 'revision' ? { videoJobId: null, imageJobIds: [] } : {}) })
|
|
4399
|
+
}
|
|
4400
|
+
function setSnapshotImage(id, selected) {
|
|
4401
|
+
const key = snapshotContextKey(data), entry = data.editableSnapshots[key]
|
|
4402
|
+
if (!entry || !data.snapshotImagesSupported || entry.result?.state === 'preparing' || Object.values(entry.busy || {}).some(Boolean)) return
|
|
4403
|
+
const ids = new Set(entry.imageJobIds || [])
|
|
4404
|
+
if (selected && !snapshotImages(data, entry.revision).some(job => job.jobId === id) || !selected && !ids.has(id)) return
|
|
4405
|
+
if (selected && ids.size >= 16 && !ids.has(id)) return
|
|
4406
|
+
if (selected) ids.add(id); else ids.delete(id)
|
|
4407
|
+
changeSnapshot(key, { imageJobIds: [...ids].sort() })
|
|
3817
4408
|
}
|
|
3818
4409
|
|
|
3819
4410
|
const creationBody = () => creationRequestBody(data.forms)
|
|
@@ -3909,10 +4500,11 @@ window.__ModuleLoader__.load({
|
|
|
3909
4500
|
photographySourceControllers.get(projectId)?.abort()
|
|
3910
4501
|
const controller = new AbortController(), sequence = ++photographySourceSequence
|
|
3911
4502
|
photographySourceControllers.set(projectId, controller)
|
|
3912
|
-
const root = data.projectsRoot, baseRevision = draft.baseRevision, sourceProjectId = selection.sourceProjectId
|
|
4503
|
+
const root = data.projectsRoot, baseRevision = draft.baseRevision, sourceProjectId = selection.sourceProjectId, storeIdentity = data.storeIdentity
|
|
4504
|
+
const destinationEntityIds = photographyProductDefaults(data.selected?.scene, data.selected?.recipeParameters?.placement?.available ? data.selected.recipeParameters.placement.memberEntityIds : null)
|
|
3913
4505
|
const alive = () => running && !controller.signal.aborted && photographySourceControllers.get(projectId) === controller && data.projectsRoot === root
|
|
3914
4506
|
const update = changes => set({ photographyReuse: { ...data.photographyReuse, [projectId]: { ...data.photographyReuse[projectId], ...changes } } })
|
|
3915
|
-
update({ source: null, loading: true, error: null, applied: false, unchanged: false, replaceDraft: false, projectsRoot: root, baseRevision, sequence })
|
|
4507
|
+
update({ source: null, loading: true, error: null, applied: false, unchanged: false, replaceDraft: false, projectsRoot: root, storeIdentity, baseRevision, sequence })
|
|
3916
4508
|
const deadline = setTimeout(() => controller.abort(), 30000)
|
|
3917
4509
|
const read = (path, route) => readRoute((url, options) => fetchImpl(url, { ...options, signal: controller.signal }), path, route)
|
|
3918
4510
|
try {
|
|
@@ -3931,7 +4523,7 @@ window.__ModuleLoader__.load({
|
|
|
3931
4523
|
|| scene?.revision !== revision || scene?.project?.id !== sourceProjectId || scene.digest !== payload.digest
|
|
3932
4524
|
|| !/^[a-f0-9]{64}$/.test(payload.digest || '') || (saved.digest && saved.digest !== payload.digest)
|
|
3933
4525
|
|| !Array.isArray(scene.nodes?.cameras) || !Array.isArray(scene.nodes?.lights)) throw new Error(result.error?.message || t('photo.reuseUnavailable'))
|
|
3934
|
-
update({ source: editorClone(scene), cameraId: scene.nodes.cameras.find(item => item.id === scene.project.activeCamera)?.id || scene.nodes.cameras[0]?.id || '', targetEntityId: '', error: null })
|
|
4526
|
+
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 })
|
|
3935
4527
|
} catch (error) {
|
|
3936
4528
|
if (alive()) update({ source: null, error: error.message || String(error) })
|
|
3937
4529
|
} finally {
|
|
@@ -3943,6 +4535,114 @@ window.__ModuleLoader__.load({
|
|
|
3943
4535
|
}
|
|
3944
4536
|
}
|
|
3945
4537
|
const actions = {
|
|
4538
|
+
saveWideFrame: async () => {
|
|
4539
|
+
const projectId = data.activeProjectId, scene = data.selected?.scene, plan = wideFramePlan(scene)
|
|
4540
|
+
const key = motionKey(data), motion = motionDraftFor(data), motionBusy = data.motionWork[key]?.busy
|
|
4541
|
+
if (!projectId || !scene || scene.project?.id !== projectId || scene.revision !== data.currentRevision
|
|
4542
|
+
|| !data.deliveryAspectPresetSupported || !/^[a-f0-9]{64}$/.test(data.storeIdentity || '')
|
|
4543
|
+
|| !plan?.changed || projectHasUnsavedDrafts(data) || motion?.result || motion?.touched || motionBusy || Object.values(data.busy).some(Boolean)) return
|
|
4544
|
+
const root = data.projectsRoot, identity = data.storeIdentity, revision = scene.revision
|
|
4545
|
+
const operations = plan.profiles.filter(item => !editorEqual(item.before, item.after)).map(item => ({ op: 'render.profile.set', profileName: item.name, profile: { resolution: item.after } }))
|
|
4546
|
+
if (scene.project.aspectRatio !== '16:9') operations.push({ op: 'project.aspectRatio.set', aspectRatio: '16:9' })
|
|
4547
|
+
const patch = { projectId, baseRevision: revision, actor: 'ui', saveCheckpoint: true, renderPreview: true, operations }
|
|
4548
|
+
setIn('busy', 'patch', true)
|
|
4549
|
+
const outcome = await postJson(fetchImpl, projectRoute(projectId, '/patch'), { patch, expectedStoreIdentity: identity })
|
|
4550
|
+
setIn('busy', 'patch', false)
|
|
4551
|
+
if (outcome.ok && motion && data.motionDrafts[key] === motion) {
|
|
4552
|
+
const drafts = { ...data.motionDrafts }; delete drafts[key]; set({ motionDrafts: drafts })
|
|
4553
|
+
}
|
|
4554
|
+
if (data.activeProjectId === projectId && data.projectsRoot === root && data.storeIdentity === identity)
|
|
4555
|
+
setIn('notices', 'jobs', outcome.ok ? { ok: true, message: t('aspect.saved') } : { ok: false, message: `${outcome.error.code}: ${outcome.error.message}` })
|
|
4556
|
+
reload()
|
|
4557
|
+
},
|
|
4558
|
+
probeImageInput: async () => {
|
|
4559
|
+
if (imageProbeController || !data.imageInputProbeSupported || data.editableSnapshotAvailability?.available !== true) return
|
|
4560
|
+
const controller = new AbortController(); imageProbeController = controller
|
|
4561
|
+
const deadline = setTimeout(() => controller.abort(), 50000)
|
|
4562
|
+
set({ imageInputProbe: { busy: true, result: null } })
|
|
4563
|
+
try {
|
|
4564
|
+
const outcome = await postJson(fetchImpl, ROUTES.imageInputProbe, {}, controller.signal)
|
|
4565
|
+
const result = outcome.payload?.imageInput
|
|
4566
|
+
const statuses = ['pass', 'unavailable', 'unverified']
|
|
4567
|
+
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']
|
|
4568
|
+
if (!outcome.ok || !result || !statuses.includes(result.status) || !reasons.includes(result.reason)
|
|
4569
|
+
|| result.status === 'pass' && result.reason !== null || result.status !== 'pass' && result.reason === null) throw Error('Invalid readiness result')
|
|
4570
|
+
if (running && imageProbeController === controller) set({ imageInputProbe: { busy: false, result: { status: result.status, reason: result.reason } } })
|
|
4571
|
+
} catch {
|
|
4572
|
+
if (running && imageProbeController === controller) set({ imageInputProbe: { busy: false, result: { status: 'unverified', reason: controller.signal.aborted ? 'timeout' : 'provider_error' } } })
|
|
4573
|
+
} finally { clearTimeout(deadline); if (imageProbeController === controller) imageProbeController = null }
|
|
4574
|
+
},
|
|
4575
|
+
setMotionValue: (field, value) => {
|
|
4576
|
+
const key = motionKey(data), draft = motionDraftFor(data), work = data.motionWork[key]
|
|
4577
|
+
if (!draft || draft.result || work?.busy || data.busy.patch || !['cameraId', 'entityIds', 'seconds', 'amount', 'direction', 'allowRangeExtension'].includes(field)) return
|
|
4578
|
+
if (field === 'cameraId' && (!draft.cameras.includes(value) || draft.cameraRestrictions?.[value])) return
|
|
4579
|
+
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
|
|
4580
|
+
set({ motionDrafts: { ...data.motionDrafts, [key]: { ...draft, touched: true, [field]: field === 'entityIds' ? [...value].sort() : value } } })
|
|
4581
|
+
},
|
|
4582
|
+
cancelMotion: () => motionControllers.get(motionKey(data))?.abort(),
|
|
4583
|
+
previewMotion: async () => {
|
|
4584
|
+
const key = motionKey(data), draft = motionDraftFor(data), scene = data.selected?.scene
|
|
4585
|
+
if (!draft || draft.result || motionControllers.has(key) || !data.motionPreviewSupported || !data.editableSnapshotAvailability?.available
|
|
4586
|
+
|| !validMotionDraft(draft) || draft.baseRevision !== data.currentRevision || draft.baseRevision !== scene?.revision || Object.values(data.busy).some(Boolean)) return
|
|
4587
|
+
const controller = new AbortController(); motionControllers.set(key, controller); motionWork(key, { busy: 'preview', error: null, message: null })
|
|
4588
|
+
const body = { baseRevision: draft.baseRevision, projectsRoot: draft.projectsRoot, sourceCameraId: draft.cameraId,
|
|
4589
|
+
seconds: Number(draft.seconds), fraction: Number(draft.amount) / 100, direction: draft.direction,
|
|
4590
|
+
entityIds: [...draft.entityIds].sort(), allowRangeExtension: draft.allowRangeExtension === true }
|
|
4591
|
+
try {
|
|
4592
|
+
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 })
|
|
4593
|
+
const payload = await response.json()
|
|
4594
|
+
if (!response.ok || !payload.ok) {
|
|
4595
|
+
if (payload.error?.code === 'MOTION_OUT_OF_FRAME') throw Object.assign(Error('MOTION_OUT_OF_FRAME'), { userMessage: t('motion.outOfFrame') })
|
|
4596
|
+
if (payload.error?.code === 'MOTION_FRAME_UNVERIFIABLE') throw Object.assign(Error('MOTION_FRAME_UNVERIFIABLE'), { userMessage: t('motion.unverifiable') })
|
|
4597
|
+
throw Error(`${payload.error?.code || 'MOTION_FAILED'}: ${payload.error?.message || response.status}`)
|
|
4598
|
+
}
|
|
4599
|
+
if (controller.signal.aborted || !validMotionReceipt(payload.preview, draft)) throw Error('MOTION_RECEIPT_MISMATCH')
|
|
4600
|
+
const receipt = { ...editorClone(payload.preview), saveAttempted: false }
|
|
4601
|
+
let storageError = false
|
|
4602
|
+
try { motionStorage.setItem(motionStorageKey(draft.projectsRoot, draft.storeIdentity, draft.projectId), JSON.stringify(receipt))
|
|
4603
|
+
if (motionStorage.getItem(motionStorageKey(draft.projectsRoot, draft.storeIdentity, draft.projectId)) !== JSON.stringify(receipt)) throw Error('storage mismatch')
|
|
4604
|
+
} catch { storageError = true }
|
|
4605
|
+
set({ motionDrafts: { ...data.motionDrafts, [key]: { ...draft, result: receipt, storageError } } })
|
|
4606
|
+
motionWork(key, { busy: null, error: storageError ? t('motion.storage') : null })
|
|
4607
|
+
} catch (error) { motionWork(key, { busy: null, error: controller.signal.aborted ? t('inspection.cancelled') : error.userMessage || t('motion.failed', { message: error.message || String(error) }) }) }
|
|
4608
|
+
finally { motionControllers.delete(key) }
|
|
4609
|
+
},
|
|
4610
|
+
discardMotion: async () => {
|
|
4611
|
+
const key = motionKey(data), draft = motionDraftFor(data), work = data.motionWork[key]
|
|
4612
|
+
if (!draft || work?.busy) return
|
|
4613
|
+
// An uncertain save may still be running; forget only the local handle.
|
|
4614
|
+
// Never ask the Host to remove a candidate while its commit is uncertain.
|
|
4615
|
+
if (draft.result && !draft.result.saveAttempted) {
|
|
4616
|
+
const outcome = await postJson(fetchImpl, projectRoute(draft.projectId, `/motion-previews/${draft.result.id}/discard`), {})
|
|
4617
|
+
if (!outcome.ok) { motionWork(key, { error: t('motion.failed', { message: outcome.error.message }) }); return }
|
|
4618
|
+
}
|
|
4619
|
+
try { motionStorage?.removeItem(motionStorageKey(draft.projectsRoot, draft.storeIdentity, draft.projectId)) } catch { motionWork(key, { error: t('motion.storage') }); return }
|
|
4620
|
+
const drafts = { ...data.motionDrafts }; delete drafts[key]; set({ motionDrafts: drafts, motionWork: { ...data.motionWork, [key]: {} } }); reload()
|
|
4621
|
+
},
|
|
4622
|
+
saveMotion: async () => {
|
|
4623
|
+
const key = motionKey(data), draft = motionDraftFor(data), result = draft?.result, work = data.motionWork[key]
|
|
4624
|
+
if (!draft || !result || work?.busy || draft.storageError || !validMotionReceipt(result, draft)
|
|
4625
|
+
|| !result.saveAttempted && (draft.baseRevision !== data.currentRevision || result.expiresAt <= Date.now())) return
|
|
4626
|
+
const attempted = { ...result, saveAttempted: true }, storageKey = motionStorageKey(draft.projectsRoot, draft.storeIdentity, draft.projectId)
|
|
4627
|
+
try { motionStorage.setItem(storageKey, JSON.stringify(attempted)); if (motionStorage.getItem(storageKey) !== JSON.stringify(attempted)) throw Error('storage mismatch') }
|
|
4628
|
+
catch { motionWork(key, { error: t('motion.storage') }); return }
|
|
4629
|
+
set({ motionDrafts: { ...data.motionDrafts, [key]: { ...draft, result: attempted } } }); motionWork(key, { busy: 'save', error: null })
|
|
4630
|
+
const controller = new AbortController()
|
|
4631
|
+
const deadline = setTimeout(() => controller.abort(), 120000)
|
|
4632
|
+
let outcome
|
|
4633
|
+
try {
|
|
4634
|
+
outcome = await postJson(fetchImpl, projectRoute(draft.projectId, `/motion-previews/${result.id}/save`), { projectsRoot: draft.projectsRoot, intentSha256: result.intentSha256 }, controller.signal)
|
|
4635
|
+
} finally { clearTimeout(deadline) }
|
|
4636
|
+
const saved = outcome.payload?.saved
|
|
4637
|
+
if (outcome.ok && saved?.projectId === draft.projectId && saved?.sourceRevision === draft.baseRevision
|
|
4638
|
+
&& saved?.cameraId === result.cameraId && /^r[0-9]{4,}$/.test(saved?.revision || '')) {
|
|
4639
|
+
try { motionStorage.removeItem(storageKey) } catch {}
|
|
4640
|
+
const drafts = { ...data.motionDrafts }; delete drafts[key]
|
|
4641
|
+
set({ motionDrafts: drafts, motionWork: { ...data.motionWork, [key]: { busy: null, message: t('motion.saved', { revision: saved.revision, camera: saved.cameraId }) } },
|
|
4642
|
+
...(motionKey(data) === key ? { forms: { ...data.forms, renderCamera: saved.cameraId } } : {}) }); reload()
|
|
4643
|
+
} else motionWork(key, { busy: null, error: outcome.error?.code === 'MOTION_OUT_OF_FRAME' ? t('motion.savedOutOfFrame')
|
|
4644
|
+
: outcome.error?.code === 'MOTION_FRAME_UNVERIFIABLE' ? t('motion.savedUnverifiable') : t('motion.uncertain') })
|
|
4645
|
+
},
|
|
3946
4646
|
setCameraFitValue: (field, value) => {
|
|
3947
4647
|
const draft = cameraFitDraftFor(data), key = assemblyKey(data)
|
|
3948
4648
|
if (!draft || draft.attempt || cameraFitControllers.has(key) || !['cameraId', 'frame', 'marginPercent', 'entityIds'].includes(field)) return
|
|
@@ -3959,7 +4659,7 @@ window.__ModuleLoader__.load({
|
|
|
3959
4659
|
},
|
|
3960
4660
|
cancelCameraFit: () => cameraFitControllers.get(assemblyKey(data))?.abort(),
|
|
3961
4661
|
saveCameraFit: async () => {
|
|
3962
|
-
const draft = cameraFitDraftFor(data), key = assemblyKey(data)
|
|
4662
|
+
const draft = cameraFitDraftFor(data), key = assemblyKey(data), identity = data.storeIdentity, sourceMotionKey = motionKey(data), sourceMotion = motionDraftFor(data)
|
|
3963
4663
|
if (!draft || !data.cameraFitSupported || cameraFitControllers.has(key) || draft.storageError || Object.values(data.busy).some(Boolean)) return
|
|
3964
4664
|
if (!draft.attempt && (cameraFitInvalid(draft) || draft.baseRevision !== data.currentRevision || draft.baseRevision !== data.selected?.scene?.revision
|
|
3965
4665
|
|| projectHasUnsavedDrafts({ ...data, cameraFitDrafts: {} }))) return
|
|
@@ -3997,10 +4697,20 @@ window.__ModuleLoader__.load({
|
|
|
3997
4697
|
const drafts = { ...data.cameraFitDrafts }; delete drafts[key]
|
|
3998
4698
|
set({ cameraFitDrafts: drafts, cameraFitWork: { ...data.cameraFitWork, [key]: { result } } })
|
|
3999
4699
|
if (sameProject) {
|
|
4700
|
+
// Preserve a creator's edited motion intent. Only an untouched draft
|
|
4701
|
+
// bound to this exact source may follow the newly fitted camera.
|
|
4702
|
+
if (identity && data.storeIdentity === identity && data.motionDrafts[sourceMotionKey] === sourceMotion
|
|
4703
|
+
&& sourceMotion && sourceMotion.baseRevision === body.baseRevision && !sourceMotion.touched && !sourceMotion.result
|
|
4704
|
+
&& !data.motionWork[sourceMotionKey]?.busy && !motionControllers.has(sourceMotionKey)) {
|
|
4705
|
+
const entityIds = body.entityIds.every(id => sourceMotion.entities.some(entity => entity.id === id && entity.visible !== false))
|
|
4706
|
+
? [...body.entityIds] : sourceMotion.entityIds
|
|
4707
|
+
set({ motionDrafts: { ...data.motionDrafts, [sourceMotionKey]: { ...sourceMotion, baseRevision: result.revision,
|
|
4708
|
+
cameras: [...new Set([...sourceMotion.cameras, body.fittedCameraId])], cameraId: body.fittedCameraId, entityIds } } })
|
|
4709
|
+
}
|
|
4000
4710
|
const photography = data.photographyDrafts[draft.projectId]
|
|
4001
4711
|
if (photography && photography.projectsRoot === draft.projectsRoot && !photographyDirty(photography)) set({ photographyDrafts: {
|
|
4002
4712
|
...data.photographyDrafts, [draft.projectId]: { ...photography, cameraId: body.fittedCameraId, frame: body.frame } } })
|
|
4003
|
-
const notice = { ok: true, kind: 'camera-fit', projectId: draft.projectId, projectsRoot: draft.projectsRoot,
|
|
4713
|
+
const notice = { ok: true, kind: 'camera-fit', projectId: draft.projectId, projectsRoot: draft.projectsRoot, revision: result.revision,
|
|
4004
4714
|
message: t('fit.saved', { count: body.entityIds.length, revision: result.revision, frame: body.frame }) }
|
|
4005
4715
|
set({ view: 'preview', compareMode: 'result', notices: { ...data.notices, scene: notice, preview: notice } })
|
|
4006
4716
|
}
|
|
@@ -4071,6 +4781,7 @@ window.__ModuleLoader__.load({
|
|
|
4071
4781
|
},
|
|
4072
4782
|
setSnapshotRevision: value => setSnapshotSelection('revision', value),
|
|
4073
4783
|
setSnapshotVideo: value => setSnapshotSelection('videoJobId', value),
|
|
4784
|
+
setSnapshotImage,
|
|
4074
4785
|
prepareEditableSnapshot: () => snapshotRequest('prepare'),
|
|
4075
4786
|
checkEditableSnapshot: () => snapshotRequest('check'),
|
|
4076
4787
|
cancelEditableSnapshot: () => snapshotRequest('cancel'),
|
|
@@ -4139,9 +4850,11 @@ window.__ModuleLoader__.load({
|
|
|
4139
4850
|
beginNewWork: () => set({ view: 'projects', projectTask: 'new' }),
|
|
4140
4851
|
selectProject: (projectId) => {
|
|
4141
4852
|
if (projectId === data.activeProjectId) { reload(); return }
|
|
4853
|
+
motionControllers.get(motionKey(data))?.abort()
|
|
4142
4854
|
const operation = bundleOperations.get(data.activeProjectId)
|
|
4143
4855
|
if (operation && projectId !== data.activeProjectId) void cancelBundle(operation).catch(() => {})
|
|
4144
|
-
set({ projectId, selected: null, activeProjectId: null, editorEntityId: null, editorComparison: null, diff: null, diffError: null, compareLeft: null, compareRight: null
|
|
4856
|
+
set({ projectId, selected: null, activeProjectId: null, editorEntityId: null, editorComparison: null, diff: null, diffError: null, compareLeft: null, compareRight: null,
|
|
4857
|
+
forms: { ...data.forms, renderCamera: '' } })
|
|
4145
4858
|
reload()
|
|
4146
4859
|
},
|
|
4147
4860
|
reload,
|
|
@@ -4351,7 +5064,7 @@ window.__ModuleLoader__.load({
|
|
|
4351
5064
|
updateAsset: (field, value) => {
|
|
4352
5065
|
const projectId = data.activeProjectId, current = data.assetDrafts[projectId]
|
|
4353
5066
|
if (!current || data.assetWork[projectId]?.busy) return
|
|
4354
|
-
const allowed = ['newEntityId', 'location', 'rotationEuler', 'scale', 'entityId', 'target', 'partId', 'slotIndex', 'scope', 'newMaterial', 'channel', 'binding', 'replaceTexture', 'strength', 'rotation']
|
|
5067
|
+
const allowed = ['newEntityId', 'location', 'rotationEuler', 'scale', 'hideEntityId', 'makeSubject', 'entityId', 'target', 'partId', 'slotIndex', 'scope', 'newMaterial', 'channel', 'binding', 'replaceTexture', 'strength', 'rotation']
|
|
4355
5068
|
if (!allowed.includes(field)) return
|
|
4356
5069
|
const draft = editorClone(current); draft[field] = editorClone(value)
|
|
4357
5070
|
if (['entityId', 'target'].includes(field)) { draft.partId = ''; draft.slotIndex = '' }
|
|
@@ -4505,15 +5218,58 @@ window.__ModuleLoader__.load({
|
|
|
4505
5218
|
setVisualIterations: value => {
|
|
4506
5219
|
if (Number.isInteger(value) && value >= 1 && value <= 3) set({ visualIterations: { ...data.visualIterations, [data.activeProjectId]: value } })
|
|
4507
5220
|
},
|
|
5221
|
+
setReviewMode: mode => {
|
|
5222
|
+
const choice = reviewSelectionFor(data)
|
|
5223
|
+
if (!choice || data.visualRuns[data.activeProjectId]?.busy || !['selected', 'standard'].includes(mode)
|
|
5224
|
+
|| mode === 'selected' && !data.selectedReviewViewsSupported) return
|
|
5225
|
+
set({ reviewSelections: { ...data.reviewSelections, [reviewSelectionKey(data)]: { ...editorClone(choice), mode } } })
|
|
5226
|
+
},
|
|
5227
|
+
resetReviewSelection: () => {
|
|
5228
|
+
if (data.visualRuns[data.activeProjectId]?.busy) return
|
|
5229
|
+
const choices = { ...data.reviewSelections }; delete choices[reviewSelectionKey(data)]; set({ reviewSelections: choices })
|
|
5230
|
+
},
|
|
5231
|
+
updateReviewView: (index, field, value) => {
|
|
5232
|
+
const choice = reviewSelectionFor(data)
|
|
5233
|
+
if (!choice || choice.baseRevision !== data.selected?.scene?.revision || data.visualRuns[data.activeProjectId]?.busy
|
|
5234
|
+
|| !['cameraId', 'frame'].includes(field) || !choice.views[index]) return
|
|
5235
|
+
const next = editorClone(choice); next.views[index][field] = value
|
|
5236
|
+
set({ reviewSelections: { ...data.reviewSelections, [reviewSelectionKey(data)]: next } })
|
|
5237
|
+
},
|
|
5238
|
+
addReviewView: () => {
|
|
5239
|
+
const choice = reviewSelectionFor(data), scene = data.selected?.scene
|
|
5240
|
+
if (!choice || choice.baseRevision !== scene?.revision || choice.views.length >= 4 || data.visualRuns[data.activeProjectId]?.busy) return
|
|
5241
|
+
const next = editorClone(choice), camera = scene.nodes.cameras.find(camera => !choice.views.some(view => view.cameraId === camera.id)) || scene.nodes.cameras[0]
|
|
5242
|
+
next.views.push({ id: `review-${next.views.length + 1}`, cameraId: camera?.id || '', frame: scene.project.frameStart })
|
|
5243
|
+
next.views = next.views.map((view, i) => ({ ...view, id: `review-${i + 1}` }))
|
|
5244
|
+
set({ reviewSelections: { ...data.reviewSelections, [reviewSelectionKey(data)]: next } })
|
|
5245
|
+
},
|
|
5246
|
+
removeReviewView: index => {
|
|
5247
|
+
const choice = reviewSelectionFor(data)
|
|
5248
|
+
if (!choice || choice.views.length <= 1 || !choice.views[index] || data.visualRuns[data.activeProjectId]?.busy) return
|
|
5249
|
+
const next = editorClone(choice); next.views.splice(index, 1); next.views = next.views.map((view, i) => ({ ...view, id: `review-${i + 1}` }))
|
|
5250
|
+
set({ reviewSelections: { ...data.reviewSelections, [reviewSelectionKey(data)]: next } })
|
|
5251
|
+
},
|
|
5252
|
+
useCompletedReviewViews: () => {
|
|
5253
|
+
const scene = data.selected?.scene, views = completedReviewViews(data)
|
|
5254
|
+
if (!scene || !views.length || !data.selectedReviewViewsSupported || data.visualRuns[data.activeProjectId]?.busy) return
|
|
5255
|
+
set({ reviewSelections: { ...data.reviewSelections, [reviewSelectionKey(data)]: { mode: 'selected', baseRevision: scene.revision, views } } })
|
|
5256
|
+
},
|
|
4508
5257
|
runVisual: async mode => {
|
|
4509
5258
|
const projectId = data.activeProjectId, revision = data.selected?.scene?.revision
|
|
4510
5259
|
if (!projectId || !revision || !data.briefDrafts[projectId] || !['review', 'autofix'].includes(mode) || data.visualRuns[projectId]?.busy
|
|
4511
5260
|
|| data.briefWork[projectId]?.saving || data.briefWork[projectId]?.uploading || projectHasUnsavedDrafts(data)
|
|
4512
5261
|
|| data.busy.editor || data.busy.patch || data.busy.restore) return
|
|
5262
|
+
const choice = reviewSelectionFor(data), selected = choice?.mode === 'selected'
|
|
5263
|
+
if (selected && (mode !== 'review' || !reviewSelectionValid(data, choice))) return
|
|
5264
|
+
const views = selected ? editorClone(choice.views) : null, expectedDigest = data.selected.scene.digest
|
|
4513
5265
|
set({ visualRuns: { ...data.visualRuns, [projectId]: { busy: true, mode, revision } } })
|
|
4514
5266
|
const outcome = await postJson(fetchImpl, projectRoute(projectId, `/${mode}`), { revision,
|
|
5267
|
+
...(selected ? { views, expectedStoreIdentity: data.storeIdentity, expectedDigest } : {}),
|
|
4515
5268
|
...(mode === 'autofix' ? { maxIterations: data.visualIterations[projectId] || 1 } : {}) })
|
|
4516
|
-
const
|
|
5269
|
+
const scope = outcome.payload?.review?.inputScope
|
|
5270
|
+
const sourceMismatch = selected && outcome.ok && (scope?.mode !== 'selected-views' || scope.sourceRevision !== revision || scope.sourceDigest !== expectedDigest
|
|
5271
|
+
|| JSON.stringify(scope.views?.map(({ id, cameraId, frame }) => ({ id, cameraId, frame }))) !== JSON.stringify(views))
|
|
5272
|
+
const reviewerError = sourceMismatch ? t('reviewView.mismatch') : outcome.payload?.review?.reviewerError || outcome.payload?.review?.referenceInputError?.message
|
|
4517
5273
|
const result = outcome.ok ? outcome.payload : null
|
|
4518
5274
|
set({ visualRuns: { ...data.visualRuns, [projectId]: { busy: false, mode, revision, result,
|
|
4519
5275
|
error: !outcome.ok ? `${outcome.error.code}: ${outcome.error.message}` : reviewerError || null } } })
|
|
@@ -4536,36 +5292,69 @@ window.__ModuleLoader__.load({
|
|
|
4536
5292
|
setPhotographySource: (field, value) => {
|
|
4537
5293
|
const projectId = data.activeProjectId, selection = data.photographyReuse[projectId] || {}
|
|
4538
5294
|
if (!data.cameraTargetResetSupported || !photographyDraftFor(data) || photographyBusy(data.photographyWork[projectId])) return
|
|
5295
|
+
let changes, load = false, revision
|
|
4539
5296
|
if (field === 'project') {
|
|
4540
5297
|
if (value && !data.projects.some(item => item.projectId === value && !item.creationPending)) return
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
} else if (field === '
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
set({ photographyReuse: { ...data.photographyReuse, [projectId]: { ...selection, replaceDraft: value } } })
|
|
5298
|
+
changes = { sourceProjectId: value, source: null, revisions: [], revision: '', cameraId: '', targetEntityId: '', replaceDraft: false }; load = Boolean(value)
|
|
5299
|
+
} else if (field === 'revision' && selection.revisions?.some(item => item.revision === value)) {
|
|
5300
|
+
changes = {}; load = true; revision = value
|
|
5301
|
+
} else if (field === 'camera' && selection.source?.nodes.cameras.some(item => item.id === value)) changes = { cameraId: value, targetEntityId: '', applied: false, unchanged: false }
|
|
5302
|
+
else if (field === 'target' && (!value || photographyDraftFor(data).entities.some(item => item.id === value))) changes = { targetEntityId: value, applied: false, unchanged: false }
|
|
5303
|
+
else if (field === 'replace' && typeof value === 'boolean') changes = { replaceDraft: value }
|
|
5304
|
+
else if (field === 'mode' && ['absolute', 'bounds'].includes(value) && (value !== 'bounds' || data.photographyBoundaryReuseSupported)) changes = { mode: value, applied: false, unchanged: false }
|
|
5305
|
+
else if (field === 'sourceFrame') changes = { sourceFrame: value, applied: false, unchanged: false }
|
|
5306
|
+
else if (['sourceEntityIds', 'destinationEntityIds'].includes(field) && Array.isArray(value) && value.length <= 128 && new Set(value).size === value.length) {
|
|
5307
|
+
const scene = field === 'sourceEntityIds' ? selection.source : data.selected?.scene
|
|
5308
|
+
if (value.every(id => photographyProductEntities(scene).some(e => e.id === id))) changes = { [field]: [...value].sort(), applied: false, unchanged: false }
|
|
4553
5309
|
}
|
|
5310
|
+
if (!changes) return
|
|
5311
|
+
photographySourceControllers.get(projectId)?.abort(); photographySourceControllers.delete(projectId)
|
|
5312
|
+
set({ photographyReuse: { ...data.photographyReuse, [projectId]: { ...selection, planning: false, loading: false, error: null, ...changes } } })
|
|
5313
|
+
if (load) return loadPhotographySource(revision)
|
|
4554
5314
|
},
|
|
4555
5315
|
reloadPhotographySource: () => loadPhotographySource(data.photographyReuse[data.activeProjectId]?.revision),
|
|
4556
|
-
|
|
5316
|
+
cancelPhotographyReuse: () => {
|
|
5317
|
+
const projectId = data.activeProjectId
|
|
5318
|
+
photographySourceControllers.get(projectId)?.abort(); photographySourceControllers.delete(projectId)
|
|
5319
|
+
set({ photographyReuse: { ...data.photographyReuse, [projectId]: { ...data.photographyReuse[projectId], planning: false } } })
|
|
5320
|
+
},
|
|
5321
|
+
reusePhotography: async () => {
|
|
4557
5322
|
const projectId = data.activeProjectId, selection = data.photographyReuse[projectId], draft = photographyDraftFor(data)
|
|
4558
|
-
if (!data.cameraTargetResetSupported || !draft || !selection?.source || selection.loading || photographyBusy(data.photographyWork[projectId])
|
|
5323
|
+
if (!data.cameraTargetResetSupported || !draft || !selection?.source || selection.loading || selection.planning || photographyBusy(data.photographyWork[projectId])
|
|
4559
5324
|
|| selection.projectsRoot !== data.projectsRoot || draft.projectsRoot !== data.projectsRoot
|
|
4560
5325
|
|| selection.baseRevision !== draft.baseRevision || draft.baseRevision !== data.selected?.scene?.revision
|
|
4561
5326
|
|| (photographyDirty(draft) && !selection.replaceDraft)) return
|
|
5327
|
+
let controller
|
|
4562
5328
|
try {
|
|
4563
|
-
|
|
5329
|
+
let next
|
|
5330
|
+
if (selection.mode === 'bounds') {
|
|
5331
|
+
const request = photographyBoundaryRequest(data, selection, draft)
|
|
5332
|
+
if (!request) throw new Error(t('photo.boundsInvalid'))
|
|
5333
|
+
const signature = creationSignature(draft), root = data.projectsRoot
|
|
5334
|
+
controller = new AbortController(); photographySourceControllers.set(projectId, controller)
|
|
5335
|
+
set({ photographyReuse: { ...data.photographyReuse, [projectId]: { ...selection, planning: true, error: null } } })
|
|
5336
|
+
const outcome = await postJson(fetchImpl, projectRoute(projectId, '/photography-reuse'), request, controller.signal)
|
|
5337
|
+
if (!running || controller.signal.aborted || photographySourceControllers.get(projectId) !== controller) return
|
|
5338
|
+
const current = data.photographyReuse[projectId], currentDraft = photographyDraftFor(data)
|
|
5339
|
+
if (data.activeProjectId !== projectId || data.projectsRoot !== root
|
|
5340
|
+
|| creationSignature(currentDraft) !== signature
|
|
5341
|
+
|| creationSignature(photographyBoundaryRequest(data, current, currentDraft)) !== creationSignature(request)) {
|
|
5342
|
+
if (data.activeProjectId === projectId && data.projectsRoot === root) throw new Error(t('photo.boundsChanged'))
|
|
5343
|
+
return
|
|
5344
|
+
}
|
|
5345
|
+
if (!outcome.ok) throw new Error(`${outcome.error.code}: ${outcome.error.message}`)
|
|
5346
|
+
next = applyBoundaryPhotography(draft, selection.source, outcome.payload.plan, request)
|
|
5347
|
+
} else next = reusePhotography(draft, selection.source, selection.cameraId, selection.targetEntityId)
|
|
4564
5348
|
set({ photographyDrafts: { ...data.photographyDrafts, [projectId]: next }, photographyReuse: {
|
|
4565
|
-
...data.photographyReuse, [projectId]: { ...
|
|
5349
|
+
...data.photographyReuse, [projectId]: { ...data.photographyReuse[projectId], replaceDraft: false, error: null, planning: false, applied: photographyDirty(next), unchanged: !photographyDirty(next) },
|
|
4566
5350
|
} })
|
|
4567
5351
|
} catch (error) {
|
|
4568
|
-
set({ photographyReuse: { ...data.photographyReuse, [projectId]: { ...
|
|
5352
|
+
if (!controller || !controller.signal.aborted) set({ photographyReuse: { ...data.photographyReuse, [projectId]: { ...data.photographyReuse[projectId], applied: false, planning: false, error: error.message || String(error) } } })
|
|
5353
|
+
} finally {
|
|
5354
|
+
if (controller && photographySourceControllers.get(projectId) === controller) {
|
|
5355
|
+
photographySourceControllers.delete(projectId)
|
|
5356
|
+
if (running) set({ photographyReuse: { ...data.photographyReuse, [projectId]: { ...data.photographyReuse[projectId], planning: false } } })
|
|
5357
|
+
}
|
|
4569
5358
|
}
|
|
4570
5359
|
},
|
|
4571
5360
|
updatePhotography: (kind, path, value) => {
|
|
@@ -4706,6 +5495,45 @@ window.__ModuleLoader__.load({
|
|
|
4706
5495
|
const draft = createEditorDraft(scene, current.projectId, current.entityId)
|
|
4707
5496
|
set({ editorDrafts: { ...data.editorDrafts, [editorKey(current.projectId, current.entityId)]: draft }, notices: { ...data.notices, scene: null } })
|
|
4708
5497
|
},
|
|
5498
|
+
setEditorHalfLap: (partner, role) => {
|
|
5499
|
+
const current = editorDraftFor(data)
|
|
5500
|
+
if (!current || data.busy.editor || current.baseRevision !== data.selected?.scene?.revision) return
|
|
5501
|
+
if (partner && !editorHalfLapPartners(current).some(entity => entity.id === partner)) return
|
|
5502
|
+
const { entityId } = current
|
|
5503
|
+
const halfLap = !partner ? null : role === 'upper'
|
|
5504
|
+
? { lowerEntityId: partner, upperEntityId: entityId }
|
|
5505
|
+
: { lowerEntityId: entityId, upperEntityId: partner }
|
|
5506
|
+
set({ editorDrafts: { ...data.editorDrafts, [editorKey(current.projectId, entityId)]: { ...current, halfLap } } })
|
|
5507
|
+
},
|
|
5508
|
+
cancelHalfLapPreview: () => {
|
|
5509
|
+
halfLapPreviewController?.abort()
|
|
5510
|
+
halfLapPreviewController = undefined
|
|
5511
|
+
set({ halfLapPreview: null })
|
|
5512
|
+
},
|
|
5513
|
+
previewHalfLap: async () => {
|
|
5514
|
+
const intent = halfLapPreviewIntent(data)
|
|
5515
|
+
if (!intent || data.busy.editor || halfLapPreviewController) return
|
|
5516
|
+
const controller = new AbortController()
|
|
5517
|
+
halfLapPreviewController = controller
|
|
5518
|
+
const { key, patch, expectedDigest, expectedStoreIdentity } = intent
|
|
5519
|
+
const active = () => running && halfLapPreviewController === controller && !controller.signal.aborted
|
|
5520
|
+
set({ halfLapPreview: { key, busy: true } })
|
|
5521
|
+
try {
|
|
5522
|
+
const response = await fetchImpl(projectRoute(patch.projectId, '/half-lap-preview'), {
|
|
5523
|
+
method: 'POST', headers: { 'content-type': 'application/json', accept: 'application/json' }, signal: controller.signal,
|
|
5524
|
+
body: JSON.stringify({ patch, expectedDigest, expectedStoreIdentity }),
|
|
5525
|
+
})
|
|
5526
|
+
const payload = await response.json()
|
|
5527
|
+
if (!active()) return
|
|
5528
|
+
if (!response.ok || !payload.ok) throw new Error(payload.error?.message || response.status)
|
|
5529
|
+
if (!verifiedHalfLapPreview(payload.preview, intent)) throw new Error(t('inspection.mismatch'))
|
|
5530
|
+
set({ halfLapPreview: { key, result: payload.preview } })
|
|
5531
|
+
} catch (error) {
|
|
5532
|
+
if (active()) set({ halfLapPreview: { key, error: error.message || String(error) } })
|
|
5533
|
+
} finally {
|
|
5534
|
+
if (halfLapPreviewController === controller) halfLapPreviewController = undefined
|
|
5535
|
+
}
|
|
5536
|
+
},
|
|
4709
5537
|
updateEditor: (section, path, value) => {
|
|
4710
5538
|
const current = editorDraftFor(data)
|
|
4711
5539
|
if (!current || data.busy.editor || !['transform', 'generator', 'modifiers', 'material', 'uvProjection'].includes(section)) return
|
|
@@ -4769,10 +5597,13 @@ window.__ModuleLoader__.load({
|
|
|
4769
5597
|
try { patch = buildEditorPatch(draft) } catch (error) {
|
|
4770
5598
|
setIn('notices', 'scene', { ok: false, message: error.message }); return
|
|
4771
5599
|
}
|
|
4772
|
-
if (!patch.operations.length) return
|
|
5600
|
+
if (!patch.operations.length || data.halfLapPreview?.busy) return
|
|
5601
|
+
const inspection = data.halfLapPreview?.result
|
|
5602
|
+
const inspected = inspection && halfLapPreviewIntent(data, draft, patch)?.key === data.halfLapPreview.key
|
|
5603
|
+
const request = inspected ? { patch, expectedSpecHash: inspection.candidateSpecHash, expectedStoreIdentity: inspection.storeIdentity } : { patch }
|
|
4773
5604
|
const beforePreviews = editorClone(data.previews?.revisions?.find(item => item.revision === draft.baseRevision)?.previews || [])
|
|
4774
5605
|
setIn('busy', 'editor', true)
|
|
4775
|
-
const outcome = await postJson(fetchImpl, projectRoute(draft.projectId, '/patch'),
|
|
5606
|
+
const outcome = await postJson(fetchImpl, projectRoute(draft.projectId, '/patch'), request)
|
|
4776
5607
|
setIn('busy', 'editor', false)
|
|
4777
5608
|
if (outcome.ok) {
|
|
4778
5609
|
const revision = outcome.payload.revision.revision
|
|
@@ -5018,6 +5849,31 @@ window.__ModuleLoader__.load({
|
|
|
5018
5849
|
startRender: async (resumeJobId) => {
|
|
5019
5850
|
const projectId = data.activeProjectId, scene = data.selected?.scene
|
|
5020
5851
|
if (!projectId || !scene?.revision || data.busy.render) return
|
|
5852
|
+
const cameraId = data.forms.renderCamera || ''
|
|
5853
|
+
if (resumeJobId === undefined && cameraId && !scene.nodes?.cameras?.some(camera => camera.id === cameraId)) {
|
|
5854
|
+
setIn('notices', 'jobs', { ok: false, message: t('jobs.cameraMissing') }); return
|
|
5855
|
+
}
|
|
5856
|
+
const selectedSize = data.forms.stillPreset || ''
|
|
5857
|
+
const videoPreset = selectedSize === 'video-1920x1080' ? selectedSize : ''
|
|
5858
|
+
const stillPreset = videoPreset ? '' : selectedSize
|
|
5859
|
+
if (resumeJobId === undefined && stillPreset && !data.stillDeliveryPresetSupported) {
|
|
5860
|
+
setIn('notices', 'jobs', { ok: false, message: t('jobs.stillUnsupported') }); return
|
|
5861
|
+
}
|
|
5862
|
+
const deliveryKind = data.forms.deliveryKind || ''
|
|
5863
|
+
if (resumeJobId === undefined && deliveryKind && !data.stillImageDeliverySupported) {
|
|
5864
|
+
setIn('notices', 'jobs', { ok: false, message: t('jobs.stillKindUnsupported') }); return
|
|
5865
|
+
}
|
|
5866
|
+
if (resumeJobId === undefined && videoPreset && !data.videoDeliveryPresetSupported) {
|
|
5867
|
+
setIn('notices', 'jobs', { ok: false, message: t('jobs.videoPresetUnsupported') }); return
|
|
5868
|
+
}
|
|
5869
|
+
if (resumeJobId === undefined && videoPreset && deliveryKind) {
|
|
5870
|
+
setIn('notices', 'jobs', { ok: false, message: t('jobs.videoPresetInvalid') }); return
|
|
5871
|
+
}
|
|
5872
|
+
const start = data.forms.frameStart === '' ? scene.project.frameStart : Number(data.forms.frameStart)
|
|
5873
|
+
const end = data.forms.frameEnd === '' ? scene.project.frameEnd : Number(data.forms.frameEnd)
|
|
5874
|
+
if (resumeJobId === undefined && (stillPreset || deliveryKind) && (!Number.isSafeInteger(start) || start !== end)) {
|
|
5875
|
+
setIn('notices', 'jobs', { ok: false, message: t('jobs.stillRange') }); return
|
|
5876
|
+
}
|
|
5021
5877
|
// Snapshot before notifying subscribers: a project switch or a concurrent
|
|
5022
5878
|
// save must not change the scene or settings this click asked to render.
|
|
5023
5879
|
const request = resumeJobId === undefined ? {
|
|
@@ -5025,6 +5881,10 @@ window.__ModuleLoader__.load({
|
|
|
5025
5881
|
frameStart: data.forms.frameStart === '' ? undefined : Number(data.forms.frameStart),
|
|
5026
5882
|
frameEnd: data.forms.frameEnd === '' ? undefined : Number(data.forms.frameEnd),
|
|
5027
5883
|
profile: data.forms.profile,
|
|
5884
|
+
...(stillPreset ? { stillPreset } : {}),
|
|
5885
|
+
...(videoPreset ? { videoPreset } : {}),
|
|
5886
|
+
...(deliveryKind ? { deliveryKind } : {}),
|
|
5887
|
+
...(cameraId ? { cameraId } : {}),
|
|
5028
5888
|
} : { resumeJobId }
|
|
5029
5889
|
setIn('busy', 'render', true)
|
|
5030
5890
|
const outcome = await postJson(fetchImpl, projectRoute(projectId, '/render'), request)
|
|
@@ -5091,8 +5951,17 @@ window.__ModuleLoader__.load({
|
|
|
5091
5951
|
fileChoicesStopped = true
|
|
5092
5952
|
data = { ...data, fileChoiceGeneration: data.fileChoiceGeneration + 1 }
|
|
5093
5953
|
running = false
|
|
5954
|
+
imageProbeController?.abort(); imageProbeController = null
|
|
5955
|
+
data = { ...data, imageInputProbe: { busy: false, result: null } }
|
|
5956
|
+
snapshot = { ...snapshot, imageInputProbe: data.imageInputProbe }
|
|
5094
5957
|
if (timer !== null) { clearInterval(timer); timer = null }
|
|
5958
|
+
for (const controller of photographySourceControllers.values()) controller.abort()
|
|
5959
|
+
photographySourceControllers.clear()
|
|
5095
5960
|
for (const controller of photographyControllers.values()) controller.abort()
|
|
5961
|
+
for (const controller of motionControllers.values()) controller.abort()
|
|
5962
|
+
motionControllers.clear()
|
|
5963
|
+
halfLapPreviewController?.abort()
|
|
5964
|
+
halfLapPreviewController = undefined
|
|
5096
5965
|
photographyControllers.clear()
|
|
5097
5966
|
for (const controller of placementControllers.values()) controller.abort()
|
|
5098
5967
|
placementControllers.clear()
|
|
@@ -5187,6 +6056,7 @@ window.__ModuleLoader__.load({
|
|
|
5187
6056
|
)
|
|
5188
6057
|
return el('div', { 'data-view': 'projects' },
|
|
5189
6058
|
ErrorBox({ error: state.error }),
|
|
6059
|
+
ProjectStorageNotice(state),
|
|
5190
6060
|
el('section', { className: 'db-card db-project-create', 'aria-label': t('projects.create') },
|
|
5191
6061
|
el('h2', { className: 'db-start-title' }, t('lighttable.beginTitle')),
|
|
5192
6062
|
el('p', { className: 'db-start-intro' }, t('lighttable.beginHint')),
|
|
@@ -5203,7 +6073,7 @@ window.__ModuleLoader__.load({
|
|
|
5203
6073
|
el('div', { className: 'db-inline' },
|
|
5204
6074
|
Button({ action: 'retry-creation', disabled: state.busy.create, onClick: actions.retryCreation, children: t('projects.retryCreation') }),
|
|
5205
6075
|
Button({ action: 'refresh-creation-projects', onClick: actions.reload, children: t('projects.refreshList') }),
|
|
5206
|
-
|
|
6076
|
+
creationEnvironmentError(state.creationWork.code)
|
|
5207
6077
|
? el('a', { href: 'https://github.com/pearjelly/deep-blend/blob/main/deepblend/docs/environment-check.md', target: '_blank', rel: 'noreferrer' }, t('projects.environmentGuide')) : null),
|
|
5208
6078
|
state.notices.projects?.technicalDetails ? el('details', { 'data-creation-diagnostics': true },
|
|
5209
6079
|
el('summary', null, t('projects.creationDetails')), el('pre', { className: 'db-pre' }, state.notices.projects.technicalDetails)) : null,
|
|
@@ -5327,14 +6197,38 @@ window.__ModuleLoader__.load({
|
|
|
5327
6197
|
const projectId = state.activeProjectId, run = state.visualRuns[projectId], work = state.briefWork[projectId]
|
|
5328
6198
|
const dirty = projectHasUnsavedDrafts(state), disabled = !projectId || !state.briefDrafts[projectId] || run?.busy || work?.saving || work?.uploading || dirty
|
|
5329
6199
|
|| state.busy.editor || state.busy.patch || state.busy.restore
|
|
6200
|
+
const choice = reviewSelectionFor(state), scene = state.selected?.scene, selected = choice?.mode === 'selected'
|
|
6201
|
+
const stale = choice && choice.baseRevision !== scene?.revision, invalid = selected && !reviewSelectionValid(state, choice)
|
|
5330
6202
|
return el('div', { className: 'db-card', 'data-visual-actions': true, 'data-review-busy': String(Boolean(run?.busy)) },
|
|
5331
|
-
el('
|
|
6203
|
+
choice ? el('label', { className: 'db-row' }, t('reviewView.title'), el('select', { className: 'db-input', 'data-field': 'review-view-mode', value: choice.mode,
|
|
6204
|
+
disabled, onChange: event => actions.setReviewMode(event.target.value) },
|
|
6205
|
+
el('option', { value: 'selected', disabled: !state.selectedReviewViewsSupported }, t('reviewView.selected')),
|
|
6206
|
+
el('option', { value: 'standard' }, t('reviewView.standard')))) : null,
|
|
6207
|
+
selected ? el('div', { 'data-review-selection': choice.baseRevision },
|
|
6208
|
+
el('p', { className: 'db-muted' }, t('reviewView.help')),
|
|
6209
|
+
Button({ action: 'review-use-images', disabled: disabled || !completedReviewViews(state).length, onClick: actions.useCompletedReviewViews, children: t('reviewView.fromImages') }),
|
|
6210
|
+
choice.views.map((view, index) => el('div', { key: view.id, className: 'db-inline', style: { marginTop: '8px', flexWrap: 'wrap' } },
|
|
6211
|
+
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,
|
|
6212
|
+
onChange: event => actions.updateReviewView(index, 'cameraId', event.target.value) },
|
|
6213
|
+
!scene.nodes.cameras.some(camera => camera.id === view.cameraId) ? el('option', { value: view.cameraId, disabled: true }, t('inspection.cameraUnavailable', { camera: view.cameraId })) : null,
|
|
6214
|
+
scene.nodes.cameras.map(camera => el('option', { key: camera.id, value: camera.id }, camera.id)))),
|
|
6215
|
+
el('label', null, t('inspection.frame'), el('input', { type: 'number', className: 'db-input', style: { width: '100px' }, 'data-field': `review-frame-${index}`,
|
|
6216
|
+
min: scene.project.frameStart, max: scene.project.frameEnd, step: 1, value: view.frame, disabled: disabled || stale,
|
|
6217
|
+
onChange: event => actions.updateReviewView(index, 'frame', event.target.value === '' ? '' : Number(event.target.value)) })),
|
|
6218
|
+
Button({ action: `review-remove-${index}`, disabled: disabled || choice.views.length <= 1 || stale, onClick: () => actions.removeReviewView(index), children: t('reviewView.remove') }))),
|
|
6219
|
+
el('div', { className: 'db-inline', style: { marginTop: '8px' } },
|
|
6220
|
+
Button({ action: 'review-add-view', disabled: disabled || choice.views.length >= 4 || stale, onClick: actions.addReviewView, children: t('reviewView.add') }),
|
|
6221
|
+
Button({ action: 'review-reset-views', disabled: Boolean(run?.busy), onClick: actions.resetReviewSelection, children: t('reviewView.reset') })),
|
|
6222
|
+
stale ? el('p', { className: 'db-error', role: 'status' }, t('reviewView.stale'))
|
|
6223
|
+
: invalid ? el('p', { className: 'db-error', role: 'status' }, t('reviewView.invalid')) : null,
|
|
6224
|
+
el('p', { className: 'db-muted' }, t('reviewView.noAutofix'))) : el('div', null,
|
|
6225
|
+
el('p', { className: 'db-muted' }, t('brief.reviewCost')), el('p', { className: 'db-muted' }, t('reviewView.standardHelp'))),
|
|
5332
6226
|
dirty ? el('p', { className: 'db-muted' }, t('brief.pending')) : null,
|
|
5333
6227
|
el('div', { className: 'db-inline' },
|
|
5334
|
-
Button({ action: 'project-review', disabled, onClick: () => actions.runVisual('review'), children: t('brief.review') }),
|
|
6228
|
+
Button({ action: 'project-review', disabled: disabled || invalid, onClick: () => actions.runVisual('review'), children: t('brief.review') }),
|
|
5335
6229
|
el('label', null, t('brief.iterations'), el('select', { className: 'db-input', 'data-field': 'review-iterations', value: state.visualIterations[projectId] || 1,
|
|
5336
|
-
disabled, onChange: event => actions.setVisualIterations(Number(event.target.value)) }, [1, 2, 3].map(value => el('option', { key: value, value }, String(value))))),
|
|
5337
|
-
Button({ action: 'project-autofix', disabled, onClick: () => actions.runVisual('autofix'), children: t('brief.autofix') })),
|
|
6230
|
+
disabled: disabled || selected, onChange: event => actions.setVisualIterations(Number(event.target.value)) }, [1, 2, 3].map(value => el('option', { key: value, value }, String(value))))),
|
|
6231
|
+
Button({ action: 'project-autofix', disabled: disabled || selected, onClick: () => actions.runVisual('autofix'), children: t('brief.autofix') })),
|
|
5338
6232
|
run?.busy ? el('p', { role: 'status' }, run.mode === 'review' ? t('brief.reviewing') : t('brief.fixing')) : null,
|
|
5339
6233
|
run?.error ? el('p', { className: 'db-error', role: 'alert', 'data-review-error': true }, run.error) : null,
|
|
5340
6234
|
run?.result && !run.error ? el('p', { 'data-review-result': run.mode, className: 'db-muted' }, run.mode === 'review'
|
|
@@ -5398,8 +6292,11 @@ window.__ModuleLoader__.load({
|
|
|
5398
6292
|
/** A result line, in the two shapes the panel already used. */
|
|
5399
6293
|
function placementPreviewNotice(state) {
|
|
5400
6294
|
const notice = state.notices?.preview
|
|
5401
|
-
|
|
5402
|
-
|
|
6295
|
+
if (!['assembly-placement', 'camera-fit'].includes(notice?.kind) || notice.projectId !== state.activeProjectId
|
|
6296
|
+
|| notice.projectsRoot !== state.projectsRoot) return null
|
|
6297
|
+
if (notice.kind === 'camera-fit' && notice.revision && lighttableResult(state).artifact?.sourceRevision !== notice.revision)
|
|
6298
|
+
return { ...notice, message: t('fit.savedOtherPreview', { revision: notice.revision }) }
|
|
6299
|
+
return notice
|
|
5403
6300
|
}
|
|
5404
6301
|
|
|
5405
6302
|
function Notice(result, style) {
|
|
@@ -5536,6 +6433,16 @@ window.__ModuleLoader__.load({
|
|
|
5536
6433
|
const vector = (title, prefix, value, update, factor = 1000, locks = []) => el('div', null, el('strong', null, title),
|
|
5537
6434
|
EDITOR_AXES.map((axis, index) => numeric(axis.toUpperCase(), `${prefix}-${axis}`, value?.[index], next => update(index, next), { factor, disabled: locks[index] })))
|
|
5538
6435
|
const geometry = draft.entity.generator
|
|
6436
|
+
const halfLapPartners = editorHalfLapPartners(draft)
|
|
6437
|
+
const halfLapPartner = editorHalfLapPartner(draft.halfLap, draft.entityId)
|
|
6438
|
+
const halfLapRole = draft.halfLap?.upperEntityId === draft.entityId ? 'upper' : 'lower'
|
|
6439
|
+
const halfLapOptions = halfLapPartners.map(entity => [entity.id, entity.id])
|
|
6440
|
+
if (halfLapPartner && !halfLapPartners.some(entity => entity.id === halfLapPartner)) halfLapOptions.push([halfLapPartner, halfLapPartner])
|
|
6441
|
+
const slotIntent = halfLapPreviewIntent(state, draft)
|
|
6442
|
+
const slotWork = slotIntent && state.halfLapPreview?.key === slotIntent.key ? state.halfLapPreview : null
|
|
6443
|
+
const slotResult = slotWork?.result
|
|
6444
|
+
const apply = Button({ action: 'editor-apply', tone: 'primary',
|
|
6445
|
+
disabled: disabled || !dirty || errors.length > 0 || slotWork?.busy === true, onClick: actions.applyEditor, children: t('editor.apply') })
|
|
5539
6446
|
const geometryField = key => {
|
|
5540
6447
|
const bounds = generatorIntegerBounds(geometry, key)
|
|
5541
6448
|
if (key === 'rootTension') return numeric(labels[key], `editor-generator-${key}`, geometry[key],
|
|
@@ -5621,7 +6528,15 @@ window.__ModuleLoader__.load({
|
|
|
5621
6528
|
invalid: draft.uvProjection.scale < 0.0001 || draft.uvProjection.scale > 10000,
|
|
5622
6529
|
error: t('editor.uv.scaleInvalid') }),
|
|
5623
6530
|
el('p', { className: 'db-muted', key: 'uv-scale-help' }, t('editor.uv.scaleHelp')),
|
|
5624
|
-
] : null)
|
|
6531
|
+
] : null),
|
|
6532
|
+
halfLapOptions.length ? el('fieldset', { key: 'half-lap', 'data-half-lap-editor': true, disabled, style: { border: 0, padding: 0, margin: '16px 0' } },
|
|
6533
|
+
el('legend', null, t('editor.halfLap.title')),
|
|
6534
|
+
el('p', { className: 'db-muted' }, t('editor.halfLap.help')),
|
|
6535
|
+
choose(t('editor.halfLap.partner'), 'editor-half-lap-partner', halfLapPartner,
|
|
6536
|
+
[['', t('editor.halfLap.none')], ...halfLapOptions], partner => actions.setEditorHalfLap(partner, halfLapRole)),
|
|
6537
|
+
halfLapPartner ? choose(t('editor.halfLap.role'), 'editor-half-lap-role', halfLapRole,
|
|
6538
|
+
[['lower', t('editor.halfLap.lower')], ['upper', t('editor.halfLap.upper')]], role => actions.setEditorHalfLap(halfLapPartner, role)) : null,
|
|
6539
|
+
slotIntent ? HalfLapPreview({ slotWork, apply, disabled, actions }) : null) : null] : null,
|
|
5625
6540
|
el('p', { className: 'db-muted', key: 'local-size' }, t('editor.localDimensions', { scale: (draft.entity.transform.scale || [1, 1, 1]).join(' × ') })),
|
|
5626
6541
|
geometry.shape === 'rounded_box' ? el('p', { className: 'db-muted', key: 'rounded' }, t('editor.roundedRequired')) : null,
|
|
5627
6542
|
geometry.shape === 'handled_cup' ? el('p', { className: 'db-muted', key: 'cup-help' }, t('editor.cupHelp')) : null,
|
|
@@ -5731,18 +6646,45 @@ window.__ModuleLoader__.load({
|
|
|
5731
6646
|
el('div', { className: 'db-inline' }, Object.entries(modifierNames).map(([type, name]) => Button({ action: `editor-modifier-add-${type}`, disabled: disabled || !canModify || draft.entity.modifiers.length >= 8,
|
|
5732
6647
|
children: t('editor.add', { name }), onClick: () => actions.editEditorList('modifiers', 0, 'add', type) })))) : null,
|
|
5733
6648
|
errors.length ? el('div', { className: 'db-error', 'data-editor-errors': true }, errors.join(' ')) : null,
|
|
5734
|
-
el('div', { className: 'db-inline db-editor-actions' },
|
|
6649
|
+
el('div', { className: 'db-inline db-editor-actions' }, slotResult ? null : apply,
|
|
5735
6650
|
Button({ action: 'editor-reset', disabled: state.busy.editor, onClick: actions.resetEditor, children: t('editor.reset') }),
|
|
5736
6651
|
Button({ action: 'editor-review-subject', disabled: disabled || draft.entity.visible === false || draft.entity.kind === 'empty'
|
|
5737
6652
|
|| state.briefWork[state.activeProjectId]?.saving || state.visualRuns[state.activeProjectId]?.busy,
|
|
5738
6653
|
onClick: () => actions.setReviewSubject(draft.entityId), children: t('brief.subjectShortcut') }), restore))
|
|
5739
6654
|
}
|
|
5740
6655
|
|
|
6656
|
+
function HalfLapPreview({ slotWork, apply, disabled, actions }) {
|
|
6657
|
+
const result = slotWork?.result
|
|
6658
|
+
const picture = (role, caption, label) => el('figure', { style: { margin: '12px 0' } },
|
|
6659
|
+
el('figcaption', { className: 'db-muted', style: { overflowWrap: 'anywhere' } }, caption),
|
|
6660
|
+
el('img', { src: `data:image/png;base64,${result[role].pngBase64}`, alt: label, width: 480, height: 320,
|
|
6661
|
+
'data-half-lap-slot': role, style: { display: 'block', width: '100%', height: 'auto', marginTop: '4px' } }))
|
|
6662
|
+
return el('div', { 'data-half-lap-inspection': result ? 'ready' : slotWork?.busy ? 'loading' : slotWork?.error ? 'error' : 'idle',
|
|
6663
|
+
'aria-busy': slotWork?.busy === true, style: { marginTop: '12px' } },
|
|
6664
|
+
result ? [
|
|
6665
|
+
el('p', { key: 'draft', className: 'db-muted', role: 'status' }, result.sample === 'partial' ? t('editor.halfLap.partial') : t('editor.halfLap.full')),
|
|
6666
|
+
el('p', { key: 'count', className: 'db-muted' }, t('editor.halfLap.count', { count: result.crossings, partial: result.partialCrossings })),
|
|
6667
|
+
el('div', { key: 'faces' },
|
|
6668
|
+
picture('lower', t('editor.halfLap.lowerPart', { name: result.joint.lowerEntityId }), t('editor.halfLap.lowerFace')),
|
|
6669
|
+
picture('upper', t('editor.halfLap.upperPart', { name: result.joint.upperEntityId }), t('editor.halfLap.upperFace'))),
|
|
6670
|
+
apply,
|
|
6671
|
+
] : [
|
|
6672
|
+
el('div', { key: 'actions', className: 'db-inline' },
|
|
6673
|
+
Button({ action: 'half-lap-preview', disabled: disabled || slotWork?.busy === true,
|
|
6674
|
+
children: slotWork?.busy ? t('editor.halfLap.inspecting') : t('editor.halfLap.inspect'), onClick: actions.previewHalfLap }),
|
|
6675
|
+
slotWork?.busy ? Button({ action: 'half-lap-preview-cancel', children: t('geometry.cancel'), onClick: actions.cancelHalfLapPreview }) : null),
|
|
6676
|
+
slotWork?.error ? el('p', { key: 'error', className: 'db-error', role: 'alert' }, t('editor.halfLap.inspectError', { message: slotWork.error })) : null,
|
|
6677
|
+
])
|
|
6678
|
+
}
|
|
6679
|
+
|
|
5741
6680
|
/** 场景树: the Scene Tree of the revision in view. */
|
|
5742
6681
|
function AssetsView({ state, actions }) {
|
|
5743
6682
|
const projectId = state.activeProjectId, library = state.assetLibraries?.[projectId], work = state.assetWork?.[projectId] || {}
|
|
5744
6683
|
const draft = state.assetDrafts?.[projectId], busy = Boolean(work.busy), limits = library?.limits, bundle = state.assetBundleSelections?.[projectId]
|
|
5745
6684
|
const conflict = Boolean(draft && draft.baseRevision !== state.selected?.scene?.revision)
|
|
6685
|
+
const sizeText = (dimensions, scale = 1) => Array.isArray(dimensions) && dimensions.length === 3 && Number.isFinite(scale) && scale > 0
|
|
6686
|
+
&& dimensions.every(value => Number.isFinite(value) && value >= 0 && Number.isFinite(value * scale))
|
|
6687
|
+
? dimensions.map(value => Number((value * scale).toPrecision(6))).join(' × ') : null
|
|
5746
6688
|
const update = (field, value) => actions.updateAsset(field, value)
|
|
5747
6689
|
const text = (label, field, value, change, extra = {}) => el('label', { className: 'db-row' }, label,
|
|
5748
6690
|
el('input', { className: 'db-input', 'aria-label': label, 'data-field': field, value, disabled: busy, onChange: event => change(event.target.value), ...extra }))
|
|
@@ -5810,7 +6752,8 @@ window.__ModuleLoader__.load({
|
|
|
5810
6752
|
result ? el('div', null, el('img', { 'data-asset-preview': entry.asset.id, alt: entry.originalName || entry.asset.id,
|
|
5811
6753
|
...dimensions, src: artifactUrl(`/deepblend/artifacts/${encodeURIComponent(projectId)}/`, result.preview), style: { width: '100%', height: 'auto', maxHeight: '240px', objectFit: 'contain' } }),
|
|
5812
6754
|
result.inspection.kind === 'environment' && result.preview.toneMapped ? el('p', { className: 'db-muted' }, t('assets.toneMapped')) : null,
|
|
5813
|
-
result.inspection.dimensions ? el('p',
|
|
6755
|
+
sizeText(result.inspection.dimensions) !== null ? el('p', { 'data-asset-dimensions': true }, `${t('assets.dimensions')}: ${sizeText(result.inspection.dimensions)}`) : null,
|
|
6756
|
+
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,
|
|
5814
6757
|
result.inspection.image ? el('p', null, `${result.inspection.image.width} × ${result.inspection.image.height}`) : null,
|
|
5815
6758
|
result.inspection.warnings?.length ? el('h5', null, t('assets.inspectionWarnings')) : null,
|
|
5816
6759
|
(result.inspection.warnings || []).map((warning, index) => el('p', { className: 'db-muted', key: index }, typeof warning === 'string' ? warning : warning.message || warning.code || '')),
|
|
@@ -5828,7 +6771,12 @@ window.__ModuleLoader__.load({
|
|
|
5828
6771
|
el('p', { className: 'db-muted' }, t('assets.modelHelp')),
|
|
5829
6772
|
text(t('assets.entityId'), 'asset-entity-id', draft.newEntityId, value => update('newEntityId', value)),
|
|
5830
6773
|
vector(t('editor.position'), 'location', draft.location, 1000), vector(t('editor.rotation'), 'rotationEuler', draft.rotationEuler, 180 / Math.PI),
|
|
5831
|
-
number(t('assets.scale'), 'asset-scale', draft.scale ?? '', value => update('scale', value), { min: 0.000001 })
|
|
6774
|
+
number(t('assets.scale'), 'asset-scale', draft.scale ?? '', value => update('scale', value), { min: 0.000001 }),
|
|
6775
|
+
sizeText(draft.inspection?.dimensions, draft.scale) !== null ? el('p', { 'data-asset-scaled-dimensions': true }, `${t('assets.scaledDimensions')}: ${sizeText(draft.inspection.dimensions, draft.scale)}`) : null,
|
|
6776
|
+
el('p', { className: 'db-muted' }, t('assets.hideHelp')),
|
|
6777
|
+
choose(t('assets.hideExisting'), 'asset-hide-existing', draft.hideEntityId, [['', t('assets.hideNone')],
|
|
6778
|
+
...draft.scene.nodes.entities.filter(entity => entity.visible !== false && !entity.locked && entity.kind !== 'empty').map(entity => [entity.id, entity.id])], value => update('hideEntityId', value)),
|
|
6779
|
+
check(t('assets.makeSubject'), 'asset-make-subject', draft.makeSubject, value => update('makeSubject', value))) : null,
|
|
5832
6780
|
draft.kind === 'environment' ? el('div', null,
|
|
5833
6781
|
el('p', { className: 'db-muted' }, t('assets.environmentHelp')),
|
|
5834
6782
|
number(t('assets.strength'), 'asset-world-strength', draft.strength ?? '', value => update('strength', value), { min: 0, max: 1000 }),
|
|
@@ -5904,7 +6852,7 @@ window.__ModuleLoader__.load({
|
|
|
5904
6852
|
const draft = photographyDraftFor(state), projectId = state.activeProjectId, work = state.photographyWork?.[projectId] || {}, edit = state.photographyEdits?.[projectId]
|
|
5905
6853
|
const busy = photographyBusy(work)
|
|
5906
6854
|
const conflict = draft && draft.baseRevision !== state.selected?.scene?.revision
|
|
5907
|
-
const disabled = busy || conflict, errors = draft ? photographyErrors(draft) : []
|
|
6855
|
+
const disabled = busy || conflict || state.photographyReuse?.[projectId]?.planning, errors = draft ? photographyErrors(draft) : []
|
|
5908
6856
|
const camera = draft?.cameras.find(item => item.id === draft.cameraId), light = draft?.lights.find(item => item.id === draft.lightId)
|
|
5909
6857
|
const update = (kind, path) => value => actions.updatePhotography(kind, path, value)
|
|
5910
6858
|
const numeric = (label, field, value, change, options = {}) => el('label', { className: 'db-row' }, label, el('input', {
|
|
@@ -5923,6 +6871,20 @@ window.__ModuleLoader__.load({
|
|
|
5923
6871
|
const aimLocked = camera && photographyAimLocked(draft, camera)
|
|
5924
6872
|
const reuse = state.photographyReuse?.[projectId] || {}, sourceCamera = reuse.source?.nodes.cameras.find(item => item.id === reuse.cameraId)?.definition
|
|
5925
6873
|
const reuseStale = reuse.source && (reuse.projectsRoot !== state.projectsRoot || reuse.baseRevision !== draft?.baseRevision || draft?.projectsRoot !== state.projectsRoot)
|
|
6874
|
+
const boundaryMode = reuse.mode === 'bounds', boundaryRequest = boundaryMode ? photographyBoundaryRequest(state, reuse, draft) : null
|
|
6875
|
+
const productMembers = (title, scene, field) => {
|
|
6876
|
+
const selected = reuse[field] || [], choices = photographyProductEntities(scene)
|
|
6877
|
+
const all = choices.filter(e => !e.tags?.includes('environment')).map(e => e.id)
|
|
6878
|
+
return Disclosure({ state, actions }, `photo-boundary:${field}`, title, { 'data-photography-members': field, style: { minWidth: 0 } },
|
|
6879
|
+
el('div', { className: 'db-inline' },
|
|
6880
|
+
Button({ action: `photo-members-all:${field}`, disabled: disabled || all.length > 128, onClick: () => actions.setPhotographySource(field, all), children: t('photo.boundsAll') }),
|
|
6881
|
+
Button({ action: `photo-members-clear:${field}`, disabled, onClick: () => actions.setPhotographySource(field, []), children: t('photo.boundsClear') })),
|
|
6882
|
+
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 } },
|
|
6883
|
+
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' },
|
|
6884
|
+
onChange: event => actions.setPhotographySource(field, event.target.checked ? [...selected, e.id] : selected.filter(id => id !== e.id)) }),
|
|
6885
|
+
el('span', { style: { overflowWrap: 'anywhere', minWidth: 0 } }, e.label || e.id)))))
|
|
6886
|
+
}
|
|
6887
|
+
|
|
5926
6888
|
return el('section', { className: 'db-card', 'data-photography-editor': projectId },
|
|
5927
6889
|
CameraFitEditor({ state, actions }),
|
|
5928
6890
|
el('h4', null, t('photo.title')), el('p', { className: 'db-muted' }, t('photo.help')),
|
|
@@ -5930,23 +6892,34 @@ window.__ModuleLoader__.load({
|
|
|
5930
6892
|
el('p', { className: 'db-muted', 'data-photography-base': draft.baseRevision }, t('photo.base', { revision: draft.baseRevision })),
|
|
5931
6893
|
conflict ? el('p', { className: 'db-error', 'data-photography-conflict': true }, t('photo.conflict', { before: draft.baseRevision, current: state.selected?.scene?.revision })) : null,
|
|
5932
6894
|
state.cameraTargetResetSupported ? el('div', { 'data-photography-reuse': true },
|
|
5933
|
-
el('h4', null, t('photo.reuseTitle')), el('p', { className: 'db-muted' }, t('photo.reuseHelp')),
|
|
6895
|
+
el('h4', null, t('photo.reuseTitle')), el('p', { className: 'db-muted' }, boundaryMode ? t('photo.boundsHelp') : t('photo.reuseHelp')),
|
|
6896
|
+
state.photographyBoundaryReuseSupported ? choose(t('photo.reuseMode'), 'source-mode', reuse.mode || 'absolute', [['absolute', t('photo.reuseAbsolute')], ['bounds', t('photo.reuseBounds')]], value => actions.setPhotographySource('mode', value))
|
|
6897
|
+
: 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,
|
|
5934
6898
|
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)),
|
|
5935
6899
|
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),
|
|
5936
6900
|
reuse.loading ? el('p', { role: 'status' }, t('photo.reuseReading')) : null,
|
|
5937
6901
|
reuse.source ? el('div', { 'data-photography-source': `${reuse.sourceProjectId}:${reuse.revision}` },
|
|
5938
6902
|
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 })),
|
|
5939
6903
|
choose(t('photo.reuseCamera'), 'source-camera', reuse.cameraId, reuse.source.nodes.cameras.map(item => [item.id, item.id]), value => actions.setPhotographySource('camera', value)),
|
|
5940
|
-
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,
|
|
6904
|
+
!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,
|
|
6905
|
+
boundaryMode ? el('div', null,
|
|
6906
|
+
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 }),
|
|
6907
|
+
el('p', { className: 'db-muted' }, t('photo.boundsPick')),
|
|
6908
|
+
productMembers(t('photo.boundsSource', { count: (reuse.sourceEntityIds || []).length }), reuse.source, 'sourceEntityIds'),
|
|
6909
|
+
productMembers(t('photo.boundsDestination', { count: (reuse.destinationEntityIds || []).length }), state.selected?.scene, 'destinationEntityIds'),
|
|
6910
|
+
!boundaryRequest ? el('p', { className: 'db-muted' }, t('photo.boundsInvalid')) : null) : null,
|
|
5941
6911
|
photographyDirty(draft) ? el('label', { className: 'db-row' }, el('input', { type: 'checkbox', 'data-field': 'photo-source-replace', checked: Boolean(reuse.replaceDraft), disabled: disabled || reuse.loading,
|
|
5942
6912
|
onChange: event => actions.setPhotographySource('replace', Boolean(event.target.checked)) }), t('photo.reuseReplace')) : null,
|
|
5943
6913
|
reuseStale ? el('p', { className: 'db-error' }, t('photo.reuseStale')) : null,
|
|
5944
|
-
reuse.applied ? el('p', { role: 'status', 'data-photography-reused': true },
|
|
6914
|
+
reuse.applied ? el('p', { role: 'status', 'data-photography-reused': true }, draft.boundaryReuse
|
|
6915
|
+
? 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,
|
|
6916
|
+
|
|
5945
6917
|
reuse.unchanged ? el('p', { role: 'status', 'data-photography-reuse-unchanged': true }, t('photo.reuseSame')) : null) : null,
|
|
6918
|
+
reuse.planning ? el('div', { role: 'status' }, t('photo.boundsPlanning'), Button({ action: 'photo-cancel-adaptation', onClick: actions.cancelPhotographyReuse, children: t('photo.boundsCancel') })) : null,
|
|
5946
6919
|
reuse.error ? el('p', { className: 'db-error', role: 'status', 'data-photography-source-error': true }, reuse.error) : null,
|
|
5947
6920
|
el('div', { className: 'db-inline' },
|
|
5948
6921
|
Button({ action: 'photo-source-reload', disabled: disabled || !reuse.sourceProjectId || reuse.loading, onClick: actions.reloadPhotographySource, children: t('photo.reuseReload') }),
|
|
5949
|
-
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')),
|
|
6922
|
+
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')),
|
|
5950
6923
|
el('div', { className: 'db-grid' },
|
|
5951
6924
|
el('div', null,
|
|
5952
6925
|
choose(t('photo.camera'), 'camera', draft.cameraId, draft.cameras.map(item => [item.id, item.id]), id => actions.selectPhotography('camera', id)),
|
|
@@ -6502,7 +7475,7 @@ window.__ModuleLoader__.load({
|
|
|
6502
7475
|
Object.entries(state.diff.collections)
|
|
6503
7476
|
.filter(([, entry]) => entry.added.length + entry.removed.length + entry.changed.length > 0)
|
|
6504
7477
|
.map(([kind, entry]) => el('div', { key: kind },
|
|
6505
|
-
el('strong', null, kind),
|
|
7478
|
+
el('strong', null, kind === 'halfLaps' ? t('editor.halfLap.title') : kind),
|
|
6506
7479
|
entry.added.length > 0 ? el('div', { className: 'db-muted db-mono' }, `+ ${entry.added.join(', ')}`) : null,
|
|
6507
7480
|
entry.removed.length > 0 ? el('div', { className: 'db-muted db-mono' }, `- ${entry.removed.join(', ')}`) : null,
|
|
6508
7481
|
entry.changed.map(change => el('div', { key: change.id, className: 'db-muted db-mono' },
|
|
@@ -6517,15 +7490,115 @@ window.__ModuleLoader__.load({
|
|
|
6517
7490
|
)
|
|
6518
7491
|
}
|
|
6519
7492
|
|
|
7493
|
+
function MotionEditor(ctx) {
|
|
7494
|
+
const { state, actions } = ctx, draft = motionDraftFor(state), work = state.motionWork?.[motionKey(state)] || {}
|
|
7495
|
+
if (!draft) return null
|
|
7496
|
+
const available = state.motionPreviewSupported && state.editableSnapshotAvailability?.available === true
|
|
7497
|
+
const busy = Boolean(work.busy), frozen = busy || Boolean(draft.result) || state.busy.patch, stale = draft.baseRevision !== state.currentRevision
|
|
7498
|
+
const invalid = !validMotionDraft(draft), result = draft.result
|
|
7499
|
+
const fullFrameChecked = result?.frameAudit?.schemaVersion === 'deepblend.motion-frame-audit-summary/v1' && result.frameAudit.scope === 'evaluated-mesh-vertices'
|
|
7500
|
+
&& result.frameAudit.frameStart === result.frameStart && result.frameAudit.frameEnd === result.frameEnd
|
|
7501
|
+
&& result.frameAudit.frameCount === result.video?.frames && result.frameAudit.cameraId === result.cameraId
|
|
7502
|
+
&& Array.isArray(result.frameAudit.entityIds) && editorEqual(result.frameAudit.entityIds, [...draft.entityIds].sort())
|
|
7503
|
+
&& /^[a-f0-9]{64}$/.test(result.frameAudit.checkpointSha256 || '')
|
|
7504
|
+
const value = (field, label, min, max, step) => el('label', { className: 'db-row' }, label, el('input', {
|
|
7505
|
+
className: 'db-input', type: 'number', 'data-field': `motion-${field}`, value: draft[field], min, max, step, disabled: frozen,
|
|
7506
|
+
onChange: event => actions.setMotionValue(field, event.target.value), style: { width: '100px' } }))
|
|
7507
|
+
return el('section', { className: 'db-card', 'data-motion-editor': true },
|
|
7508
|
+
el('h4', null, t('motion.title')), el('p', { className: 'db-muted' }, t('motion.help')),
|
|
7509
|
+
!available ? el('p', { role: 'status', className: 'db-muted' }, t('motion.local')) : null,
|
|
7510
|
+
el('label', { className: 'db-row' }, t('motion.camera'), el('select', { className: 'db-input', 'data-field': 'motion-camera', value: draft.cameraId, disabled: frozen,
|
|
7511
|
+
onChange: event => actions.setMotionValue('cameraId', event.target.value) }, draft.cameras.map(id => el('option', { key: id, value: id, disabled: Boolean(draft.cameraRestrictions?.[id]) },
|
|
7512
|
+
draft.cameraRestrictions?.[id] === 'animated' ? t('motion.cameraAnimatedOption', { camera: id })
|
|
7513
|
+
: draft.cameraRestrictions?.[id] === 'targeted' ? t('motion.cameraTargetedOption', { camera: id }) : id)))),
|
|
7514
|
+
draft.cameraRestrictions?.[draft.cameraId] ? el('p', { className: 'db-muted', role: 'status', 'data-motion-camera-restriction': draft.cameraRestrictions[draft.cameraId] },
|
|
7515
|
+
draft.cameraRestrictions[draft.cameraId] === 'animated' ? t('motion.cameraAnimated') : t('motion.cameraTargeted')) : null,
|
|
7516
|
+
draft.taggedOverflow ? el('p', { className: 'db-error', role: 'status' }, t('motion.tooMany')) : null,
|
|
7517
|
+
Disclosure(ctx, 'motion-parts', t('motion.subject'), {},
|
|
7518
|
+
draft.completeEntityIds?.length ? Button({ action: 'motion-whole-lamp', disabled: frozen, onClick: () => actions.setMotionValue('entityIds', draft.completeEntityIds), children: t('motion.wholeLamp') }) : null,
|
|
7519
|
+
draft.taggedEntityIds?.length ? Button({ action: 'motion-tagged', disabled: frozen, onClick: () => actions.setMotionValue('entityIds', draft.taggedEntityIds), children: t('motion.tagged') }) : null,
|
|
7520
|
+
draft.taggedEntityIds?.length ? el('p', { className: 'db-muted' }, t('motion.taggedHint')) : null,
|
|
7521
|
+
el('div', { style: { maxHeight: '200px', overflowY: 'auto' } }, draft.entities.map(entity => el('label', { className: 'db-row', key: entity.id },
|
|
7522
|
+
el('input', { type: 'checkbox', 'data-field': 'motion-part', 'data-entity-id': entity.id, checked: draft.entityIds.includes(entity.id),
|
|
7523
|
+
disabled: frozen || entity.visible === false || !draft.entityIds.includes(entity.id) && draft.entityIds.length >= 128,
|
|
7524
|
+
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') : '')))),
|
|
7525
|
+
value('seconds', t('motion.duration'), 1, 10, 1), value('amount', t('motion.amount'), 1, 20, 1),
|
|
7526
|
+
el('label', { className: 'db-row' }, t('motion.direction'), el('select', { className: 'db-input', 'data-field': 'motion-direction', value: draft.direction, disabled: frozen,
|
|
7527
|
+
onChange: event => actions.setMotionValue('direction', event.target.value) },
|
|
7528
|
+
el('option', { value: 'forward' }, t('motion.forward')), el('option', { value: 'backward' }, t('motion.backward')))),
|
|
7529
|
+
el('label', { className: 'db-row' }, el('input', { type: 'checkbox', 'data-field': 'motion-extend', checked: draft.allowRangeExtension, disabled: frozen,
|
|
7530
|
+
onChange: event => actions.setMotionValue('allowRangeExtension', event.target.checked) }), t('motion.extend')),
|
|
7531
|
+
result?.saveAttempted && !work.error && !busy ? el('p', { role: 'status', className: 'db-muted' }, t('motion.uncertain'))
|
|
7532
|
+
: stale && !result?.saveAttempted ? el('p', { className: 'db-error', role: 'status' }, t('motion.stale'))
|
|
7533
|
+
: invalid && !result ? el('p', { className: 'db-muted' }, t('motion.invalid')) : null,
|
|
7534
|
+
el('p', { className: 'db-muted' }, t('motion.limit')),
|
|
7535
|
+
fullFrameChecked ? el('p', { className: 'db-muted', 'data-motion-full-frame-check': true }, t('motion.fullCheck')) : null,
|
|
7536
|
+
fullFrameChecked && result.frameAudit.savedAuditSupported === true ? el('p', { className: 'db-muted', 'data-motion-saved-frame-check': true }, t('motion.savedCheck')) : null,
|
|
7537
|
+
result?.saveAttempted && !busy ? el('p', { className: 'db-muted' }, t('motion.abandonHelp')) : null,
|
|
7538
|
+
result ? el('video', { controls: true, preload: 'metadata', 'data-motion-video': result.id, style: { display: 'block', width: '100%', maxWidth: '480px' },
|
|
7539
|
+
src: projectRoute(draft.projectId, `/motion-previews/${result.id}/video`) }) : null,
|
|
7540
|
+
el('div', { className: 'db-inline', style: { flexWrap: 'wrap' } },
|
|
7541
|
+
!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,
|
|
7542
|
+
work.busy === 'preview' ? Button({ action: 'motion-cancel', onClick: actions.cancelMotion, children: t('motion.cancel') }) : null,
|
|
7543
|
+
result ? Button({ action: 'motion-save', tone: 'primary', disabled: !available || busy || draft.storageError || stale && !result.saveAttempted || result.expiresAt <= Date.now() && !result.saveAttempted,
|
|
7544
|
+
onClick: actions.saveMotion, children: work.busy === 'save' ? t('motion.saving') : result.saveAttempted ? t('motion.retry') : t('motion.save') }) : null,
|
|
7545
|
+
!busy ? Button({ action: 'motion-discard', onClick: actions.discardMotion, children: result?.saveAttempted ? t('motion.abandon') : result ? t('motion.discard') : t('motion.reset') }) : null),
|
|
7546
|
+
work.error ? el('p', { className: 'db-error', role: 'alert', 'data-motion-error': true }, work.error) : null,
|
|
7547
|
+
work.message ? el('p', { role: 'status', 'data-motion-message': true }, work.message) : null)
|
|
7548
|
+
}
|
|
7549
|
+
|
|
7550
|
+
function renderSingleFrameLink(state, job) {
|
|
7551
|
+
if (!state.renderFrameDownloadSupported || state.editableSnapshotAvailability?.available !== true
|
|
7552
|
+
|| !/^[a-f0-9]{64}$/.test(state.storeIdentity || '') || job.status !== 'completed' || job.delivery?.verified !== true
|
|
7553
|
+
|| !/^r[0-9]{4,}$/.test(job.revisionId || '') || !/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$/.test(job.jobId || '')
|
|
7554
|
+
|| !Number.isSafeInteger(job.frameStart) || job.frameStart < 1 || job.frameStart > 999999 || job.frameStart !== job.frameEnd) return null
|
|
7555
|
+
// A published still receipt already pins its frame and digest. Polling may
|
|
7556
|
+
// skip provenance for a busy project; do not hide a valid still in that case.
|
|
7557
|
+
const frames = job.delivery?.kind === 'still' ? [job.delivery.image].filter(frame => frame?.frame === job.frameStart)
|
|
7558
|
+
: Array.isArray(job.provenance?.frames) ? job.provenance.frames.filter(frame => frame?.frame === job.frameStart) : []
|
|
7559
|
+
if (frames.length !== 1 || !/^[a-f0-9]{64}$/.test(frames[0].sha256 || '')) return null
|
|
7560
|
+
const sha256 = frames[0].sha256
|
|
7561
|
+
return el('a', { className: 'db-btn', 'data-action': `download-frame:${job.jobId}`,
|
|
7562
|
+
href: projectRoute(state.activeProjectId, `/jobs/${encodeURIComponent(job.jobId)}/frames/${job.frameStart}?revision=${encodeURIComponent(job.revisionId)}&sha256=${sha256}&storeIdentity=${state.storeIdentity}`),
|
|
7563
|
+
download: true }, t('jobs.downloadFrame', { revision: job.revisionId, frame: job.frameStart }))
|
|
7564
|
+
}
|
|
7565
|
+
|
|
7566
|
+
function WideFramePreparation({ state, actions }) {
|
|
7567
|
+
const plan = wideFramePlan(state.selected?.scene), motion = motionDraftFor(state)
|
|
7568
|
+
const available = state.deliveryAspectPresetSupported && /^[a-f0-9]{64}$/.test(state.storeIdentity || '') && plan
|
|
7569
|
+
const pending = available && (projectHasUnsavedDrafts(state) || Boolean(motion?.result || motion?.touched || state.motionWork[motionKey(state)]?.busy))
|
|
7570
|
+
return el('section', { className: 'db-card', 'data-wide-frame': available ? plan.changed ? 'change' : 'ready' : 'unavailable' },
|
|
7571
|
+
el('h4', null, t('aspect.title')),
|
|
7572
|
+
!available ? el('p', { className: 'db-muted' }, t('aspect.unavailable'))
|
|
7573
|
+
: !plan.changed ? el('p', { className: 'db-muted' }, t('aspect.done'))
|
|
7574
|
+
: el('div', null, el('p', { className: 'db-muted' }, t('aspect.help')),
|
|
7575
|
+
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('×') }))),
|
|
7576
|
+
pending ? el('p', { className: 'db-muted' }, t('aspect.pending')) : null,
|
|
7577
|
+
Button({ action: 'save-wide-frame', tone: 'primary', disabled: pending || Object.values(state.busy).some(Boolean), onClick: actions.saveWideFrame, children: t('aspect.apply') })))
|
|
7578
|
+
}
|
|
7579
|
+
|
|
6520
7580
|
/** 任务: live progress, cancel, resume, and the approval threshold. */
|
|
6521
7581
|
function JobsView(ctx) {
|
|
6522
7582
|
const state = ctx.state
|
|
6523
7583
|
const actions = ctx.actions
|
|
6524
7584
|
if (state.activeProjectId === null) return el('div', { 'data-view': 'jobs', className: 'db-muted' }, t('common.noProject'))
|
|
6525
7585
|
const jobs = state.jobs || []
|
|
7586
|
+
const scene = state.selected?.scene
|
|
7587
|
+
const frame = (value, fallback) => value === '' || value === undefined || value === null ? fallback : Number(value)
|
|
7588
|
+
const start = frame(state.forms.frameStart, scene?.project?.frameStart)
|
|
7589
|
+
const end = frame(state.forms.frameEnd, scene?.project?.frameEnd)
|
|
7590
|
+
const noDeclaredMotion = Array.isArray(scene?.nodes?.animationTracks) && scene.nodes.animationTracks.length === 0
|
|
7591
|
+
&& Number.isSafeInteger(start) && Number.isSafeInteger(end) && end > start
|
|
7592
|
+
const wideOutput = ['still-2560x1440', 'video-1920x1080'].includes(state.forms.stillPreset)
|
|
7593
|
+
const profileSizes = ['preview', 'final'].map(name => scene?.renderProfiles?.[name]?.resolution)
|
|
7594
|
+
const sizeKnown = profileSizes.every(size => Array.isArray(size) && size.length === 2 && size.every(n => Number.isSafeInteger(n) && n > 0))
|
|
7595
|
+
const aspectWarning = !wideOutput ? null : !sizeKnown ? 'unknown' : profileSizes.some(([width, height]) => width * 9 !== height * 16) ? 'mismatch' : null
|
|
6526
7596
|
|
|
6527
7597
|
return el('div', { 'data-view': 'jobs' },
|
|
6528
7598
|
ErrorBox({ error: state.error }),
|
|
7599
|
+
ProjectStorageNotice(state),
|
|
7600
|
+
WideFramePreparation(ctx),
|
|
7601
|
+
MotionEditor(ctx),
|
|
6529
7602
|
el('div', { className: 'db-card' },
|
|
6530
7603
|
el('h4', null, t('tab.jobs')),
|
|
6531
7604
|
jobs.length === 0
|
|
@@ -6535,6 +7608,7 @@ window.__ModuleLoader__.load({
|
|
|
6535
7608
|
el('span', { className: 'db-mono' }, job.jobId),
|
|
6536
7609
|
Badge({ tone: statusTone(job.status), children: job.status }),
|
|
6537
7610
|
el('span', { className: 'db-muted' }, job.type),
|
|
7611
|
+
job.cameraId ? el('span', { className: 'db-muted', 'data-job-camera': job.cameraId }, `${t('jobs.camera')}: ${job.cameraId}`) : null,
|
|
6538
7612
|
el('span', { className: 'db-muted db-mono' }, t('jobs.frameRange', { start: job.frameStart, end: job.frameEnd })),
|
|
6539
7613
|
job.approval && job.approval.required ? Badge({ tone: 'warn', name: 'approval', children: t('jobs.approval', { frames: job.approval.frames, threshold: job.approval.threshold }) }) : null,
|
|
6540
7614
|
job.deliverable ? Badge({ tone: 'ok', children: t('jobs.deliveryVerified') }) : null,
|
|
@@ -6545,13 +7619,29 @@ window.__ModuleLoader__.load({
|
|
|
6545
7619
|
el('div', { className: 'db-muted', 'data-job-detail': job.jobId }, `${job.detail} · ${job.progress.percent}% · 缺失 ${job.progress.missing} · 损坏 ${job.progress.corrupt}`),
|
|
6546
7620
|
el('div', { className: 'db-muted', 'data-job-provenance': job.jobId }, jobProvenanceText(job)),
|
|
6547
7621
|
job.errorCode ? el('div', { className: 'db-error', style: { marginTop: '4px' } }, `${job.errorCode}: ${job.message || ''}`) : null,
|
|
6548
|
-
|
|
7622
|
+
renderSingleFrameLink(state, job),
|
|
7623
|
+
state.renderVideoDownloadSupported && state.editableSnapshotAvailability?.available === true
|
|
7624
|
+
&& /^[a-f0-9]{64}$/.test(state.storeIdentity || '') && job.status === 'completed' && job.delivery?.verified === true
|
|
7625
|
+
&& /^r[0-9]{4,}$/.test(job.revisionId || '') && /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$/.test(job.jobId || '')
|
|
7626
|
+
&& /^[a-f0-9]{64}$/.test(job.delivery.sha256 || '')
|
|
7627
|
+
? el('a', { className: 'db-btn', 'data-action': `download-video:${job.jobId}`,
|
|
7628
|
+
href: projectRoute(state.activeProjectId, `/jobs/${encodeURIComponent(job.jobId)}/video?revision=${encodeURIComponent(job.revisionId)}&sha256=${job.delivery.sha256}&storeIdentity=${state.storeIdentity}`),
|
|
7629
|
+
download: true }, t('jobs.downloadVideo', { revision: job.revisionId }))
|
|
7630
|
+
: job.delivery ? el('div', { className: 'db-muted db-mono' }, `video ${job.delivery.videoPath || ''}`) : null,
|
|
6549
7631
|
))),
|
|
6550
7632
|
),
|
|
6551
7633
|
|
|
6552
7634
|
el('div', { className: 'db-card' },
|
|
6553
7635
|
el('h4', null, t('jobs.startDelivery')),
|
|
7636
|
+
noDeclaredMotion ? el('p', { className: 'db-muted', role: 'status', 'data-motion-warning': 'no-declared-tracks' }, t('jobs.noDeclaredMotion')) : null,
|
|
6554
7637
|
el('div', { className: 'db-inline' },
|
|
7638
|
+
el('label', { className: 'db-muted' }, t('jobs.camera')),
|
|
7639
|
+
el('select', { className: 'db-input', 'data-field': 'render-camera', 'aria-label': t('jobs.camera'), style: { width: 'auto' }, value: state.forms.renderCamera || '',
|
|
7640
|
+
onChange: event => actions.setForm('renderCamera', event.target.value) },
|
|
7641
|
+
el('option', { value: '' }, t('jobs.cameraDefault')),
|
|
7642
|
+
state.forms.renderCamera && !scene?.nodes?.cameras?.some(camera => camera.id === state.forms.renderCamera)
|
|
7643
|
+
? el('option', { value: state.forms.renderCamera }, state.forms.renderCamera) : null,
|
|
7644
|
+
(scene?.nodes?.cameras || []).map(camera => el('option', { key: camera.id, value: camera.id }, camera.id))),
|
|
6555
7645
|
el('label', { className: 'db-muted' }, t('jobs.frameStart')),
|
|
6556
7646
|
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) }),
|
|
6557
7647
|
el('label', { className: 'db-muted' }, t('jobs.frameEnd')),
|
|
@@ -6563,8 +7653,19 @@ window.__ModuleLoader__.load({
|
|
|
6563
7653
|
},
|
|
6564
7654
|
el('option', { value: 'preview' }, 'preview'),
|
|
6565
7655
|
el('option', { value: 'final' }, 'final')),
|
|
7656
|
+
state.stillImageDeliverySupported ? el('label', { className: 'db-muted' }, t('jobs.deliveryKind')) : null,
|
|
7657
|
+
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) },
|
|
7658
|
+
el('option', { value: '' }, t('jobs.deliveryVideo')), el('option', { value: 'still' }, t('jobs.deliveryStill'))) : null,
|
|
7659
|
+
state.stillDeliveryPresetSupported || state.videoDeliveryPresetSupported ? el('label', { className: 'db-muted' }, t('jobs.stillPreset')) : null,
|
|
7660
|
+
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) },
|
|
7661
|
+
el('option', { value: '' }, t('jobs.stillProfileSize')),
|
|
7662
|
+
state.stillDeliveryPresetSupported ? el('option', { value: 'still-2560x1440' }, t('jobs.still2560')) : null,
|
|
7663
|
+
state.videoDeliveryPresetSupported ? el('option', { value: 'video-1920x1080' }, t('jobs.video1080')) : null) : null,
|
|
6566
7664
|
Button({ tone: 'primary', action: 'start-render', disabled: state.busy.render, onClick: () => actions.startRender(undefined), children: state.busy.render ? t('scene.submitting') : t('jobs.start') }),
|
|
6567
7665
|
),
|
|
7666
|
+
state.forms.stillPreset === 'video-1920x1080' ? el('p', { className: 'db-muted', role: 'status' }, t('jobs.videoPresetHelp', { fps: scene?.project?.fps ?? '—' }))
|
|
7667
|
+
: state.forms.stillPreset || state.forms.deliveryKind ? el('p', { className: 'db-muted', role: 'status' }, t('jobs.stillRange')) : null,
|
|
7668
|
+
aspectWarning ? el('p', { className: 'db-error', role: 'status', 'data-render-aspect-warning': aspectWarning }, aspectWarning === 'mismatch' ? t('aspect.outputMismatch') : t('aspect.outputUnknown')) : null,
|
|
6568
7669
|
Notice(state.notices.jobs, { marginTop: '8px' }),
|
|
6569
7670
|
),
|
|
6570
7671
|
)
|
|
@@ -6643,6 +7744,11 @@ window.__ModuleLoader__.load({
|
|
|
6643
7744
|
|
|
6644
7745
|
el('div', { className: 'db-card' },
|
|
6645
7746
|
el('h4', null, t('visual.title')),
|
|
7747
|
+
qa.visual.inputScope?.views?.length ? el('div', { 'data-review-input-scope': qa.visual.inputScope.mode },
|
|
7748
|
+
el('strong', null, t('reviewView.scope', { revision: qa.visual.inputScope.sourceRevision })),
|
|
7749
|
+
qa.visual.inputScope.views.map(view => el('p', { key: view.id, className: 'db-muted', style: { overflowWrap: 'anywhere' },
|
|
7750
|
+
'data-reviewed-camera': view.cameraId, 'data-reviewed-frame': view.frame }, t('reviewView.scopeItem', {
|
|
7751
|
+
camera: view.cameraId, frame: view.frame, resolution: (view.resolution || []).join('×'), samples: view.samples ?? '—' })))) : null,
|
|
6646
7752
|
qa.visual.available
|
|
6647
7753
|
? el('div', null,
|
|
6648
7754
|
KeyValues({ entries: [
|
|
@@ -6671,7 +7777,8 @@ window.__ModuleLoader__.load({
|
|
|
6671
7777
|
function EditableSnapshotView({ state, actions }) {
|
|
6672
7778
|
const entry = snapshotEntry(state), result = entry?.result, busy = entry?.busy || {}
|
|
6673
7779
|
const enabled = snapshotSupported(state), working = Object.values(busy).some(Boolean), preparing = result?.state === 'preparing'
|
|
6674
|
-
const same = snapshotSameSelection(entry), videos = snapshotVideos(state, entry?.revision)
|
|
7780
|
+
const same = snapshotSameSelection(entry), videos = snapshotVideos(state, entry?.revision), images = snapshotImages(state, entry?.revision)
|
|
7781
|
+
const missingImages = (entry?.imageJobIds || []).filter(id => !images.some(job => job.jobId === id))
|
|
6675
7782
|
const revisions = state.selected?.revisions || []
|
|
6676
7783
|
const phases = { writing: t('snapshot.copying'), verifying: t('snapshot.verifying'), publishing: t('snapshot.publishing') }
|
|
6677
7784
|
const done = result?.phase === 'verifying' ? result.verifiedBytes : result?.writtenBytes
|
|
@@ -6689,9 +7796,19 @@ window.__ModuleLoader__.load({
|
|
|
6689
7796
|
entry?.videoJobId && !videos.some(job => job.jobId === entry.videoJobId) ? el('option', { value: entry.videoJobId }, entry.videoJobId) : null,
|
|
6690
7797
|
videos.map(job => el('option', { key: job.jobId, value: job.jobId }, job.jobId))))),
|
|
6691
7798
|
revisions.length === 0 ? el('p', { className: 'db-muted' }, t('snapshot.noRevision')) : null,
|
|
7799
|
+
state.snapshotImagesSupported ? el('fieldset', { className: 'db-field', style: { marginTop: '12px' }, 'data-snapshot-images': true, disabled: !enabled || working || preparing },
|
|
7800
|
+
el('legend', null, t('snapshot.images')),
|
|
7801
|
+
images.map(job => el('label', { className: 'db-inline', key: job.jobId },
|
|
7802
|
+
el('input', { type: 'checkbox', 'data-field': 'snapshot-image', 'data-job-id': job.jobId, checked: (entry?.imageJobIds || []).includes(job.jobId),
|
|
7803
|
+
disabled: !(entry?.imageJobIds || []).includes(job.jobId) && (entry?.imageJobIds || []).length >= 16,
|
|
7804
|
+
onChange: event => actions.setSnapshotImage(job.jobId, event.target.checked) }),
|
|
7805
|
+
el('span', null, `${job.jobId} · ${job.cameraId || '—'} · ${job.delivery.image.frame} · ${job.delivery.image.width}×${job.delivery.image.height}`))),
|
|
7806
|
+
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,
|
|
7807
|
+
onChange: event => actions.setSnapshotImage(id, event.target.checked) }), el('span', null, t('snapshot.missingImage', { jobId: id })))),
|
|
7808
|
+
!images.length && !missingImages.length ? el('p', { className: 'db-muted' }, t('snapshot.noImages')) : null) : null,
|
|
6692
7809
|
el('div', { 'aria-live': 'polite', role: 'status', style: { marginTop: '12px' } },
|
|
6693
7810
|
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,
|
|
6694
|
-
result?.state === 'ready' ? el('p', null, t('snapshot.ready', { revision: result.revision, bytes: snapshotBytes(result.archive.bytes) })) : null,
|
|
7811
|
+
same && result?.state === 'ready' ? el('p', null, t('snapshot.ready', { revision: result.revision, bytes: snapshotBytes(result.archive.bytes) })) : null,
|
|
6695
7812
|
['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,
|
|
6696
7813
|
result?.state === 'failed' && result.error?.message ? el('p', { className: 'db-error' }, result.error.message) : null,
|
|
6697
7814
|
(preparing || busy.prepare) && entry?.handle ? el('p', { className: 'db-muted' }, t('snapshot.saved', entry.handle)) : null,
|
|
@@ -6701,7 +7818,7 @@ window.__ModuleLoader__.load({
|
|
|
6701
7818
|
entry?.handle && !same ? el('p', { className: 'db-muted' }, t('snapshot.newSelection')) : null,
|
|
6702
7819
|
entry?.storageUnavailable && entry.handle ? el('p', { className: 'db-muted' }, t('snapshot.storage')) : null,
|
|
6703
7820
|
el('div', { className: 'db-inline', style: { marginTop: '12px' } },
|
|
6704
|
-
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,
|
|
7821
|
+
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,
|
|
6705
7822
|
preparing ? Button({ action: 'snapshot-cancel', disabled: !enabled || busy.cancel || busy.prepare, onClick: actions.cancelEditableSnapshot, children: t('snapshot.cancel') }) : null,
|
|
6706
7823
|
entry?.issue || entry?.handle && !result ? Button({ action: 'snapshot-check', disabled: !enabled || working, onClick: actions.checkEditableSnapshot, children: t('snapshot.check') }) : null,
|
|
6707
7824
|
(!preparing || entry?.issue) && !(same && result?.state === 'ready' && !entry.issue) ? Button({ action: 'snapshot-prepare', tone: 'primary', disabled: !enabled || !entry?.revision || working,
|
|
@@ -6818,6 +7935,37 @@ window.__ModuleLoader__.load({
|
|
|
6818
7935
|
})))
|
|
6819
7936
|
}
|
|
6820
7937
|
|
|
7938
|
+
function ProjectStorageNotice(state) {
|
|
7939
|
+
const storage = state.projectStorage
|
|
7940
|
+
const status = ['low', 'observed'].includes(storage?.status) && Number.isSafeInteger(storage.availableBytes) && storage.availableBytes >= 0
|
|
7941
|
+
? storage.status : 'unknown'
|
|
7942
|
+
const space = status === 'unknown' ? null : assetBytes(storage.availableBytes)
|
|
7943
|
+
return el('section', { className: status === 'low' ? 'db-error' : 'db-muted', 'data-project-storage': status, role: 'status' },
|
|
7944
|
+
el('p', null, status === 'low' ? t('storage.low', { space }) : status === 'observed' ? t('storage.observed', { space }) : t('storage.unknown')), el('p', null, t('storage.limit')))
|
|
7945
|
+
}
|
|
7946
|
+
|
|
7947
|
+
function ImageInputReadiness({ state, actions }) {
|
|
7948
|
+
const probe = state.imageInputProbe || { busy: false, result: null }
|
|
7949
|
+
const available = state.imageInputProbeSupported && state.editableSnapshotAvailability?.available === true
|
|
7950
|
+
const result = available ? probe.result : null
|
|
7951
|
+
const message = result?.status === 'pass' ? t('readiness.imagePass')
|
|
7952
|
+
: result?.reason === 'authentication' ? t('readiness.imageAuth')
|
|
7953
|
+
: result?.reason === 'credentials_missing' ? t('readiness.imageCredentials')
|
|
7954
|
+
: result?.reason === 'image_unsupported' ? t('readiness.imageUnsupported')
|
|
7955
|
+
: result?.reason === 'model_unavailable' ? t('readiness.imageModel')
|
|
7956
|
+
: ['provider_unavailable', 'services_missing', 'route_missing'].includes(result?.reason) ? t('readiness.imageRoute')
|
|
7957
|
+
: result?.reason === 'rate_limit' ? t('readiness.imageRate')
|
|
7958
|
+
: ['timeout', 'cancelled'].includes(result?.reason) ? t('readiness.imageTimeout')
|
|
7959
|
+
: result?.reason === 'busy' ? t('readiness.imageBusy') : t('readiness.imageInconclusive')
|
|
7960
|
+
return el('section', { 'data-image-readiness': true },
|
|
7961
|
+
el('h4', null, t('readiness.imageTitle')),
|
|
7962
|
+
el('p', { className: 'db-muted' }, t('readiness.imageHelp')),
|
|
7963
|
+
!available ? el('p', { className: 'db-muted' }, t('readiness.imageLocal')) : null,
|
|
7964
|
+
Button({ action: 'probe-image-input', disabled: !available || probe.busy, onClick: actions.probeImageInput,
|
|
7965
|
+
children: probe.busy ? t('readiness.imageRunning') : t('readiness.imageRun') }),
|
|
7966
|
+
result ? el('p', { role: 'status', 'data-image-readiness-result': result.status, className: result.status === 'pass' ? 'db-muted' : 'db-error' }, message) : null)
|
|
7967
|
+
}
|
|
7968
|
+
|
|
6821
7969
|
function LighttableWorkspace(ctx) {
|
|
6822
7970
|
const { state, actions } = ctx, result = lighttableResult(state)
|
|
6823
7971
|
const comparison = state.view === 'preview' && state.compareMode !== 'result'
|
|
@@ -6886,7 +8034,8 @@ window.__ModuleLoader__.load({
|
|
|
6886
8034
|
el('label', { className: 'db-field' }, t('workbench.appearance'),
|
|
6887
8035
|
el('select', { className: 'db-input db-theme', 'data-field': 'workbench-appearance', value: state.appearance || 'system', onChange: event => actions.setAppearance(event.target.value) },
|
|
6888
8036
|
[['system', t('workbench.system')], ['light', t('workbench.light')], ['dark', t('workbench.dark')]].map(([theme, label]) => el('option', { value: theme }, label)))),
|
|
6889
|
-
el('a', { className: 'db-btn', href: ROUTES.diagnostics, download: 'deepblend-diagnostics.json', 'data-action': 'export-diagnostics', title: t('diagnostics.exportHint') }, t('diagnostics.export'))
|
|
8037
|
+
el('a', { className: 'db-btn', href: ROUTES.diagnostics, download: 'deepblend-diagnostics.json', 'data-action': 'export-diagnostics', title: t('diagnostics.exportHint') }, t('diagnostics.export')),
|
|
8038
|
+
ImageInputReadiness(ctx))))),
|
|
6890
8039
|
el('nav', { className: 'db-nav', 'aria-label': t('workbench.navigation') },
|
|
6891
8040
|
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))),
|
|
6892
8041
|
el('div', { className: 'db-secondary-nav' }, secondary.map(entry => nav(entry.id, entry.label)))),
|
|
@@ -7486,7 +8635,7 @@ window.__ModuleLoader__.load({
|
|
|
7486
8635
|
inspection: { form: inspectionForm, valid: inspectionFormValid },
|
|
7487
8636
|
assetLibrary: { selection: assetBundleSelection, createDraft: createAssetDraft, buildPatch: buildAssetPatch, error: assetDraftError, key: assetKey },
|
|
7488
8637
|
referenceBrief: { createDraft: createBriefDraft, buildPatch: buildBriefPatch, dirty: briefDirty, valid: briefValid },
|
|
7489
|
-
photographyEditor: { createDraft: createPhotographyDraft, buildPatch: buildPhotographyPatch, errors: photographyErrors, dirty: photographyDirty, draftFor: photographyDraftFor, reuse: reusePhotography },
|
|
8638
|
+
photographyEditor: { boundaryRequest: photographyBoundaryRequest, applyBoundary: applyBoundaryPhotography, createDraft: createPhotographyDraft, buildPatch: buildPhotographyPatch, errors: photographyErrors, dirty: photographyDirty, draftFor: photographyDraftFor, reuse: reusePhotography },
|
|
7490
8639
|
sceneEditor: { createDraft: createEditorDraft, buildPatch: buildEditorPatch, errors: editorErrors, dirty: editorDirty, previewPair: editorPreviewPair, draftFor: editorDraftFor },
|
|
7491
8640
|
renderView,
|
|
7492
8641
|
mountStandalone,
|