@deepblend/dsh-blender-bundle 0.31.0 → 0.32.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 +66 -16
- package/package.json +7 -7
package/lib/client.js
CHANGED
|
@@ -942,6 +942,7 @@ window.__ModuleLoader__.load({
|
|
|
942
942
|
'revisions.sourceUnknown': '暂无法确认工程内容变化',
|
|
943
943
|
'revisions.restore': '恢复',
|
|
944
944
|
"snapshot.title": "保存可编辑副本",
|
|
945
|
+
"snapshot.includeJob": "加入可编辑副本",
|
|
945
946
|
"snapshot.scope": "包含 Blender 工程、源文件与相关外部素材。",
|
|
946
947
|
"snapshot.details": "副本范围",
|
|
947
948
|
"snapshot.detailText": "仅包含选定的已保存版本。仅用于观察的外部参考图不另行附带;工程内嵌内容未另行检查。可附带同版本的已完成影片和图片。未保存的编辑不会进入副本。",
|
|
@@ -1876,6 +1877,7 @@ window.__ModuleLoader__.load({
|
|
|
1876
1877
|
'revisions.sourceUnknown': 'Project content change could not be confirmed',
|
|
1877
1878
|
'revisions.restore': 'restore',
|
|
1878
1879
|
"snapshot.title": "Save an editable copy",
|
|
1880
|
+
"snapshot.includeJob": "Include in editable copy",
|
|
1879
1881
|
"snapshot.scope": "Includes the Blender project, source files and relevant external assets.",
|
|
1880
1882
|
"snapshot.details": "What the copy includes",
|
|
1881
1883
|
"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.",
|
|
@@ -3891,13 +3893,36 @@ window.__ModuleLoader__.load({
|
|
|
3891
3893
|
const snapshotContextKey = state => state.projectsRoot && state.storeIdentity && state.activeProjectId
|
|
3892
3894
|
? JSON.stringify([state.projectsRoot, state.storeIdentity, state.activeProjectId]) : null
|
|
3893
3895
|
const snapshotEntry = state => state.editableSnapshots?.[snapshotContextKey(state)] || null
|
|
3894
|
-
const
|
|
3895
|
-
&&
|
|
3896
|
-
const
|
|
3896
|
+
const snapshotVideoJob = job => job.status === 'completed'
|
|
3897
|
+
&& typeof job.delivery?.videoPath === 'string' && job.delivery.videoPath.length > 0
|
|
3898
|
+
const snapshotImageJob = job => job.status === 'completed'
|
|
3897
3899
|
&& job.delivery?.kind === 'still' && job.delivery.verified === true && Number.isSafeInteger(job.delivery.image?.frame)
|
|
3898
|
-
&& /^[a-f0-9]{64}$/.test(job.delivery.image?.sha256 || '') && /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$/.test(job.jobId || '')
|
|
3900
|
+
&& /^[a-f0-9]{64}$/.test(job.delivery.image?.sha256 || '') && /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$/.test(job.jobId || '')
|
|
3901
|
+
const snapshotVideos = (state, revision) => (state.jobs || []).filter(job => job.revisionId === revision && snapshotVideoJob(job))
|
|
3902
|
+
const snapshotImages = (state, revision) => (state.jobs || []).filter(job => job.revisionId === revision && snapshotImageJob(job))
|
|
3899
3903
|
const snapshotSupported = state => state.editableSnapshotProtocol === 1 && /^[a-f0-9]{64}$/.test(state.storeIdentity || '')
|
|
3900
3904
|
&& state.editableSnapshotAvailability?.available === true
|
|
3905
|
+
const snapshotWorking = entry => entry?.result?.state === 'preparing' || Object.values(entry?.busy || {}).some(Boolean)
|
|
3906
|
+
function snapshotJobSelection(state, job) {
|
|
3907
|
+
const entry = snapshotEntry(state)
|
|
3908
|
+
if (!entry || !snapshotSupported(state) || job?.delivery?.verified !== true
|
|
3909
|
+
|| !/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$/.test(job.jobId || '')
|
|
3910
|
+
|| !state.selected?.revisions?.some(item => item.revision === job.revisionId)) return null
|
|
3911
|
+
const image = job.delivery.kind === 'still'
|
|
3912
|
+
if (image ? !state.snapshotImagesSupported || !snapshotImageJob(job)
|
|
3913
|
+
: !snapshotVideoJob(job) || !/^[a-f0-9]{64}$/.test(job.delivery.sha256 || '')) return null
|
|
3914
|
+
const sameRevision = entry.revision === job.revisionId
|
|
3915
|
+
const imageJobIds = sameRevision ? entry.imageJobIds || [] : []
|
|
3916
|
+
const full = image && imageJobIds.length >= 16 && !imageJobIds.includes(job.jobId)
|
|
3917
|
+
return {
|
|
3918
|
+
disabled: snapshotWorking(entry) || full,
|
|
3919
|
+
selection: {
|
|
3920
|
+
revision: job.revisionId,
|
|
3921
|
+
videoJobId: image ? (sameRevision ? entry.videoJobId || null : null) : job.jobId,
|
|
3922
|
+
imageJobIds: image && !full ? [...new Set([...imageJobIds, job.jobId])].sort() : imageJobIds,
|
|
3923
|
+
},
|
|
3924
|
+
}
|
|
3925
|
+
}
|
|
3901
3926
|
const snapshotSameSelection = entry => entry?.handle && entry.revision === entry.handle.revision && entry.videoJobId === entry.handle.videoJobId
|
|
3902
3927
|
&& JSON.stringify(entry.imageJobIds || []) === JSON.stringify(entry.handle.imageJobIds || [])
|
|
3903
3928
|
const snapshotBytes = value => value >= 1048576 ? `${(value / 1048576).toFixed(1)} MiB` : value >= 1024 ? `${(value / 1024).toFixed(1)} KiB` : `${value} B`
|
|
@@ -4559,14 +4584,14 @@ window.__ModuleLoader__.load({
|
|
|
4559
4584
|
}
|
|
4560
4585
|
function setSnapshotSelection(field, value) {
|
|
4561
4586
|
const key = snapshotContextKey(data), entry = data.editableSnapshots[key]
|
|
4562
|
-
if (!entry ||
|
|
4587
|
+
if (!entry || snapshotWorking(entry)) return
|
|
4563
4588
|
if (field === 'revision' && !(data.selected?.revisions || []).some(item => item.revision === value)) return
|
|
4564
4589
|
if (field === 'videoJobId' && value && !snapshotVideos(data, entry.revision).some(job => job.jobId === value)) return
|
|
4565
4590
|
changeSnapshot(key, { [field]: value || null, ...(field === 'revision' ? { videoJobId: null, imageJobIds: [] } : {}) })
|
|
4566
4591
|
}
|
|
4567
4592
|
function setSnapshotImage(id, selected) {
|
|
4568
4593
|
const key = snapshotContextKey(data), entry = data.editableSnapshots[key]
|
|
4569
|
-
if (!entry || !data.snapshotImagesSupported ||
|
|
4594
|
+
if (!entry || !data.snapshotImagesSupported || snapshotWorking(entry)) return
|
|
4570
4595
|
const ids = new Set(entry.imageJobIds || [])
|
|
4571
4596
|
if (selected && !snapshotImages(data, entry.revision).some(job => job.jobId === id) || !selected && !ids.has(id)) return
|
|
4572
4597
|
if (selected && ids.size >= 16 && !ids.has(id)) return
|
|
@@ -4949,6 +4974,15 @@ window.__ModuleLoader__.load({
|
|
|
4949
4974
|
setSnapshotRevision: value => setSnapshotSelection('revision', value),
|
|
4950
4975
|
setSnapshotVideo: value => setSnapshotSelection('videoJobId', value),
|
|
4951
4976
|
setSnapshotImage,
|
|
4977
|
+
includeDeliveryInSnapshot: (jobId, revision, context) => {
|
|
4978
|
+
if (!context || context !== snapshotContextKey(data)) return
|
|
4979
|
+
const job = data.jobs.find(item => item.jobId === jobId && item.revisionId === revision)
|
|
4980
|
+
const copy = snapshotJobSelection(data, job)
|
|
4981
|
+
if (!copy || copy.disabled) return
|
|
4982
|
+
changeSnapshot(context, copy.selection)
|
|
4983
|
+
actions.setView('revisions')
|
|
4984
|
+
return true
|
|
4985
|
+
},
|
|
4952
4986
|
prepareEditableSnapshot: () => snapshotRequest('prepare'),
|
|
4953
4987
|
checkEditableSnapshot: () => snapshotRequest('check'),
|
|
4954
4988
|
cancelEditableSnapshot: () => snapshotRequest('cancel'),
|
|
@@ -7851,6 +7885,30 @@ window.__ModuleLoader__.load({
|
|
|
7851
7885
|
Button({ action: 'save-wide-frame', tone: 'primary', disabled: pending || Object.values(state.busy).some(Boolean), onClick: actions.saveWideFrame, children: t('aspect.apply') })))
|
|
7852
7886
|
}
|
|
7853
7887
|
|
|
7888
|
+
function JobDeliveryActions(state, actions, job) {
|
|
7889
|
+
const frame = renderSingleFrameLink(state, job)
|
|
7890
|
+
const copy = snapshotJobSelection(state, job)
|
|
7891
|
+
const video = state.renderVideoDownloadSupported && state.editableSnapshotAvailability?.available === true
|
|
7892
|
+
&& /^[a-f0-9]{64}$/.test(state.storeIdentity || '') && job.status === 'completed' && job.delivery?.verified === true
|
|
7893
|
+
&& /^r[0-9]{4,}$/.test(job.revisionId || '') && /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$/.test(job.jobId || '')
|
|
7894
|
+
&& /^[a-f0-9]{64}$/.test(job.delivery.sha256 || '')
|
|
7895
|
+
? el('a', { className: 'db-btn', 'data-action': `download-video:${job.jobId}`,
|
|
7896
|
+
href: projectRoute(state.activeProjectId, `/jobs/${encodeURIComponent(job.jobId)}/video?revision=${encodeURIComponent(job.revisionId)}&sha256=${job.delivery.sha256}&storeIdentity=${state.storeIdentity}`),
|
|
7897
|
+
download: true }, t('jobs.downloadVideo', { revision: job.revisionId })) : null
|
|
7898
|
+
const path = !video && typeof job.delivery?.videoPath === 'string' && job.delivery.videoPath
|
|
7899
|
+
if (!frame && !video && !copy && !path) return null
|
|
7900
|
+
return el('div', { className: 'db-inline' }, frame, video,
|
|
7901
|
+
copy ? Button({ action: `snapshot-include-delivery:${job.jobId}`, disabled: copy.disabled,
|
|
7902
|
+
onClick: event => {
|
|
7903
|
+
const mount = event?.currentTarget?.closest('.db-root')?.parentElement
|
|
7904
|
+
if (actions.includeDeliveryInSnapshot(job.jobId, job.revisionId, snapshotContextKey(state))) {
|
|
7905
|
+
mount?.ownerDocument.defaultView?.requestAnimationFrame(() => mount.querySelector('[data-editable-snapshot]')?.focus())
|
|
7906
|
+
}
|
|
7907
|
+
},
|
|
7908
|
+
children: t('snapshot.includeJob') }) : null,
|
|
7909
|
+
path ? el('div', { className: 'db-muted db-mono' }, `video ${path}`) : null)
|
|
7910
|
+
}
|
|
7911
|
+
|
|
7854
7912
|
/** 任务: live progress, cancel, resume, and the approval threshold. */
|
|
7855
7913
|
function JobsView(ctx) {
|
|
7856
7914
|
const state = ctx.state
|
|
@@ -7893,15 +7951,7 @@ window.__ModuleLoader__.load({
|
|
|
7893
7951
|
el('div', { className: 'db-muted', 'data-job-detail': job.jobId }, `${job.detail} · ${job.progress.percent}% · 缺失 ${job.progress.missing} · 损坏 ${job.progress.corrupt}`),
|
|
7894
7952
|
el('div', { className: 'db-muted', 'data-job-provenance': job.jobId }, jobProvenanceText(job)),
|
|
7895
7953
|
job.errorCode ? el('div', { className: 'db-error', style: { marginTop: '4px' } }, `${job.errorCode}: ${job.message || ''}`) : null,
|
|
7896
|
-
|
|
7897
|
-
state.renderVideoDownloadSupported && state.editableSnapshotAvailability?.available === true
|
|
7898
|
-
&& /^[a-f0-9]{64}$/.test(state.storeIdentity || '') && job.status === 'completed' && job.delivery?.verified === true
|
|
7899
|
-
&& /^r[0-9]{4,}$/.test(job.revisionId || '') && /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$/.test(job.jobId || '')
|
|
7900
|
-
&& /^[a-f0-9]{64}$/.test(job.delivery.sha256 || '')
|
|
7901
|
-
? el('a', { className: 'db-btn', 'data-action': `download-video:${job.jobId}`,
|
|
7902
|
-
href: projectRoute(state.activeProjectId, `/jobs/${encodeURIComponent(job.jobId)}/video?revision=${encodeURIComponent(job.revisionId)}&sha256=${job.delivery.sha256}&storeIdentity=${state.storeIdentity}`),
|
|
7903
|
-
download: true }, t('jobs.downloadVideo', { revision: job.revisionId }))
|
|
7904
|
-
: job.delivery ? el('div', { className: 'db-muted db-mono' }, `video ${job.delivery.videoPath || ''}`) : null,
|
|
7954
|
+
JobDeliveryActions(state, actions, job),
|
|
7905
7955
|
))),
|
|
7906
7956
|
),
|
|
7907
7957
|
|
|
@@ -8057,7 +8107,7 @@ window.__ModuleLoader__.load({
|
|
|
8057
8107
|
const phases = { writing: t('snapshot.copying'), verifying: t('snapshot.verifying'), publishing: t('snapshot.publishing') }
|
|
8058
8108
|
const done = result?.phase === 'verifying' ? result.verifiedBytes : result?.writtenBytes
|
|
8059
8109
|
const measured = result?.phase === 'writing' && Number.isSafeInteger(done) && done >= 0 && Number.isSafeInteger(result?.totalBytes) && result.totalBytes > 0
|
|
8060
|
-
return el('section', { className: 'db-card', 'data-editable-snapshot': result?.state || 'idle', 'aria-label': t('snapshot.title') },
|
|
8110
|
+
return el('section', { className: 'db-card', 'data-editable-snapshot': result?.state || 'idle', 'aria-label': t('snapshot.title'), tabIndex: -1 },
|
|
8061
8111
|
el('h4', null, t('snapshot.title')),
|
|
8062
8112
|
el('p', { className: 'db-muted' }, t('snapshot.scope')),
|
|
8063
8113
|
Disclosure({ state, actions }, 'snapshot-scope', t('snapshot.details'), {}, el('p', { className: 'db-muted', style: { maxWidth: '72ch' } }, t('snapshot.detailText'))),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepblend/dsh-blender-bundle",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.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.32.0",
|
|
48
|
+
"@deepblend/dsh-blender-host": "0.32.0",
|
|
49
|
+
"@deepblend/dsh-blender-preset": "0.32.0",
|
|
50
|
+
"@deepblend/dsh-blender-provider-local": "0.32.0",
|
|
51
|
+
"@deepblend/dsh-blender-tool": "0.32.0",
|
|
52
|
+
"@deepblend/dsh-blender-ui": "0.32.0"
|
|
53
53
|
},
|
|
54
54
|
"type": "module",
|
|
55
55
|
"license": "MIT",
|