@deepblend/dsh-blender-bundle 0.19.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/client.js +193 -4
- package/package.json +7 -7
package/lib/client.js
CHANGED
|
@@ -404,6 +404,29 @@ window.__ModuleLoader__.load({
|
|
|
404
404
|
'assembly.stale': '当前作品已有新版本。草稿已保留,请重新载入后再修改。',
|
|
405
405
|
'assembly.otherDraft': '请先保存或放弃其他未提交的编辑。',
|
|
406
406
|
'assembly.photoKept': '已保留自定义摄影,请确认新尺寸下的构图。',
|
|
407
|
+
'placement.title': '摆放整盏灯',
|
|
408
|
+
'placement.help': '一起移动包含电线的 {count} 个部件:先转向、再按世界坐标位移,最后竖直落到所选表面。',
|
|
409
|
+
'placement.support': '放到哪个表面',
|
|
410
|
+
'placement.chooseSupport': '选择支承对象',
|
|
411
|
+
'placement.x': '世界 X 位移(mm)',
|
|
412
|
+
'placement.y': '世界 Y 位移(mm)',
|
|
413
|
+
'placement.z': '落下前的上下位移 Z(mm)',
|
|
414
|
+
'placement.yaw': '转向变化(°)',
|
|
415
|
+
'placement.clearance': '竖直间隙(mm)',
|
|
416
|
+
'placement.more': '旋转中心与检查帧',
|
|
417
|
+
'placement.pivot': '旋转中心:世界 {axis}(mm)',
|
|
418
|
+
'placement.frame': '测量与预览帧',
|
|
419
|
+
'placement.pivotHelp': '默认绕当前底座中心转向。转向后再位移;最终高度由实际支承面决定,整灯保持直立。',
|
|
420
|
+
'placement.photo': '摄影设置保留。大幅移动后,请检查构图;需要时在摄影设置中调整。',
|
|
421
|
+
'placement.save': '摆放整灯并预览',
|
|
422
|
+
'placement.saving': '正在摆放并生成预览…',
|
|
423
|
+
'placement.cancel': '停止并核对结果',
|
|
424
|
+
'placement.retry': '重试同一次放置',
|
|
425
|
+
'placement.invalid': '请输入范围内的数值。',
|
|
426
|
+
'placement.unconfirmed': '这次放置的结果尚未确认。正在读取保存状态;重试会沿用同一次请求。',
|
|
427
|
+
'placement.conflict': '整灯部件已被单独修改,暂时不能整体摆放。请先恢复对应部件。',
|
|
428
|
+
'placement.saved': '整灯 {count} 个部件已保存为 {revision}。请检查新位置下的构图。',
|
|
429
|
+
'placement.failed': '整灯尚未完成放置。请检查支承对象与部件状态后重试。',
|
|
407
430
|
'editor.position': '位置(mm)',
|
|
408
431
|
'editor.rotation': '旋转(°)',
|
|
409
432
|
'editor.geometry': '形状与轮廓',
|
|
@@ -1111,6 +1134,29 @@ window.__ModuleLoader__.load({
|
|
|
1111
1134
|
'assembly.stale': 'The work has a newer revision. Your draft is retained; reload it before editing.',
|
|
1112
1135
|
'assembly.otherDraft': 'Save or discard other unsaved edits first.',
|
|
1113
1136
|
'assembly.photoKept': 'Custom photography was preserved. Check framing at the new dimensions.',
|
|
1137
|
+
'placement.title': 'Place the whole lamp',
|
|
1138
|
+
'placement.help': 'Move all {count} parts, including the cable: turn first, translate in world coordinates, then settle vertically on the selected surface.',
|
|
1139
|
+
'placement.support': 'Support surface',
|
|
1140
|
+
'placement.chooseSupport': 'Choose a support object',
|
|
1141
|
+
'placement.x': 'World X offset (mm)',
|
|
1142
|
+
'placement.y': 'World Y offset (mm)',
|
|
1143
|
+
'placement.z': 'World Z offset before settling (mm)',
|
|
1144
|
+
'placement.yaw': 'Change in heading (°)',
|
|
1145
|
+
'placement.clearance': 'Vertical clearance (mm)',
|
|
1146
|
+
'placement.more': 'Rotation pivot and frame',
|
|
1147
|
+
'placement.pivot': 'World {axis} pivot (mm)',
|
|
1148
|
+
'placement.frame': 'Measurement and preview frame',
|
|
1149
|
+
'placement.pivotHelp': 'Turns around the current base origin by default. Translation follows rotation; the measured support sets the final height. The lamp stays upright.',
|
|
1150
|
+
'placement.photo': 'Photography is retained. Check framing after a large move and adjust photography when needed.',
|
|
1151
|
+
'placement.save': 'Place the whole lamp and preview',
|
|
1152
|
+
'placement.saving': 'Placing and rendering…',
|
|
1153
|
+
'placement.cancel': 'Stop and check the result',
|
|
1154
|
+
'placement.retry': 'Retry this placement',
|
|
1155
|
+
'placement.invalid': 'Enter a number within the allowed range.',
|
|
1156
|
+
'placement.unconfirmed': 'This placement is unconfirmed. Reading the saved state; a retry will reuse this exact request.',
|
|
1157
|
+
'placement.conflict': 'Lamp parts were edited separately. Restore the affected parts before placing the complete lamp.',
|
|
1158
|
+
'placement.saved': 'Saved all {count} lamp parts as {revision}. Check framing at the new position.',
|
|
1159
|
+
'placement.failed': 'The complete lamp could not be placed. Check the support and member state, then retry.',
|
|
1114
1160
|
'editor.position': 'Position (mm)',
|
|
1115
1161
|
'editor.rotation': 'Rotation (°)',
|
|
1116
1162
|
'editor.geometry': 'Shape and profile',
|
|
@@ -2025,6 +2071,9 @@ window.__ModuleLoader__.load({
|
|
|
2025
2071
|
.db-recipe-parameters .db-inline{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));margin-top:12px}
|
|
2026
2072
|
.db-recipe-parameters label{padding:8px;background:var(--db-fill);border-radius:7px}
|
|
2027
2073
|
.db-recipe-parameters input[type=color]{height:34px;width:64px;border:1px solid var(--db-border);border-radius:6px;padding:3px;background:var(--db-surface)}
|
|
2074
|
+
.db-placement-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-block:12px}
|
|
2075
|
+
.db-placement-grid .db-field{display:grid;gap:6px;align-content:start;min-width:0}
|
|
2076
|
+
.db-placement-grid input{min-width:0}
|
|
2028
2077
|
.db-storage{margin-top:8px;font-size:11px;overflow-wrap:anywhere}
|
|
2029
2078
|
.db-scene-layout{display:grid;grid-template-columns:minmax(220px,300px) minmax(0,1fr);gap:20px;align-items:start}
|
|
2030
2079
|
.db-scene-outline{min-width:0;position:sticky;top:0;max-height:calc(100dvh - 180px);overflow:auto;scrollbar-width:thin;scrollbar-color:var(--db-border) transparent}
|
|
@@ -2863,6 +2912,7 @@ window.__ModuleLoader__.load({
|
|
|
2863
2912
|
|| Boolean(state.assetDrafts?.[state.activeProjectId])
|
|
2864
2913
|
|| state.forms.patch !== null
|
|
2865
2914
|
|| assemblyDirty(assemblyDraftFor(state))
|
|
2915
|
+
|| placementDirty(placementDraftFor(state))
|
|
2866
2916
|
}
|
|
2867
2917
|
const assemblyKey = state => JSON.stringify([state.projectsRoot, state.activeProjectId])
|
|
2868
2918
|
const assemblyDraftFor = state => state.assemblyDrafts?.[assemblyKey(state)] || null
|
|
@@ -2876,6 +2926,26 @@ window.__ModuleLoader__.load({
|
|
|
2876
2926
|
return { projectId: source.projectId, projectsRoot, baseRevision: source.revision,
|
|
2877
2927
|
parameters: editorClone(source.parameters), values, original: { ...values }, idempotencyKey: newCreationKey(), attempt: null }
|
|
2878
2928
|
}
|
|
2929
|
+
const placementDraftFor = state => state.placementDrafts?.[assemblyKey(state)] || null
|
|
2930
|
+
const placementDirty = draft => Boolean(draft && (draft.attempt || draft.supportEntityId
|
|
2931
|
+
|| Object.entries(draft.values).some(([id, value]) => value === '' || Number(value) !== draft.original[id])))
|
|
2932
|
+
const placementLimits = { x: [-1e6, 1e6], y: [-1e6, 1e6], z: [-1e6, 1e6], yaw: [-360, 360],
|
|
2933
|
+
pivotX: [-1e6, 1e6], pivotY: [-1e6, 1e6], pivotZ: [-1e6, 1e6], clearance: [0, 1000], frame: [0, 1e6] }
|
|
2934
|
+
const placementFieldInvalid = (draft, id) => {
|
|
2935
|
+
const value = Number(draft.values[id]), [min, max] = placementLimits[id]
|
|
2936
|
+
return draft.values[id] === '' || !Number.isFinite(value) || value < min || value > max || id === 'frame' && !Number.isSafeInteger(value)
|
|
2937
|
+
}
|
|
2938
|
+
const placementInvalid = draft => !draft || !draft.supportEntityId || !draft.supports.some(entity => entity.id === draft.supportEntityId)
|
|
2939
|
+
|| Object.keys(placementLimits).some(id => placementFieldInvalid(draft, id))
|
|
2940
|
+
function createPlacementDraft(source, scene, projectsRoot) {
|
|
2941
|
+
const placement = source.placement, pivot = placement.defaultPose.pivotMm
|
|
2942
|
+
const values = { x: 0, y: 0, z: 0, yaw: 0, pivotX: pivot[0], pivotY: pivot[1], pivotZ: pivot[2], clearance: 0,
|
|
2943
|
+
frame: Math.min(scene.project.frameEnd ?? 24, Math.max(scene.project.frameStart ?? 1, 24)) }
|
|
2944
|
+
return { projectId: source.projectId, projectsRoot, baseRevision: source.revision, subjectEntityId: placement.subjectEntityId,
|
|
2945
|
+
memberEntityIds: editorClone(placement.memberEntityIds), supports: editorClone(scene.nodes.entities.filter(entity =>
|
|
2946
|
+
['generator', 'asset-instance'].includes(entity.kind) && !placement.memberEntityIds.includes(entity.id))), supportEntityId: '',
|
|
2947
|
+
values, original: { ...values }, idempotencyKey: newCreationKey(), attempt: null }
|
|
2948
|
+
}
|
|
2879
2949
|
function briefValid(draft) {
|
|
2880
2950
|
return Boolean(draft && typeof draft.goal === 'string' && draft.goal.length <= 2000 && draft.referenceImages.length <= 4
|
|
2881
2951
|
&& (draft.reviewSubjectId === null || typeof draft.reviewSubjectId === 'string' && draft.reviewSubjectId.length > 0)
|
|
@@ -3157,10 +3227,11 @@ window.__ModuleLoader__.load({
|
|
|
3157
3227
|
editorLastEdits: {},
|
|
3158
3228
|
editorComparison: null,
|
|
3159
3229
|
assemblyDrafts: {},
|
|
3230
|
+
placementDrafts: {},
|
|
3160
3231
|
patchDrafts: {},
|
|
3161
3232
|
recipeChoices: [],
|
|
3162
3233
|
forms: { title: '', goal: '', recipe: null, recipeParameters: {}, patch: null, frameStart: '', frameEnd: '', profile: 'preview' },
|
|
3163
|
-
busy: { create: false, patch: false, editor: false, assembly: false, render: false, restore: false },
|
|
3234
|
+
busy: { create: false, patch: false, editor: false, assembly: false, placement: false, render: false, restore: false },
|
|
3164
3235
|
notices: { projects: null, scene: null, preview: null, jobs: null, revisions: null },
|
|
3165
3236
|
}
|
|
3166
3237
|
}
|
|
@@ -3228,6 +3299,7 @@ window.__ModuleLoader__.load({
|
|
|
3228
3299
|
const snapshotControllers = new Set()
|
|
3229
3300
|
let snapshotTimer = null, snapshotGeneration = 0, activeSnapshotContext = null
|
|
3230
3301
|
const photographyControllers = new Map()
|
|
3302
|
+
const placementControllers = new Map()
|
|
3231
3303
|
const photographySourceControllers = new Map()
|
|
3232
3304
|
let photographySourceSequence = 0
|
|
3233
3305
|
const photographyWork = (projectId, changes) => set({ photographyWork: { ...data.photographyWork, [projectId]: { ...data.photographyWork[projectId], ...changes } } })
|
|
@@ -3394,6 +3466,7 @@ window.__ModuleLoader__.load({
|
|
|
3394
3466
|
editableSnapshotAvailability: payload.editableSnapshotAvailability ?? null,
|
|
3395
3467
|
creationRequestProtocol: payload.creationRequestProtocol ?? null,
|
|
3396
3468
|
cameraTargetResetSupported: payload.cameraTargetResetSupported === true,
|
|
3469
|
+
assemblyPlacementSupported: payload.assemblyPlacementSupported === true,
|
|
3397
3470
|
selected: payload.selected ?? null,
|
|
3398
3471
|
activeProjectId: active,
|
|
3399
3472
|
currentRevision: payload.selected ? payload.selected.currentRevision : null,
|
|
@@ -3445,6 +3518,10 @@ window.__ModuleLoader__.load({
|
|
|
3445
3518
|
if ((!draft || !assemblyDirty(draft)) && !data.busy.assembly) {
|
|
3446
3519
|
patch.assemblyDrafts = { ...data.assemblyDrafts, [key]: createAssemblyDraft(source, patch.projectsRoot) }
|
|
3447
3520
|
}
|
|
3521
|
+
const placement = data.placementDrafts[key]
|
|
3522
|
+
if (source.placement?.available === true && (!placement || !placementDirty(placement)) && !data.busy.placement) {
|
|
3523
|
+
patch.placementDrafts = { ...data.placementDrafts, [key]: createPlacementDraft(source, patch.selected.scene, patch.projectsRoot) }
|
|
3524
|
+
}
|
|
3448
3525
|
}
|
|
3449
3526
|
const photography = data.photographyDrafts[active]
|
|
3450
3527
|
if ((!photography || !photographyDirty(photography)) && !data.photographyWork[active]?.saving) {
|
|
@@ -3744,6 +3821,64 @@ window.__ModuleLoader__.load({
|
|
|
3744
3821
|
}
|
|
3745
3822
|
}
|
|
3746
3823
|
const actions = {
|
|
3824
|
+
setPlacementValue: (id, value) => {
|
|
3825
|
+
const draft = placementDraftFor(data)
|
|
3826
|
+
if (!draft || data.busy.placement || draft.attempt || !Object.hasOwn(placementLimits, id)) return
|
|
3827
|
+
set({ placementDrafts: { ...data.placementDrafts, [assemblyKey(data)]: { ...draft, values: { ...draft.values, [id]: value } } } })
|
|
3828
|
+
},
|
|
3829
|
+
setPlacementSupport: value => {
|
|
3830
|
+
const draft = placementDraftFor(data)
|
|
3831
|
+
if (!draft || data.busy.placement || draft.attempt || value && !draft.supports.some(entity => entity.id === value)) return
|
|
3832
|
+
set({ placementDrafts: { ...data.placementDrafts, [assemblyKey(data)]: { ...draft, supportEntityId: value } } })
|
|
3833
|
+
},
|
|
3834
|
+
resetPlacement: () => {
|
|
3835
|
+
const source = data.selected?.recipeParameters
|
|
3836
|
+
if (!source?.placement?.available || data.busy.placement) return
|
|
3837
|
+
set({ placementDrafts: { ...data.placementDrafts, [assemblyKey(data)]: createPlacementDraft(source, data.selected.scene, data.projectsRoot) } })
|
|
3838
|
+
reload()
|
|
3839
|
+
},
|
|
3840
|
+
cancelPlacement: () => placementControllers.get(assemblyKey(data))?.abort(),
|
|
3841
|
+
savePlacement: async () => {
|
|
3842
|
+
const draft = placementDraftFor(data), source = data.selected?.recipeParameters
|
|
3843
|
+
if (!draft || data.busy.placement || placementInvalid(draft) || !placementDirty(draft) || !data.assemblyPlacementSupported) return
|
|
3844
|
+
if (!draft.attempt && (draft.baseRevision !== source?.revision || draft.baseRevision !== data.currentRevision || !source?.placement?.available
|
|
3845
|
+
|| projectHasUnsavedDrafts({ ...data, placementDrafts: {} }))) return
|
|
3846
|
+
const key = assemblyKey(data), v = Object.fromEntries(Object.entries(draft.values).map(([id, value]) => [id, Number(value)]))
|
|
3847
|
+
const body = draft.attempt || { projectsRoot: draft.projectsRoot, baseRevision: draft.baseRevision, scope: 'recipe-assembly',
|
|
3848
|
+
subjectEntityId: draft.subjectEntityId, supportEntityId: draft.supportEntityId, frame: v.frame, clearanceMm: v.clearance,
|
|
3849
|
+
pose: { translationMm: [v.x, v.y, v.z], yawDegrees: v.yaw, pivotMm: [v.pivotX, v.pivotY, v.pivotZ] }, idempotencyKey: draft.idempotencyKey }
|
|
3850
|
+
const controller = new AbortController(); placementControllers.set(key, controller)
|
|
3851
|
+
set({ placementDrafts: { ...data.placementDrafts, [key]: { ...draft, attempt: body } } })
|
|
3852
|
+
setIn('busy', 'placement', true)
|
|
3853
|
+
let outcome = await postJson((url, options) => fetchImpl(url, { ...options, signal: controller.signal }),
|
|
3854
|
+
projectRoute(draft.projectId, '/surface-placement'), body)
|
|
3855
|
+
placementControllers.delete(key); setIn('busy', 'placement', false)
|
|
3856
|
+
const result = outcome.payload?.revision, receipt = result?.surfacePlacementReceipt
|
|
3857
|
+
if (outcome.ok && (!/^r[0-9]{4,}$/.test(result?.revision ?? '') || receipt?.schemaVersion !== 'deepblend.assembly-placement-receipt/v1'
|
|
3858
|
+
|| receipt.sourceRevision !== body.baseRevision || receipt.subjectEntityId !== body.subjectEntityId
|
|
3859
|
+
|| receipt.supportEntityId !== body.supportEntityId || receipt.frame !== body.frame || receipt.clearanceMm !== body.clearanceMm
|
|
3860
|
+
|| !editorEqual(receipt.memberEntityIds, draft.memberEntityIds) || !editorEqual(receipt.pose, body.pose))) {
|
|
3861
|
+
outcome = { ok: false, error: { code: 'UI_PLACEMENT_MISMATCH', message: 'The placement response does not match the captured request.' } }
|
|
3862
|
+
}
|
|
3863
|
+
const sameProject = target() === draft.projectId && data.projectsRoot === draft.projectsRoot
|
|
3864
|
+
if (outcome.ok) {
|
|
3865
|
+
const drafts = { ...data.placementDrafts }; delete drafts[key]; set({ placementDrafts: drafts })
|
|
3866
|
+
if (sameProject) {
|
|
3867
|
+
const notice = { ok: true, kind: 'assembly-placement', projectId: draft.projectId, projectsRoot: draft.projectsRoot,
|
|
3868
|
+
message: t('placement.saved', { count: draft.memberEntityIds.length, revision: result.revision }) }
|
|
3869
|
+
set({ view: 'preview', compareMode: 'revisions', compareLeft: draft.baseRevision, compareRight: result.revision,
|
|
3870
|
+
notices: { ...data.notices, scene: notice, preview: notice } })
|
|
3871
|
+
}
|
|
3872
|
+
} else {
|
|
3873
|
+
const uncertain = ['UI_FETCH_FAILED', 'UI_PLACEMENT_MISMATCH'].includes(outcome.error.code) || /^HTTP_5/.test(outcome.error.code)
|
|
3874
|
+
set({ placementDrafts: { ...data.placementDrafts, [key]: { ...draft, attempt: uncertain ? body : null } } })
|
|
3875
|
+
if (sameProject) setIn('notices', 'scene', { ok: false,
|
|
3876
|
+
message: uncertain ? t('placement.unconfirmed') : outcome.error.code === 'REVISION_CONFLICT' ? t('assembly.stale')
|
|
3877
|
+
: outcome.error.code === 'RECIPE_PARAMETER_CONFLICT' ? t('placement.conflict') : t('placement.failed'),
|
|
3878
|
+
technicalDetails: `${outcome.error.code}: ${outcome.error.message}` })
|
|
3879
|
+
}
|
|
3880
|
+
reload()
|
|
3881
|
+
},
|
|
3747
3882
|
setSnapshotRevision: value => setSnapshotSelection('revision', value),
|
|
3748
3883
|
setSnapshotVideo: value => setSnapshotSelection('videoJobId', value),
|
|
3749
3884
|
prepareEditableSnapshot: () => snapshotRequest('prepare'),
|
|
@@ -4768,6 +4903,8 @@ window.__ModuleLoader__.load({
|
|
|
4768
4903
|
if (timer !== null) { clearInterval(timer); timer = null }
|
|
4769
4904
|
for (const controller of photographyControllers.values()) controller.abort()
|
|
4770
4905
|
photographyControllers.clear()
|
|
4906
|
+
for (const controller of placementControllers.values()) controller.abort()
|
|
4907
|
+
placementControllers.clear()
|
|
4771
4908
|
for (const controller of photographySourceControllers.values()) controller.abort()
|
|
4772
4909
|
photographySourceControllers.clear()
|
|
4773
4910
|
for (const controller of inspectionControllers.values()) controller.abort()
|
|
@@ -5066,6 +5203,12 @@ window.__ModuleLoader__.load({
|
|
|
5066
5203
|
}
|
|
5067
5204
|
|
|
5068
5205
|
/** A result line, in the two shapes the panel already used. */
|
|
5206
|
+
function placementPreviewNotice(state) {
|
|
5207
|
+
const notice = state.notices?.preview
|
|
5208
|
+
return notice?.kind === 'assembly-placement' && notice.projectId === state.activeProjectId
|
|
5209
|
+
&& notice.projectsRoot === state.projectsRoot ? notice : null
|
|
5210
|
+
}
|
|
5211
|
+
|
|
5069
5212
|
function Notice(result, style) {
|
|
5070
5213
|
if (result === null || result === undefined) return null
|
|
5071
5214
|
return el('div', {
|
|
@@ -5105,6 +5248,51 @@ window.__ModuleLoader__.load({
|
|
|
5105
5248
|
Button({ action: 'assembly-reset', disabled: state.busy.assembly, onClick: actions.resetAssembly, children: t('editor.reset') })))
|
|
5106
5249
|
}
|
|
5107
5250
|
|
|
5251
|
+
function AssemblyPlacementEditor(ctx) {
|
|
5252
|
+
const { state, actions } = ctx, source = state.selected?.recipeParameters?.placement, draft = placementDraftFor(state)
|
|
5253
|
+
if (!source || !state.assemblyPlacementSupported) return null
|
|
5254
|
+
if (!source.available) return el('section', { className: 'db-card', 'data-placement-editor': true },
|
|
5255
|
+
el('h4', null, t('placement.title')), el('p', { className: 'db-muted' }, t('placement.conflict')))
|
|
5256
|
+
if (!draft) return null
|
|
5257
|
+
const stale = draft.baseRevision !== state.selected.scene.revision || draft.baseRevision !== state.currentRevision
|
|
5258
|
+
const otherDirty = projectHasUnsavedDrafts({ ...state, placementDrafts: {} })
|
|
5259
|
+
const busy = state.busy.placement, locked = busy || Boolean(draft.attempt)
|
|
5260
|
+
const blocked = busy || !draft.attempt && (stale || otherDirty)
|
|
5261
|
+
const number = (id, label, integer = false) => {
|
|
5262
|
+
const invalid = placementFieldInvalid(draft, id), errorId = `placement-${draft.projectId}-${id}-error`
|
|
5263
|
+
return el('label', { className: 'db-field', key: id }, label,
|
|
5264
|
+
el('input', { type: 'number', className: 'db-input', 'data-field': `placement-${id}`, 'aria-label': label,
|
|
5265
|
+
value: draft.values[id], min: placementLimits[id][0], max: placementLimits[id][1], step: integer ? 1 : 'any',
|
|
5266
|
+
disabled: locked, 'aria-invalid': invalid ? 'true' : undefined, 'aria-describedby': invalid ? errorId : undefined,
|
|
5267
|
+
onInput: event => actions.setPlacementValue(id, event.currentTarget.value) }),
|
|
5268
|
+
invalid ? el('span', { className: 'db-field-feedback', id: errorId }, t('placement.invalid')) : null)
|
|
5269
|
+
}
|
|
5270
|
+
return el('section', { className: 'db-card db-placement-editor', 'data-placement-editor': true, 'data-placement-base-revision': draft.baseRevision,
|
|
5271
|
+
'aria-busy': busy ? 'true' : undefined },
|
|
5272
|
+
el('h4', null, t('placement.title')),
|
|
5273
|
+
el('p', { className: 'db-muted' }, t('placement.help', { count: draft.memberEntityIds.length })),
|
|
5274
|
+
stale ? el('p', { className: 'db-error' }, t('assembly.stale')) : null,
|
|
5275
|
+
otherDirty ? el('p', { className: 'db-muted' }, t('assembly.otherDraft')) : null,
|
|
5276
|
+
draft.attempt && !busy ? el('p', { className: 'db-muted', role: 'status' }, t('placement.unconfirmed')) : null,
|
|
5277
|
+
el('label', { className: 'db-field' }, t('placement.support'),
|
|
5278
|
+
el('select', { className: 'db-input', 'data-field': 'placement-support', 'aria-label': t('placement.support'),
|
|
5279
|
+
value: draft.supportEntityId, disabled: locked, onChange: event => actions.setPlacementSupport(event.currentTarget.value) },
|
|
5280
|
+
el('option', { value: '' }, t('placement.chooseSupport')), draft.supports.map(entity =>
|
|
5281
|
+
el('option', { key: entity.id, value: entity.id }, entity.id)))),
|
|
5282
|
+
el('div', { className: 'db-placement-grid' }, number('x', t('placement.x')), number('y', t('placement.y')),
|
|
5283
|
+
number('yaw', t('placement.yaw')), number('clearance', t('placement.clearance'))),
|
|
5284
|
+
Disclosure(ctx, 'placement-pivot', t('placement.more'), {},
|
|
5285
|
+
el('p', { className: 'db-muted' }, t('placement.pivotHelp')),
|
|
5286
|
+
el('div', { className: 'db-placement-grid' }, number('z', t('placement.z')),
|
|
5287
|
+
...['X', 'Y', 'Z'].map(axis => number(`pivot${axis}`, t('placement.pivot', { axis }))), number('frame', t('placement.frame'), true))),
|
|
5288
|
+
el('p', { className: 'db-muted' }, t('placement.photo')),
|
|
5289
|
+
el('div', { className: 'db-inline' },
|
|
5290
|
+
Button({ tone: 'primary', action: 'placement-save', disabled: Boolean(blocked) || placementInvalid(draft) || !placementDirty(draft),
|
|
5291
|
+
onClick: actions.savePlacement, children: busy ? t('placement.saving') : draft.attempt ? t('placement.retry') : t('placement.save') }),
|
|
5292
|
+
busy ? Button({ action: 'placement-cancel', onClick: actions.cancelPlacement, children: t('placement.cancel') })
|
|
5293
|
+
: Button({ action: 'placement-reset', onClick: actions.resetPlacement, children: t('editor.reset') })))
|
|
5294
|
+
}
|
|
5295
|
+
|
|
5108
5296
|
function SceneEditor(ctx) {
|
|
5109
5297
|
const { state, actions } = ctx, draft = editorDraftFor(state)
|
|
5110
5298
|
const lastEdit = state.editorLastEdits?.[state.activeProjectId]
|
|
@@ -5632,7 +5820,7 @@ window.__ModuleLoader__.load({
|
|
|
5632
5820
|
el('span', { className: 'db-muted db-mono' }, String(asset.path || '')))),
|
|
5633
5821
|
)),
|
|
5634
5822
|
el('section', { className: 'db-scene-inspector', 'aria-label': t('scene.inspector') },
|
|
5635
|
-
AssemblyEditor(ctx), SceneEditor(ctx),
|
|
5823
|
+
AssemblyEditor(ctx), AssemblyPlacementEditor(ctx), SceneEditor(ctx),
|
|
5636
5824
|
Disclosure(ctx, 'photography', t('lighttable.photography'), { className: 'db-tool-disclosure' }, PhotographyEditor(ctx)),
|
|
5637
5825
|
Disclosure(ctx, 'assets', t('lighttable.assets'), { className: 'db-tool-disclosure' }, AssetsView(ctx)),
|
|
5638
5826
|
el('details', { key: advancedDisclosure, 'data-disclosure': advancedDisclosure, open: state.disclosures?.[advancedDisclosure] ?? false,
|
|
@@ -6014,7 +6202,8 @@ window.__ModuleLoader__.load({
|
|
|
6014
6202
|
}),
|
|
6015
6203
|
Notice(state.previewResult, { border: 0, padding: '0 6px', marginBottom: 0 }),
|
|
6016
6204
|
state.notices.preview?.kind === 'creation' && state.notices.preview.projectId === state.activeProjectId
|
|
6017
|
-
? Notice(state.notices.preview, { border: 0, padding: '0 6px', marginBottom: 0 })
|
|
6205
|
+
? Notice(state.notices.preview, { border: 0, padding: '0 6px', marginBottom: 0 })
|
|
6206
|
+
: Notice(placementPreviewNotice(state), { border: 0, padding: '0 6px', marginBottom: 0 }),
|
|
6018
6207
|
),
|
|
6019
6208
|
el('div', { className: 'db-tabs' },
|
|
6020
6209
|
el('span', { className: 'db-muted' }, t('preview.compare')),
|
|
@@ -6427,7 +6616,7 @@ window.__ModuleLoader__.load({
|
|
|
6427
6616
|
el('p', null, t('lighttable.loading')), el('div', { className: 'db-loading-stage' }), el('div', { className: 'db-loading-line' }))
|
|
6428
6617
|
: el('div', { className: 'db-body', key: bodyKey, 'data-scroll-key': bodyKey },
|
|
6429
6618
|
active && (state.view !== 'projects' || state.projectTask !== 'new') ? LighttableWorkspace(ctx) : [
|
|
6430
|
-
state.view === 'preview'
|
|
6619
|
+
state.view === 'preview' ? Notice(state.notices.preview?.kind === 'creation' ? state.notices.preview : placementPreviewNotice(state)) : null,
|
|
6431
6620
|
ProjectsView({ ...ctx, newWork: true }), CreationGuide(ctx)])
|
|
6432
6621
|
return el('div', { className: 'db-root', 'data-theme': state.appearance || 'system', 'data-deepblend-panel': PANEL_ID },
|
|
6433
6622
|
el('header', { className: 'db-head' },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepblend/dsh-blender-bundle",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"description": "Create Blender product scenes in DSH with editable recipes, model imports, previews and PNG/MP4 delivery; includes workbench and agent configuration.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -44,12 +44,12 @@
|
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@deepblend/dsh-blender-contracts": "0.
|
|
48
|
-
"@deepblend/dsh-blender-host": "0.
|
|
49
|
-
"@deepblend/dsh-blender-preset": "0.
|
|
50
|
-
"@deepblend/dsh-blender-provider-local": "0.
|
|
51
|
-
"@deepblend/dsh-blender-tool": "0.
|
|
52
|
-
"@deepblend/dsh-blender-ui": "0.
|
|
47
|
+
"@deepblend/dsh-blender-contracts": "0.21.0",
|
|
48
|
+
"@deepblend/dsh-blender-host": "0.21.0",
|
|
49
|
+
"@deepblend/dsh-blender-preset": "0.21.0",
|
|
50
|
+
"@deepblend/dsh-blender-provider-local": "0.21.0",
|
|
51
|
+
"@deepblend/dsh-blender-tool": "0.21.0",
|
|
52
|
+
"@deepblend/dsh-blender-ui": "0.21.0"
|
|
53
53
|
},
|
|
54
54
|
"type": "module",
|
|
55
55
|
"license": "MIT",
|