@deepblend/dsh-blender-bundle 0.28.1 → 0.29.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 +142 -11
- package/package.json +7 -7
package/lib/client.js
CHANGED
|
@@ -539,7 +539,14 @@ window.__ModuleLoader__.load({
|
|
|
539
539
|
'editor.uv.direction': '纹理方向',
|
|
540
540
|
'editor.uv.scale': '纹理重复',
|
|
541
541
|
'editor.uv.scaleInvalid': '请输入 0.0001 到 10000 之间的重复次数。',
|
|
542
|
-
'editor.uv.scaleHelp': '
|
|
542
|
+
'editor.uv.scaleHelp': '最长局部网格边界跨度内的重复次数。',
|
|
543
|
+
'editor.uv.includePartner': '也重建 {name} 的 UV',
|
|
544
|
+
'editor.uv.previewCamera': '预览机位',
|
|
545
|
+
'editor.uv.preview': '预览纹理',
|
|
546
|
+
'editor.uv.previewBusy': '正在渲染纹理…',
|
|
547
|
+
'editor.uv.previewCaption': '草稿预览 · {camera} · 第 {frame} 帧',
|
|
548
|
+
'editor.uv.previewImage': '两组木条的纹理草稿预览',
|
|
549
|
+
'editor.uv.previewError': '纹理预览失败。{message}',
|
|
543
550
|
'editor.halfLap.title': '半搭接',
|
|
544
551
|
'editor.halfLap.partner': '搭接对象',
|
|
545
552
|
'editor.halfLap.none': '无搭接',
|
|
@@ -1458,7 +1465,14 @@ window.__ModuleLoader__.load({
|
|
|
1458
1465
|
'editor.uv.direction': 'Texture direction',
|
|
1459
1466
|
'editor.uv.scale': 'Texture repetitions',
|
|
1460
1467
|
'editor.uv.scaleInvalid': 'Enter repetitions from 0.0001 to 10000.',
|
|
1461
|
-
'editor.uv.scaleHelp': 'Repetitions across the longest local mesh extent.
|
|
1468
|
+
'editor.uv.scaleHelp': 'Repetitions across the longest local mesh extent.',
|
|
1469
|
+
'editor.uv.includePartner': 'Also rebuild UVs on {name}',
|
|
1470
|
+
'editor.uv.previewCamera': 'Preview camera',
|
|
1471
|
+
'editor.uv.preview': 'Preview texture',
|
|
1472
|
+
'editor.uv.previewBusy': 'Rendering texture…',
|
|
1473
|
+
'editor.uv.previewCaption': 'Draft preview · {camera} · Frame {frame}',
|
|
1474
|
+
'editor.uv.previewImage': 'Texture draft of both timber groups',
|
|
1475
|
+
'editor.uv.previewError': 'Texture preview failed. {message}',
|
|
1462
1476
|
'editor.halfLap.title': 'Half lap',
|
|
1463
1477
|
'editor.halfLap.partner': 'Join with',
|
|
1464
1478
|
'editor.halfLap.none': 'No joint',
|
|
@@ -2787,6 +2801,12 @@ window.__ModuleLoader__.load({
|
|
|
2787
2801
|
&& ['location', 'rotationEuler', 'scale'].includes(track.property?.split('.')[0]))
|
|
2788
2802
|
}
|
|
2789
2803
|
|
|
2804
|
+
function editorTimberUvPartner(draft) {
|
|
2805
|
+
const partner = editorHalfLapPartner(draft.originalHalfLap, draft.entityId)
|
|
2806
|
+
return draft.entities.find(entity => entity.id === partner
|
|
2807
|
+
&& entity.kind === 'generator' && entity.generator?.shape === 'mesh')
|
|
2808
|
+
}
|
|
2809
|
+
|
|
2790
2810
|
function editorHalfLapPartners(draft) {
|
|
2791
2811
|
const saved = editorHalfLapPartner(draft.originalHalfLap, draft.entityId)
|
|
2792
2812
|
const canJoin = editorTimberCandidate(draft.entity, draft.tracks) && (saved || (draft.halfLaps?.length ?? 0) < 32)
|
|
@@ -2871,6 +2891,7 @@ window.__ModuleLoader__.load({
|
|
|
2871
2891
|
if (draft.entity.kind !== 'generator' || generator?.shape !== 'mesh') bad(t('editor.uv.title'))
|
|
2872
2892
|
scalar(draft.uvProjection.quarterTurns, t('editor.uv.direction'), 0, 3, true)
|
|
2873
2893
|
scalar(draft.uvProjection.scale, t('editor.uv.scale'), 0.0001, 10000)
|
|
2894
|
+
if (draft.uvProjection.includePartner && !editorTimberUvPartner(draft)) bad(t('editor.uv.title'))
|
|
2874
2895
|
}
|
|
2875
2896
|
if (draft.halfLap) {
|
|
2876
2897
|
scalar(Object.hasOwn(draft.halfLap, 'edgeWidth') ? draft.halfLap.edgeWidth : 0, t('editor.halfLap.edgeWidth'), 0, .005)
|
|
@@ -3002,7 +3023,12 @@ window.__ModuleLoader__.load({
|
|
|
3002
3023
|
for (const key of ['location', 'rotationEuler']) if (!editorEqual(entity.transform[key], original.transform[key])) transform[key] = editorClone(entity.transform[key])
|
|
3003
3024
|
if (Object.keys(transform).length > 2) operations.push(transform)
|
|
3004
3025
|
if (!editorEqual(entity.generator, original.generator)) operations.push({ op: 'entity.generator.set', entityId: draft.entityId, generator: editorClone(entity.generator) })
|
|
3005
|
-
if (draft.uvProjection != null)
|
|
3026
|
+
if (draft.uvProjection != null) {
|
|
3027
|
+
const { quarterTurns, scale, includePartner } = draft.uvProjection
|
|
3028
|
+
const projection = { op: 'entity.uv.project', quarterTurns, scale }
|
|
3029
|
+
operations.push({ ...projection, entityId: draft.entityId })
|
|
3030
|
+
if (includePartner) operations.push({ ...projection, entityId: editorTimberUvPartner(draft).id })
|
|
3031
|
+
}
|
|
3006
3032
|
if (!editorEqual(entity.modifiers, original.modifiers)) operations.push({ op: 'entity.modifiers.set', entityId: draft.entityId, modifiers: editorClone(entity.modifiers) })
|
|
3007
3033
|
const { halfLap, originalHalfLap } = draft
|
|
3008
3034
|
if (halfLap?.lowerEntityId !== originalHalfLap?.lowerEntityId || halfLap?.upperEntityId !== originalHalfLap?.upperEntityId
|
|
@@ -3048,6 +3074,38 @@ window.__ModuleLoader__.load({
|
|
|
3048
3074
|
return state.editorDrafts?.[editorKey(state.activeProjectId, state.editorEntityId)] || null
|
|
3049
3075
|
}
|
|
3050
3076
|
|
|
3077
|
+
function timberUvPreviewCamera(scene, draft) {
|
|
3078
|
+
const cameras = scene?.nodes?.cameras ?? []
|
|
3079
|
+
const requested = draft.uvProjection?.cameraId ?? scene?.project?.activeCamera
|
|
3080
|
+
return cameras.find(camera => camera.id === requested) ?? cameras[0]
|
|
3081
|
+
}
|
|
3082
|
+
|
|
3083
|
+
function timberUvPreviewIntent(state, draft = editorDraftFor(state), patch) {
|
|
3084
|
+
const scene = state.selected?.scene
|
|
3085
|
+
if (!state.timberUvPreviewSupported || state.view !== 'scene' || !draft?.uvProjection?.includePartner
|
|
3086
|
+
|| !scene || draft.baseRevision !== scene.revision || !/^[a-f0-9]{64}$/.test(scene.digest ?? '')
|
|
3087
|
+
|| !/^[a-f0-9]{64}$/.test(state.storeIdentity ?? '')) return null
|
|
3088
|
+
const partner = editorTimberUvPartner(draft)
|
|
3089
|
+
const camera = timberUvPreviewCamera(scene, draft)
|
|
3090
|
+
if (!partner || !camera || !Number.isInteger(scene.project.frameStart)) return null
|
|
3091
|
+
try { patch ??= buildEditorPatch(draft) } catch { return null }
|
|
3092
|
+
const key = JSON.stringify([state.storeIdentity, scene.digest, camera.id, patch])
|
|
3093
|
+
return { key, patch, expectedDigest: scene.digest, expectedStoreIdentity: state.storeIdentity,
|
|
3094
|
+
cameraId: camera.id, frame: scene.project.frameStart, entities: [draft.entityId, partner.id] }
|
|
3095
|
+
}
|
|
3096
|
+
|
|
3097
|
+
function verifiedTimberUvPreview(preview, intent) {
|
|
3098
|
+
const image = preview?.image
|
|
3099
|
+
return preview?.schemaVersion === 'deepblend.timber-uv-preview/v1' && preview.projectId === intent.patch.projectId
|
|
3100
|
+
&& preview.baseRevision === intent.patch.baseRevision && preview.baseDigest === intent.expectedDigest
|
|
3101
|
+
&& preview.storeIdentity === intent.expectedStoreIdentity && /^[a-f0-9]{64}$/.test(preview.candidateSpecHash ?? '')
|
|
3102
|
+
&& preview.cameraId === intent.cameraId && preview.frame === intent.frame && editorEqual(preview.entities, intent.entities)
|
|
3103
|
+
&& Number.isInteger(image?.width) && image.width > 0 && image.width <= 720
|
|
3104
|
+
&& Number.isInteger(image.height) && image.height > 0 && image.height <= 720
|
|
3105
|
+
&& /^[a-f0-9]{64}$/.test(image.sha256 ?? '') && typeof image.pngBase64 === 'string'
|
|
3106
|
+
&& image.pngBase64.length <= 4194304 && /^iVBORw0KGgo[A-Za-z0-9+/]+=*$/.test(image.pngBase64)
|
|
3107
|
+
}
|
|
3108
|
+
|
|
3051
3109
|
function halfLapPreviewIntent(state, draft = editorDraftFor(state), patch) {
|
|
3052
3110
|
const scene = state.selected?.scene
|
|
3053
3111
|
if (!state.halfLapPreviewSupported || state.view !== 'scene' || !draft?.halfLap || !scene || draft.baseRevision !== scene.revision
|
|
@@ -3876,6 +3934,8 @@ window.__ModuleLoader__.load({
|
|
|
3876
3934
|
editorDrafts: {},
|
|
3877
3935
|
halfLapPreviewSupported: false,
|
|
3878
3936
|
halfLapPreview: null,
|
|
3937
|
+
timberUvPreviewSupported: false,
|
|
3938
|
+
timberUvPreview: null,
|
|
3879
3939
|
geometryMeasurements: {},
|
|
3880
3940
|
editorLastEdits: {},
|
|
3881
3941
|
editorComparison: null,
|
|
@@ -3965,6 +4025,7 @@ window.__ModuleLoader__.load({
|
|
|
3965
4025
|
const cameraFitStorage = settings.cameraFitStorage ?? preferenceStorage
|
|
3966
4026
|
const motionControllers = new Map()
|
|
3967
4027
|
let halfLapPreviewController
|
|
4028
|
+
let timberUvPreviewController
|
|
3968
4029
|
let imageProbeController = null
|
|
3969
4030
|
const motionStorage = settings.motionStorage ?? preferenceStorage
|
|
3970
4031
|
const motionWork = (key, changes) => set({ motionWork: { ...data.motionWork, [key]: { ...data.motionWork[key], ...changes } } })
|
|
@@ -4054,6 +4115,11 @@ window.__ModuleLoader__.load({
|
|
|
4054
4115
|
halfLapPreviewController = undefined
|
|
4055
4116
|
next.halfLapPreview = null
|
|
4056
4117
|
}
|
|
4118
|
+
if (next.timberUvPreview && timberUvPreviewIntent(next)?.key !== next.timberUvPreview.key) {
|
|
4119
|
+
timberUvPreviewController?.abort()
|
|
4120
|
+
timberUvPreviewController = undefined
|
|
4121
|
+
next.timberUvPreview = null
|
|
4122
|
+
}
|
|
4057
4123
|
data = next; notify()
|
|
4058
4124
|
}
|
|
4059
4125
|
/** Change one nested table. @param {'forms'|'busy'|'notices'} table @param {string} key @param {any} value */
|
|
@@ -4148,6 +4214,7 @@ window.__ModuleLoader__.load({
|
|
|
4148
4214
|
stillImageDeliverySupported: payload.stillImageDeliverySupported === true,
|
|
4149
4215
|
motionPreviewSupported: payload.motionPreviewSupported === true,
|
|
4150
4216
|
halfLapPreviewSupported: payload.halfLapPreviewSupported === true,
|
|
4217
|
+
timberUvPreviewSupported: payload.timberUvPreviewSupported === true,
|
|
4151
4218
|
imageInputProbeSupported: payload.imageInputProbeSupported === true,
|
|
4152
4219
|
selectedReviewViewsSupported: payload.selectedReviewViewsSupported === true,
|
|
4153
4220
|
creationRequestProtocol: payload.creationRequestProtocol ?? null,
|
|
@@ -5531,7 +5598,7 @@ window.__ModuleLoader__.load({
|
|
|
5531
5598
|
},
|
|
5532
5599
|
previewHalfLap: async () => {
|
|
5533
5600
|
const intent = halfLapPreviewIntent(data)
|
|
5534
|
-
if (!intent || data.busy.editor || halfLapPreviewController) return
|
|
5601
|
+
if (!intent || data.busy.editor || halfLapPreviewController || timberUvPreviewController) return
|
|
5535
5602
|
const controller = new AbortController()
|
|
5536
5603
|
halfLapPreviewController = controller
|
|
5537
5604
|
const { key, patch, expectedDigest, expectedStoreIdentity } = intent
|
|
@@ -5553,6 +5620,35 @@ window.__ModuleLoader__.load({
|
|
|
5553
5620
|
if (halfLapPreviewController === controller) halfLapPreviewController = undefined
|
|
5554
5621
|
}
|
|
5555
5622
|
},
|
|
5623
|
+
cancelTimberUvPreview: () => {
|
|
5624
|
+
timberUvPreviewController?.abort()
|
|
5625
|
+
timberUvPreviewController = undefined
|
|
5626
|
+
set({ timberUvPreview: null })
|
|
5627
|
+
},
|
|
5628
|
+
previewTimberUv: async () => {
|
|
5629
|
+
const intent = timberUvPreviewIntent(data)
|
|
5630
|
+
if (!intent || data.busy.editor || timberUvPreviewController || halfLapPreviewController) return
|
|
5631
|
+
const controller = new AbortController()
|
|
5632
|
+
timberUvPreviewController = controller
|
|
5633
|
+
const { key, patch, expectedDigest, expectedStoreIdentity, cameraId } = intent
|
|
5634
|
+
const active = () => running && timberUvPreviewController === controller && !controller.signal.aborted
|
|
5635
|
+
set({ timberUvPreview: { key, busy: true } })
|
|
5636
|
+
try {
|
|
5637
|
+
const response = await fetchImpl(projectRoute(patch.projectId, '/timber-uv-preview'), {
|
|
5638
|
+
method: 'POST', headers: { 'content-type': 'application/json', accept: 'application/json' }, signal: controller.signal,
|
|
5639
|
+
body: JSON.stringify({ patch, expectedDigest, expectedStoreIdentity, cameraId }),
|
|
5640
|
+
})
|
|
5641
|
+
const payload = await response.json()
|
|
5642
|
+
if (!active()) return
|
|
5643
|
+
if (!response.ok || !payload.ok) throw new Error(payload.error?.message || response.status)
|
|
5644
|
+
if (!verifiedTimberUvPreview(payload.preview, intent)) throw new Error(t('inspection.mismatch'))
|
|
5645
|
+
set({ timberUvPreview: { key, result: payload.preview } })
|
|
5646
|
+
} catch (error) {
|
|
5647
|
+
if (active()) set({ timberUvPreview: { key, error: error.message || String(error) } })
|
|
5648
|
+
} finally {
|
|
5649
|
+
if (timberUvPreviewController === controller) timberUvPreviewController = undefined
|
|
5650
|
+
}
|
|
5651
|
+
},
|
|
5556
5652
|
updateEditor: (section, path, value) => {
|
|
5557
5653
|
const current = editorDraftFor(data)
|
|
5558
5654
|
if (!current || data.busy.editor || !['transform', 'generator', 'modifiers', 'material', 'uvProjection'].includes(section)) return
|
|
@@ -5616,10 +5712,11 @@ window.__ModuleLoader__.load({
|
|
|
5616
5712
|
try { patch = buildEditorPatch(draft) } catch (error) {
|
|
5617
5713
|
setIn('notices', 'scene', { ok: false, message: error.message }); return
|
|
5618
5714
|
}
|
|
5619
|
-
if (!patch.operations.length || data.halfLapPreview?.busy) return
|
|
5620
|
-
const
|
|
5621
|
-
const
|
|
5622
|
-
|
|
5715
|
+
if (!patch.operations.length || data.halfLapPreview?.busy || data.timberUvPreview?.busy) return
|
|
5716
|
+
const slot = data.halfLapPreview, texture = data.timberUvPreview
|
|
5717
|
+
const inspection = texture?.result && timberUvPreviewIntent(data, draft, patch)?.key === texture.key
|
|
5718
|
+
? texture.result : slot?.result && halfLapPreviewIntent(data, draft, patch)?.key === slot.key ? slot.result : null
|
|
5719
|
+
const request = inspection ? { patch, expectedSpecHash: inspection.candidateSpecHash, expectedStoreIdentity: inspection.storeIdentity } : { patch }
|
|
5623
5720
|
const beforePreviews = editorClone(data.previews?.revisions?.find(item => item.revision === draft.baseRevision)?.previews || [])
|
|
5624
5721
|
setIn('busy', 'editor', true)
|
|
5625
5722
|
const outcome = await postJson(fetchImpl, projectRoute(draft.projectId, '/patch'), request)
|
|
@@ -5981,6 +6078,10 @@ window.__ModuleLoader__.load({
|
|
|
5981
6078
|
motionControllers.clear()
|
|
5982
6079
|
halfLapPreviewController?.abort()
|
|
5983
6080
|
halfLapPreviewController = undefined
|
|
6081
|
+
timberUvPreviewController?.abort()
|
|
6082
|
+
timberUvPreviewController = undefined
|
|
6083
|
+
data = { ...data, timberUvPreview: null }
|
|
6084
|
+
snapshot = { ...snapshot, timberUvPreview: null }
|
|
5984
6085
|
photographyControllers.clear()
|
|
5985
6086
|
for (const controller of placementControllers.values()) controller.abort()
|
|
5986
6087
|
placementControllers.clear()
|
|
@@ -6461,8 +6562,13 @@ window.__ModuleLoader__.load({
|
|
|
6461
6562
|
const slotIntent = halfLapPreviewIntent(state, draft)
|
|
6462
6563
|
const slotWork = slotIntent && state.halfLapPreview?.key === slotIntent.key ? state.halfLapPreview : null
|
|
6463
6564
|
const slotResult = slotWork?.result
|
|
6565
|
+
const uvPartner = state.timberUvPreviewSupported ? editorTimberUvPartner(draft) : null
|
|
6566
|
+
const uvScene = state.selected?.scene
|
|
6567
|
+
const uvIntent = timberUvPreviewIntent(state, draft)
|
|
6568
|
+
const uvWork = uvIntent && state.timberUvPreview?.key === uvIntent.key ? state.timberUvPreview : null
|
|
6569
|
+
const uvResult = uvWork?.result
|
|
6464
6570
|
const apply = Button({ action: 'editor-apply', tone: 'primary',
|
|
6465
|
-
disabled: disabled || !dirty || errors.length > 0 || slotWork?.busy === true, onClick: actions.applyEditor, children: t('editor.apply') })
|
|
6571
|
+
disabled: disabled || !dirty || errors.length > 0 || slotWork?.busy === true || uvWork?.busy === true, onClick: actions.applyEditor, children: t('editor.apply') })
|
|
6466
6572
|
const geometryField = key => {
|
|
6467
6573
|
const bounds = generatorIntegerBounds(geometry, key)
|
|
6468
6574
|
if (key === 'rootTension') return numeric(labels[key], `editor-generator-${key}`, geometry[key],
|
|
@@ -6540,6 +6646,8 @@ window.__ModuleLoader__.load({
|
|
|
6540
6646
|
toggle(t('editor.uv.project'), 'editor-uv-project', draft.uvProjection != null,
|
|
6541
6647
|
value => actions.updateEditor('uvProjection', [], value ? { quarterTurns: 0, scale: 1 } : null)),
|
|
6542
6648
|
draft.uvProjection ? [
|
|
6649
|
+
uvPartner ? toggle(t('editor.uv.includePartner', { name: uvPartner.name || uvPartner.id }), 'editor-uv-partner',
|
|
6650
|
+
draft.uvProjection.includePartner === true, value => actions.updateEditor('uvProjection', ['includePartner'], value)) : null,
|
|
6543
6651
|
el('p', { className: 'db-muted', key: 'uv-help' }, t('editor.uv.help')),
|
|
6544
6652
|
choose(t('editor.uv.direction'), 'editor-uv-quarterTurns', String(draft.uvProjection.quarterTurns),
|
|
6545
6653
|
[0, 1, 2, 3].map(turn => [String(turn), `${turn * 90}°`]), value => actions.updateEditor('uvProjection', ['quarterTurns'], Number(value))),
|
|
@@ -6548,6 +6656,12 @@ window.__ModuleLoader__.load({
|
|
|
6548
6656
|
invalid: draft.uvProjection.scale < 0.0001 || draft.uvProjection.scale > 10000,
|
|
6549
6657
|
error: t('editor.uv.scaleInvalid') }),
|
|
6550
6658
|
el('p', { className: 'db-muted', key: 'uv-scale-help' }, t('editor.uv.scaleHelp')),
|
|
6659
|
+
draft.uvProjection.includePartner && uvPartner ? [
|
|
6660
|
+
uvScene?.nodes.cameras?.length > 1 ? choose(t('editor.uv.previewCamera'), 'editor-uv-camera',
|
|
6661
|
+
timberUvPreviewCamera(uvScene, draft)?.id, uvScene.nodes.cameras.map(camera => [camera.id, camera.name || camera.id]),
|
|
6662
|
+
value => actions.updateEditor('uvProjection', ['cameraId'], value)) : null,
|
|
6663
|
+
TimberUvPreview({ work: uvWork, apply, disabled: disabled || !uvIntent || slotWork?.busy === true, actions }),
|
|
6664
|
+
] : null,
|
|
6551
6665
|
] : null),
|
|
6552
6666
|
halfLapOptions.length ? el('fieldset', { key: 'half-lap', 'data-half-lap-editor': true, disabled, style: { border: 0, padding: 0, margin: '16px 0' } },
|
|
6553
6667
|
el('legend', null, t('editor.halfLap.title')),
|
|
@@ -6560,7 +6674,7 @@ window.__ModuleLoader__.load({
|
|
|
6560
6674
|
actions.setEditorHalfLapWidth, { factor: 1000, min: 0, max: 5, step: .05,
|
|
6561
6675
|
invalid: halfLapEdgeWidth < 0 || halfLapEdgeWidth > .005, error: t('editor.halfLap.edgeInvalid') }) : null,
|
|
6562
6676
|
halfLapPartner ? el('p', { className: 'db-muted', key: 'edge-width-help' }, t('editor.halfLap.edgeHelp')) : null,
|
|
6563
|
-
slotIntent ? HalfLapPreview({ slotWork, apply, disabled, actions }) : null) : null] : null,
|
|
6677
|
+
slotIntent ? HalfLapPreview({ slotWork, apply: uvResult ? null : apply, disabled: disabled || uvWork?.busy === true, actions }) : null) : null] : null,
|
|
6564
6678
|
el('p', { className: 'db-muted', key: 'local-size' }, t('editor.localDimensions', { scale: (draft.entity.transform.scale || [1, 1, 1]).join(' × ') })),
|
|
6565
6679
|
geometry.shape === 'rounded_box' ? el('p', { className: 'db-muted', key: 'rounded' }, t('editor.roundedRequired')) : null,
|
|
6566
6680
|
geometry.shape === 'handled_cup' ? el('p', { className: 'db-muted', key: 'cup-help' }, t('editor.cupHelp')) : null,
|
|
@@ -6670,13 +6784,30 @@ window.__ModuleLoader__.load({
|
|
|
6670
6784
|
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,
|
|
6671
6785
|
children: t('editor.add', { name }), onClick: () => actions.editEditorList('modifiers', 0, 'add', type) })))) : null,
|
|
6672
6786
|
errors.length ? el('div', { className: 'db-error', 'data-editor-errors': true }, errors.join(' ')) : null,
|
|
6673
|
-
el('div', { className: 'db-inline db-editor-actions' }, slotResult ? null : apply,
|
|
6787
|
+
el('div', { className: 'db-inline db-editor-actions' }, slotResult || uvResult ? null : apply,
|
|
6674
6788
|
Button({ action: 'editor-reset', disabled: state.busy.editor, onClick: actions.resetEditor, children: t('editor.reset') }),
|
|
6675
6789
|
Button({ action: 'editor-review-subject', disabled: disabled || draft.entity.visible === false || draft.entity.kind === 'empty'
|
|
6676
6790
|
|| state.briefWork[state.activeProjectId]?.saving || state.visualRuns[state.activeProjectId]?.busy,
|
|
6677
6791
|
onClick: () => actions.setReviewSubject(draft.entityId), children: t('brief.subjectShortcut') }), restore))
|
|
6678
6792
|
}
|
|
6679
6793
|
|
|
6794
|
+
function TimberUvPreview({ work, apply, disabled, actions }) {
|
|
6795
|
+
const result = work?.result
|
|
6796
|
+
return el('div', { key: 'uv-preview', 'data-timber-uv-preview': result ? 'ready' : work?.busy ? 'loading' : work?.error ? 'error' : 'idle',
|
|
6797
|
+
'aria-busy': work?.busy === true },
|
|
6798
|
+
el('div', { className: 'db-inline' },
|
|
6799
|
+
Button({ action: 'timber-uv-preview', disabled: disabled || work?.busy === true,
|
|
6800
|
+
children: work?.busy ? t('editor.uv.previewBusy') : t('editor.uv.preview'), onClick: actions.previewTimberUv }),
|
|
6801
|
+
work?.busy ? Button({ action: 'timber-uv-preview-cancel', children: t('geometry.cancel'), onClick: actions.cancelTimberUvPreview }) : null),
|
|
6802
|
+
result ? el('figure', { style: { margin: '12px 0' } },
|
|
6803
|
+
el('img', { src: `data:image/png;base64,${result.image.pngBase64}`, alt: t('editor.uv.previewImage'),
|
|
6804
|
+
width: result.image.width, height: result.image.height, style: { display: 'block', width: '100%', height: 'auto' } }),
|
|
6805
|
+
el('figcaption', { className: 'db-muted', role: 'status', style: { overflowWrap: 'anywhere' } },
|
|
6806
|
+
t('editor.uv.previewCaption', { camera: result.cameraId, frame: result.frame }))) : null,
|
|
6807
|
+
result ? apply : null,
|
|
6808
|
+
work?.error ? el('p', { className: 'db-error', role: 'alert' }, t('editor.uv.previewError', { message: work.error })) : null)
|
|
6809
|
+
}
|
|
6810
|
+
|
|
6680
6811
|
function HalfLapPreview({ slotWork, apply, disabled, actions }) {
|
|
6681
6812
|
const result = slotWork?.result
|
|
6682
6813
|
const picture = (role, caption, label) => el('figure', { style: { margin: '12px 0' } },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepblend/dsh-blender-bundle",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.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.29.0",
|
|
48
|
+
"@deepblend/dsh-blender-host": "0.29.0",
|
|
49
|
+
"@deepblend/dsh-blender-preset": "0.29.0",
|
|
50
|
+
"@deepblend/dsh-blender-provider-local": "0.29.0",
|
|
51
|
+
"@deepblend/dsh-blender-tool": "0.29.0",
|
|
52
|
+
"@deepblend/dsh-blender-ui": "0.29.0"
|
|
53
53
|
},
|
|
54
54
|
"type": "module",
|
|
55
55
|
"license": "MIT",
|