@deepblend/dsh-blender-bundle 0.22.0 → 0.23.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 +46 -5
- package/package.json +7 -7
package/lib/client.js
CHANGED
|
@@ -490,6 +490,15 @@ window.__ModuleLoader__.load({
|
|
|
490
490
|
'editor.mesh': '自定义曲面',
|
|
491
491
|
'editor.meshCounts': '控制网格:{vertices} 个顶点,{faces} 个面',
|
|
492
492
|
'editor.smoothSurface': '平滑表面',
|
|
493
|
+
'editor.uv.title': '纹理坐标',
|
|
494
|
+
'editor.uv.saved': '当前使用已保存的逐面 UV。',
|
|
495
|
+
'editor.uv.automatic': '当前使用默认平面 UV;部分朝向可能出现纹理拉伸。',
|
|
496
|
+
'editor.uv.project': '保存时逐面重建 UV',
|
|
497
|
+
'editor.uv.help': '适合木纹等重复纹理。保存会替换当前 UV;各面可重叠,不用于烘焙贴图,也不保证跨面无缝。',
|
|
498
|
+
'editor.uv.direction': '纹理方向',
|
|
499
|
+
'editor.uv.scale': '纹理重复',
|
|
500
|
+
'editor.uv.scaleInvalid': '请输入 0.0001 到 10000 之间的重复次数。',
|
|
501
|
+
'editor.uv.scaleHelp': '最长局部网格边界跨度内的重复次数。只改变纹理坐标,保存后查看实际预览。',
|
|
493
502
|
'editor.subdivision': '曲面细分',
|
|
494
503
|
'editor.surfaceScatter': '封闭表面布置',
|
|
495
504
|
'editor.scatterTargets': '依附物体(逗号分隔)',
|
|
@@ -1243,6 +1252,15 @@ window.__ModuleLoader__.load({
|
|
|
1243
1252
|
'editor.mesh': 'Custom surface',
|
|
1244
1253
|
'editor.meshCounts': 'Control mesh: {vertices} vertices, {faces} faces',
|
|
1245
1254
|
'editor.smoothSurface': 'Smooth surface',
|
|
1255
|
+
'editor.uv.title': 'Texture coordinates',
|
|
1256
|
+
'editor.uv.saved': 'Using saved per-face UVs.',
|
|
1257
|
+
'editor.uv.automatic': 'Using default planar UVs; some face directions may stretch the texture.',
|
|
1258
|
+
'editor.uv.project': 'Rebuild UVs per face on save',
|
|
1259
|
+
'editor.uv.help': 'For repeating textures such as wood grain. Saving replaces current UVs; faces can overlap. Not a bake atlas or a seamless unwrap.',
|
|
1260
|
+
'editor.uv.direction': 'Texture direction',
|
|
1261
|
+
'editor.uv.scale': 'Texture repetitions',
|
|
1262
|
+
'editor.uv.scaleInvalid': 'Enter repetitions from 0.0001 to 10000.',
|
|
1263
|
+
'editor.uv.scaleHelp': 'Repetitions across the longest local mesh extent. Only texture coordinates change; check the saved preview.',
|
|
1246
1264
|
'editor.subdivision': 'Surface subdivision',
|
|
1247
1265
|
'editor.surfaceScatter': 'Closed surface placement',
|
|
1248
1266
|
'editor.scatterTargets': 'Support objects (comma separated)',
|
|
@@ -2448,6 +2466,7 @@ window.__ModuleLoader__.load({
|
|
|
2448
2466
|
do { cloneId = `ui-material-${Date.now().toString(36)}-${++editorSequence}` }
|
|
2449
2467
|
while (scene.nodes.materials.some(item => item.id === cloneId))
|
|
2450
2468
|
return { projectId, entityId, baseRevision: scene.revision, original, entity: editorClone(original),
|
|
2469
|
+
uvProjection: null,
|
|
2451
2470
|
materials: editorClone(scene.nodes.materials), entities: editorClone(scene.nodes.entities),
|
|
2452
2471
|
tracks: editorClone(scene.nodes.animationTracks || []), cloneId,
|
|
2453
2472
|
material: { id: material?.id || '', definition: editorClone(material?.definition || null),
|
|
@@ -2504,6 +2523,11 @@ window.__ModuleLoader__.load({
|
|
|
2504
2523
|
&& editorTrackLocked(draft, 'entity', draft.entityId, `${key}.${EDITOR_AXES[axis]}`)) bad(`${key}.${EDITOR_AXES[axis]}`)
|
|
2505
2524
|
}
|
|
2506
2525
|
const generator = draft.entity.generator
|
|
2526
|
+
if (draft.uvProjection != null) {
|
|
2527
|
+
if (draft.entity.kind !== 'generator' || generator?.shape !== 'mesh') bad(t('editor.uv.title'))
|
|
2528
|
+
scalar(draft.uvProjection.quarterTurns, t('editor.uv.direction'), 0, 3, true)
|
|
2529
|
+
scalar(draft.uvProjection.scale, t('editor.uv.scale'), 0.0001, 10000)
|
|
2530
|
+
}
|
|
2507
2531
|
if (generator) {
|
|
2508
2532
|
if (generator.dimensions !== undefined) {
|
|
2509
2533
|
if (!['cube', 'rounded_box'].includes(generator.shape) || generator.size !== undefined
|
|
@@ -2627,6 +2651,7 @@ window.__ModuleLoader__.load({
|
|
|
2627
2651
|
for (const key of ['location', 'rotationEuler']) if (!editorEqual(entity.transform[key], original.transform[key])) transform[key] = editorClone(entity.transform[key])
|
|
2628
2652
|
if (Object.keys(transform).length > 2) operations.push(transform)
|
|
2629
2653
|
if (!editorEqual(entity.generator, original.generator)) operations.push({ op: 'entity.generator.set', entityId: draft.entityId, generator: editorClone(entity.generator) })
|
|
2654
|
+
if (draft.uvProjection != null) operations.push({ op: 'entity.uv.project', entityId: draft.entityId, ...editorClone(draft.uvProjection) })
|
|
2630
2655
|
if (!editorEqual(entity.modifiers, original.modifiers)) operations.push({ op: 'entity.modifiers.set', entityId: draft.entityId, modifiers: editorClone(entity.modifiers) })
|
|
2631
2656
|
const material = draft.material.definition, baseMaterial = editorMaterialOriginal(draft)
|
|
2632
2657
|
const changedProperties = material && baseMaterial ? ['baseColor', 'roughness'].filter(key => !editorEqual(material.parameters?.[key], baseMaterial.parameters?.[key])) : []
|
|
@@ -4683,7 +4708,8 @@ window.__ModuleLoader__.load({
|
|
|
4683
4708
|
},
|
|
4684
4709
|
updateEditor: (section, path, value) => {
|
|
4685
4710
|
const current = editorDraftFor(data)
|
|
4686
|
-
if (!current || data.busy.editor || !['transform', 'generator', 'modifiers', 'material'].includes(section)) return
|
|
4711
|
+
if (!current || data.busy.editor || !['transform', 'generator', 'modifiers', 'material', 'uvProjection'].includes(section)) return
|
|
4712
|
+
if (section === 'uvProjection' && (current.entity.kind !== 'generator' || current.entity.generator?.shape !== 'mesh')) return
|
|
4687
4713
|
if (!Array.isArray(path) || path.some(key => ['__proto__', 'constructor', 'prototype'].includes(String(key)))) return
|
|
4688
4714
|
if (section === 'generator' && path[0] === 'bevel' && path.length === 1 && value === undefined && current.entity.generator?.shape === 'rounded_box') return
|
|
4689
4715
|
if (section === 'transform' && editorTrackLocked(current, 'entity', current.entityId, `${path[0]}.${EDITOR_AXES[path[1]]}`)) return
|
|
@@ -4692,7 +4718,7 @@ window.__ModuleLoader__.load({
|
|
|
4692
4718
|
const draft = editorClone(current)
|
|
4693
4719
|
if (section === 'material' && path.length === 1 && path[0] === 'id') editorSelectMaterial(draft, value)
|
|
4694
4720
|
else {
|
|
4695
|
-
const parent =
|
|
4721
|
+
const parent = ['material', 'uvProjection'].includes(section) ? draft : draft.entity
|
|
4696
4722
|
if (path.length === 0) parent[section] = editorClone(value)
|
|
4697
4723
|
else {
|
|
4698
4724
|
let object = parent[section]
|
|
@@ -5491,7 +5517,7 @@ window.__ModuleLoader__.load({
|
|
|
5491
5517
|
const numeric = (label, field, value, update, options = {}) => {
|
|
5492
5518
|
const factor = options.factor ?? 1
|
|
5493
5519
|
const displayed = Number.isFinite(value) ? Math.round(value * factor * 1e9) / 1e9 : ''
|
|
5494
|
-
const invalid = !Number.isFinite(value) && !disabled && options.disabled !== true
|
|
5520
|
+
const invalid = (options.invalid === true || !Number.isFinite(value)) && !disabled && options.disabled !== true
|
|
5495
5521
|
const errorId = `${draft.projectId}-${draft.entityId}-${field}-error`
|
|
5496
5522
|
return el('label', { className: 'db-row', key: field }, el('span', null, label), el('span', { className: 'db-number-control' }, el('input', {
|
|
5497
5523
|
className: 'db-input', type: 'number', 'data-field': field, 'aria-label': label,
|
|
@@ -5499,7 +5525,7 @@ window.__ModuleLoader__.load({
|
|
|
5499
5525
|
value: displayed, step: options.step ?? (options.integer ? 1 : 'any'),
|
|
5500
5526
|
min: options.min, max: options.max, disabled: disabled || options.disabled === true,
|
|
5501
5527
|
style: { width: '125px' }, onChange: event => update(event.target.value === '' ? null : Number(event.target.value) / factor),
|
|
5502
|
-
}), invalid ? el('span', { className: 'db-field-feedback', id: errorId }, t('editor.invalid', { field: label })) : null))
|
|
5528
|
+
}), invalid ? el('span', { className: 'db-field-feedback', id: errorId }, options.error || t('editor.invalid', { field: label })) : null))
|
|
5503
5529
|
}
|
|
5504
5530
|
const choose = (label, field, value, items, update, off = false) => el('label', { className: 'db-row', key: field }, el('span', null, label), el('select', {
|
|
5505
5531
|
className: 'db-input', 'data-field': field, value, disabled: disabled || off, style: { maxWidth: '65%' }, onChange: event => update(event.target.value),
|
|
@@ -5580,7 +5606,22 @@ window.__ModuleLoader__.load({
|
|
|
5580
5606
|
geometry ? [
|
|
5581
5607
|
el('strong', { key: 'shape' }, geometry.shape === 'handled_cup' ? t('editor.handledCup') : geometry.shape === 'mesh' ? t('editor.mesh') : geometry.shape),
|
|
5582
5608
|
geometry.shape === 'mesh' ? [el('p', { className: 'db-muted', key: 'mesh-counts' }, t('editor.meshCounts', { vertices: geometry.vertices?.length ?? 0, faces: geometry.faces?.length ?? 0 })),
|
|
5583
|
-
toggle(t('editor.smoothSurface'), 'editor-generator-smooth', Boolean(geometry.smooth), value => actions.updateEditor('generator', ['smooth'], value))
|
|
5609
|
+
toggle(t('editor.smoothSurface'), 'editor-generator-smooth', Boolean(geometry.smooth), value => actions.updateEditor('generator', ['smooth'], value)),
|
|
5610
|
+
el('fieldset', { key: 'uv', 'data-uv-editor': true, disabled, style: { border: 0, padding: 0, margin: '16px 0' } },
|
|
5611
|
+
el('legend', null, t('editor.uv.title')),
|
|
5612
|
+
el('p', { className: 'db-muted' }, geometry.faceUvs ? t('editor.uv.saved') : t('editor.uv.automatic')),
|
|
5613
|
+
toggle(t('editor.uv.project'), 'editor-uv-project', draft.uvProjection != null,
|
|
5614
|
+
value => actions.updateEditor('uvProjection', [], value ? { quarterTurns: 0, scale: 1 } : null)),
|
|
5615
|
+
draft.uvProjection ? [
|
|
5616
|
+
el('p', { className: 'db-muted', key: 'uv-help' }, t('editor.uv.help')),
|
|
5617
|
+
choose(t('editor.uv.direction'), 'editor-uv-quarterTurns', String(draft.uvProjection.quarterTurns),
|
|
5618
|
+
[0, 1, 2, 3].map(turn => [String(turn), `${turn * 90}°`]), value => actions.updateEditor('uvProjection', ['quarterTurns'], Number(value))),
|
|
5619
|
+
numeric(t('editor.uv.scale'), 'editor-uv-scale', draft.uvProjection.scale,
|
|
5620
|
+
value => actions.updateEditor('uvProjection', ['scale'], value), { min: 0.0001, max: 10000, step: 0.1,
|
|
5621
|
+
invalid: draft.uvProjection.scale < 0.0001 || draft.uvProjection.scale > 10000,
|
|
5622
|
+
error: t('editor.uv.scaleInvalid') }),
|
|
5623
|
+
el('p', { className: 'db-muted', key: 'uv-scale-help' }, t('editor.uv.scaleHelp')),
|
|
5624
|
+
] : null)] : null,
|
|
5584
5625
|
el('p', { className: 'db-muted', key: 'local-size' }, t('editor.localDimensions', { scale: (draft.entity.transform.scale || [1, 1, 1]).join(' × ') })),
|
|
5585
5626
|
geometry.shape === 'rounded_box' ? el('p', { className: 'db-muted', key: 'rounded' }, t('editor.roundedRequired')) : null,
|
|
5586
5627
|
geometry.shape === 'handled_cup' ? el('p', { className: 'db-muted', key: 'cup-help' }, t('editor.cupHelp')) : null,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepblend/dsh-blender-bundle",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.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.23.0",
|
|
48
|
+
"@deepblend/dsh-blender-host": "0.23.0",
|
|
49
|
+
"@deepblend/dsh-blender-preset": "0.23.0",
|
|
50
|
+
"@deepblend/dsh-blender-provider-local": "0.23.0",
|
|
51
|
+
"@deepblend/dsh-blender-tool": "0.23.0",
|
|
52
|
+
"@deepblend/dsh-blender-ui": "0.23.0"
|
|
53
53
|
},
|
|
54
54
|
"type": "module",
|
|
55
55
|
"license": "MIT",
|