@deepblend/dsh-blender-bundle 0.13.0 → 0.14.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 +80 -3
- package/package.json +7 -7
package/lib/client.js
CHANGED
|
@@ -400,6 +400,24 @@ window.__ModuleLoader__.load({
|
|
|
400
400
|
'editor.boxHeight': '高(mm)',
|
|
401
401
|
'editor.radius': '半径(mm)',
|
|
402
402
|
'editor.handledCup': '带把手杯体',
|
|
403
|
+
'editor.mesh': '自定义曲面',
|
|
404
|
+
'editor.meshCounts': '控制网格:{vertices} 个顶点,{faces} 个面',
|
|
405
|
+
'editor.smoothSurface': '平滑表面',
|
|
406
|
+
'editor.subdivision': '曲面细分',
|
|
407
|
+
'editor.surfaceScatter': '封闭表面布置',
|
|
408
|
+
'editor.scatterTargets': '依附物体(逗号分隔)',
|
|
409
|
+
'editor.scatterAnchors': '连接顶点序号(逗号分隔)',
|
|
410
|
+
'editor.scatterSeed': '随机种子',
|
|
411
|
+
'editor.scatterDepth': '嵌入深度(毫米)',
|
|
412
|
+
'editor.scatterScaleMin': '最小尺寸倍数',
|
|
413
|
+
'editor.scatterScaleMax': '最大尺寸倍数',
|
|
414
|
+
'editor.scatterUp': '朝上倾向',
|
|
415
|
+
'editor.scatterHelp': '仅限静态封闭网格;连接顶点采用前序操作完成后的序号。重新构建时计算依附,不保证整体无穿插。',
|
|
416
|
+
'editor.subdivisionLevels': '细分级别',
|
|
417
|
+
'editor.subdivisionScheme': '细分方式',
|
|
418
|
+
'editor.roundSurface': '圆滑曲面',
|
|
419
|
+
'editor.keepShape': '保留原形',
|
|
420
|
+
'editor.keepCorners': '保留边角',
|
|
403
421
|
'editor.wallThickness': '杯壁厚度(mm)',
|
|
404
422
|
'editor.baseThickness': '杯底厚度(mm)',
|
|
405
423
|
'editor.footRound': '底部圆角(mm)',
|
|
@@ -1015,6 +1033,24 @@ window.__ModuleLoader__.load({
|
|
|
1015
1033
|
'editor.boxHeight': 'Height (mm)',
|
|
1016
1034
|
'editor.radius': 'Radius (mm)',
|
|
1017
1035
|
'editor.handledCup': 'Handled cup',
|
|
1036
|
+
'editor.mesh': 'Custom surface',
|
|
1037
|
+
'editor.meshCounts': 'Control mesh: {vertices} vertices, {faces} faces',
|
|
1038
|
+
'editor.smoothSurface': 'Smooth surface',
|
|
1039
|
+
'editor.subdivision': 'Surface subdivision',
|
|
1040
|
+
'editor.surfaceScatter': 'Closed surface placement',
|
|
1041
|
+
'editor.scatterTargets': 'Support objects (comma separated)',
|
|
1042
|
+
'editor.scatterAnchors': 'Attachment vertex indices (comma separated)',
|
|
1043
|
+
'editor.scatterSeed': 'Random seed',
|
|
1044
|
+
'editor.scatterDepth': 'Embedding depth (mm)',
|
|
1045
|
+
'editor.scatterScaleMin': 'Minimum size multiplier',
|
|
1046
|
+
'editor.scatterScaleMax': 'Maximum size multiplier',
|
|
1047
|
+
'editor.scatterUp': 'Upward bias',
|
|
1048
|
+
'editor.scatterHelp': 'Static closed meshes only. Attachment indices refer to the mesh after preceding operations. Placement is recomputed on rebuild; whole-mesh clearance is not certified.',
|
|
1049
|
+
'editor.subdivisionLevels': 'Subdivision levels',
|
|
1050
|
+
'editor.subdivisionScheme': 'Subdivision method',
|
|
1051
|
+
'editor.roundSurface': 'Round surface',
|
|
1052
|
+
'editor.keepShape': 'Keep shape',
|
|
1053
|
+
'editor.keepCorners': 'Keep corners',
|
|
1018
1054
|
'editor.wallThickness': 'Wall thickness (mm)',
|
|
1019
1055
|
'editor.baseThickness': 'Base thickness (mm)',
|
|
1020
1056
|
'editor.footRound': 'Foot rounding (mm)',
|
|
@@ -2026,7 +2062,7 @@ window.__ModuleLoader__.load({
|
|
|
2026
2062
|
cone: ['radius', 'depth', 'segments'], torus: ['majorRadius', 'minorRadius', 'segments', 'ringCount'],
|
|
2027
2063
|
handled_cup: ['radius', 'height', 'wallThickness', 'baseThickness', 'handleRadius', 'handleLower', 'handleUpper',
|
|
2028
2064
|
'footRound', 'rootRadius', 'rootLength', 'rootTension', 'segments', 'sectionSegments', 'handleSegments', 'rootSegments', 'wallRows'],
|
|
2029
|
-
lathe: ['segments'], curve: ['radius', 'curveResolution', 'bevelResolution'],
|
|
2065
|
+
lathe: ['segments'], curve: ['radius', 'curveResolution', 'bevelResolution'], mesh: [],
|
|
2030
2066
|
}
|
|
2031
2067
|
const EDITOR_INTEGERS = { segments: [3, 512], ringCount: [3, 512], curveResolution: [1, 64], bevelResolution: [0, 16] }
|
|
2032
2068
|
const CUP_ADVANCED_FIELDS = ['footRound', 'rootRadius', 'rootLength', 'rootTension', 'segments', 'sectionSegments', 'handleSegments', 'rootSegments', 'wallRows']
|
|
@@ -2155,6 +2191,28 @@ window.__ModuleLoader__.load({
|
|
|
2155
2191
|
if (modifier.offset?.length !== 3 || modifier.offset.every(value => value === 0)) bad(`${at}.offset`)
|
|
2156
2192
|
} else if (modifier.type === 'mirror') {
|
|
2157
2193
|
if (!EDITOR_AXES.includes(modifier.axis)) bad(`${at}.axis`)
|
|
2194
|
+
} else if (modifier.type === 'subdivision') {
|
|
2195
|
+
scalar(modifier.levels, `${at}.levels`, 1, 3, true)
|
|
2196
|
+
if (modifier.scheme !== undefined && !['catmull-clark', 'simple'].includes(modifier.scheme)) bad(`${at}.scheme`)
|
|
2197
|
+
if (modifier.boundaryMode !== undefined && !['all', 'preserve-corners'].includes(modifier.boundaryMode)) bad(`${at}.boundaryMode`)
|
|
2198
|
+
} else if (modifier.type === 'surface_scatter') {
|
|
2199
|
+
scalar(modifier.count, `${at}.count`, 1, 512, true)
|
|
2200
|
+
if (modifier.seed !== undefined) scalar(modifier.seed, `${at}.seed`, 0, 2147483647, true)
|
|
2201
|
+
if (modifier.embedDepthMm !== undefined) scalar(modifier.embedDepthMm, `${at}.embedDepthMm`, Number.MIN_VALUE, 100)
|
|
2202
|
+
if (modifier.upwardBias !== undefined) scalar(modifier.upwardBias, `${at}.upwardBias`, 0, 1)
|
|
2203
|
+
const targets = modifier.targetEntityIds, anchors = modifier.anchorVertexIndices
|
|
2204
|
+
const staticMesh = entity => entity && entity.kind === 'generator'
|
|
2205
|
+
&& !['armatureId', 'rigidBody', 'cloth', 'softBody', 'fluid'].some(key => entity[key] !== undefined)
|
|
2206
|
+
&& !(draft.tracks || []).some(track => track.targetKind === 'entity' && track.targetId === entity.id && /^(location|rotationEuler|scale)(\.|$)/.test(track.property))
|
|
2207
|
+
if (!Array.isArray(targets) || !targets.length || targets.length > 8 || new Set(targets).size !== targets.length
|
|
2208
|
+
|| targets.some(id => id === draft.entityId || !staticMesh(draft.entities.find(entity => entity.id === id))
|
|
2209
|
+
|| draft.entities.find(entity => entity.id === id)?.modifiers?.some(value => value.type === 'surface_scatter'))) bad(`${at}.targetEntityIds`)
|
|
2210
|
+
if (!Array.isArray(anchors) || !anchors.length || anchors.length > 8 || new Set(anchors).size !== anchors.length
|
|
2211
|
+
|| anchors.some(value => !Number.isInteger(value) || value < 0 || value > 999999)) bad(`${at}.anchorVertexIndices`)
|
|
2212
|
+
if (index !== draft.entity.modifiers.length - 1 || !staticMesh(draft.entity)) bad(at)
|
|
2213
|
+
if (modifier.scaleRange !== undefined && (!Array.isArray(modifier.scaleRange) || modifier.scaleRange.length !== 2
|
|
2214
|
+
|| modifier.scaleRange.some(value => !Number.isFinite(value) || value < .05 || value > 20)
|
|
2215
|
+
|| modifier.scaleRange[0] > modifier.scaleRange[1])) bad(`${at}.scaleRange`)
|
|
2158
2216
|
} else if (modifier.type === 'boolean') {
|
|
2159
2217
|
if (!['union', 'difference', 'intersect'].includes(modifier.operation)
|
|
2160
2218
|
|| !draft.entities.some(entity => entity.id === modifier.targetEntityId && entity.id !== draft.entityId && entity.kind !== 'empty')) bad(`${at}.targetEntityId`)
|
|
@@ -3901,6 +3959,8 @@ window.__ModuleLoader__.load({
|
|
|
3901
3959
|
if (list.length >= (kind === 'modifiers' ? 8 : 128)) return
|
|
3902
3960
|
if (kind === 'modifiers') {
|
|
3903
3961
|
const defaults = { bevel: { type, width: 0.001, segments: 3, angle: 30 }, solidify: { type, thickness: 0.002, offset: -1 },
|
|
3962
|
+
subdivision: { type, levels: 2, scheme: 'catmull-clark', boundaryMode: 'all' },
|
|
3963
|
+
surface_scatter: { type, targetEntityIds: [], count: 16, anchorVertexIndices: [], seed: 0, embedDepthMm: 5, scaleRange: [1, 1], upwardBias: 0 },
|
|
3904
3964
|
array: { type, count: 2, offset: [0.02, 0, 0] }, mirror: { type, axis: 'x', merge: true },
|
|
3905
3965
|
boolean: { type, operation: 'difference', targetEntityId: draft.entities.find(item => item.id !== draft.entityId && item.kind !== 'empty')?.id || '' } }
|
|
3906
3966
|
if (!defaults[type]) return
|
|
@@ -4600,7 +4660,7 @@ window.__ModuleLoader__.load({
|
|
|
4600
4660
|
height: t('editor.depth'), size: t('editor.size'), radius: t('editor.radius'), depth: t('editor.depth'), majorRadius: t('editor.majorRadius'), minorRadius: t('editor.minorRadius'),
|
|
4601
4661
|
segments: t('editor.segments'), ringCount: t('editor.ringCount'), curveResolution: t('editor.curveResolution'), bevelResolution: t('editor.bevelResolution'),
|
|
4602
4662
|
}
|
|
4603
|
-
const modifierNames = { bevel: t('editor.bevel'), solidify: t('editor.solidify'), array: t('editor.array'), mirror: t('editor.mirror'), boolean: t('editor.boolean') }
|
|
4663
|
+
const modifierNames = { bevel: t('editor.bevel'), solidify: t('editor.solidify'), array: t('editor.array'), mirror: t('editor.mirror'), boolean: t('editor.boolean'), subdivision: t('editor.subdivision'), surface_scatter: t('editor.surfaceScatter') }
|
|
4604
4664
|
const numeric = (label, field, value, update, options = {}) => {
|
|
4605
4665
|
const factor = options.factor ?? 1
|
|
4606
4666
|
const displayed = Number.isFinite(value) ? Math.round(value * factor * 1e9) / 1e9 : ''
|
|
@@ -4691,7 +4751,9 @@ window.__ModuleLoader__.load({
|
|
|
4691
4751
|
draft.tracks.some(track => track.targetKind === 'entity' && track.targetId === draft.entityId) ? el('p', { className: 'db-muted' }, t('editor.animated')) : null),
|
|
4692
4752
|
draft.entity.kind === 'generator' ? el('div', { className: 'db-card' }, el('h4', null, t('editor.geometry')),
|
|
4693
4753
|
geometry ? [
|
|
4694
|
-
el('strong', { key: 'shape' }, geometry.shape === 'handled_cup' ? t('editor.handledCup') : geometry.shape),
|
|
4754
|
+
el('strong', { key: 'shape' }, geometry.shape === 'handled_cup' ? t('editor.handledCup') : geometry.shape === 'mesh' ? t('editor.mesh') : geometry.shape),
|
|
4755
|
+
geometry.shape === 'mesh' ? [el('p', { className: 'db-muted', key: 'mesh-counts' }, t('editor.meshCounts', { vertices: geometry.vertices?.length ?? 0, faces: geometry.faces?.length ?? 0 })),
|
|
4756
|
+
toggle(t('editor.smoothSurface'), 'editor-generator-smooth', Boolean(geometry.smooth), value => actions.updateEditor('generator', ['smooth'], value))] : null,
|
|
4695
4757
|
el('p', { className: 'db-muted', key: 'local-size' }, t('editor.localDimensions', { scale: (draft.entity.transform.scale || [1, 1, 1]).join(' × ') })),
|
|
4696
4758
|
geometry.shape === 'rounded_box' ? el('p', { className: 'db-muted', key: 'rounded' }, t('editor.roundedRequired')) : null,
|
|
4697
4759
|
geometry.shape === 'handled_cup' ? el('p', { className: 'db-muted', key: 'cup-help' }, t('editor.cupHelp')) : null,
|
|
@@ -4776,8 +4838,23 @@ window.__ModuleLoader__.load({
|
|
|
4776
4838
|
vector(t('editor.spacing'), `${prefix}-offset`, modifier.offset, (axis, value) => update(['offset', axis], value))] : null,
|
|
4777
4839
|
modifier.type === 'mirror' ? [choose(t('editor.axis'), `${prefix}-axis`, modifier.axis, EDITOR_AXES.map(axis => [axis, axis.toUpperCase()]), value => update(['axis'], value)),
|
|
4778
4840
|
toggle(t('editor.merge'), `${prefix}-merge`, modifier.merge !== false, value => update(['merge'], value))] : null,
|
|
4841
|
+
modifier.type === 'subdivision' ? [numeric(t('editor.subdivisionLevels'), `${prefix}-levels`, modifier.levels, value => update(['levels'], value), { integer: true, min: 1, max: 3 }),
|
|
4842
|
+
choose(t('editor.subdivisionScheme'), `${prefix}-scheme`, modifier.scheme ?? 'catmull-clark', [['catmull-clark', t('editor.roundSurface')], ['simple', t('editor.keepShape')]], value => update(['scheme'], value)),
|
|
4843
|
+
toggle(t('editor.keepCorners'), `${prefix}-boundaryMode`, modifier.boundaryMode === 'preserve-corners', value => update(['boundaryMode'], value ? 'preserve-corners' : 'all'))] : null,
|
|
4779
4844
|
modifier.type === 'boolean' ? [choose(t('editor.boolean'), `${prefix}-operation`, modifier.operation, [['union', t('editor.union')], ['difference', t('editor.difference')], ['intersect', t('editor.intersect')]], value => update(['operation'], value)),
|
|
4780
4845
|
choose(t('editor.operand'), `${prefix}-targetEntityId`, modifier.targetEntityId, [['', '—'], ...draft.entities.filter(item => item.id !== draft.entityId && item.kind !== 'empty').map(item => [item.id, item.id])], value => update(['targetEntityId'], value))] : null,
|
|
4846
|
+
modifier.type === 'surface_scatter' ? [
|
|
4847
|
+
...[['targetEntityIds', t('editor.scatterTargets')], ['anchorVertexIndices', t('editor.scatterAnchors')]].map(([key, label]) => el('label', { className: 'db-row' }, el('span', null, label), el('input', {
|
|
4848
|
+
className: 'db-input', type: 'text', 'data-field': `${prefix}-${key}`, value: (modifier[key] || []).join(', '),
|
|
4849
|
+
onChange: event => update([key], event.target.value.trim() === '' ? [] : event.target.value.split(',').map(value => key === 'targetEntityIds' ? value.trim() : value.trim() === '' ? NaN : Number(value.trim()))),
|
|
4850
|
+
}))),
|
|
4851
|
+
numeric(t('editor.count'), `${prefix}-count`, modifier.count, value => update(['count'], value), { integer: true, min: 1, max: 512 }),
|
|
4852
|
+
numeric(t('editor.scatterSeed'), `${prefix}-seed`, modifier.seed ?? 0, value => update(['seed'], value), { integer: true, min: 0, max: 2147483647 }),
|
|
4853
|
+
numeric(t('editor.scatterDepth'), `${prefix}-embedDepthMm`, modifier.embedDepthMm ?? 5, value => update(['embedDepthMm'], value), { min: Number.MIN_VALUE, max: 100 }),
|
|
4854
|
+
...[t('editor.scatterScaleMin'), t('editor.scatterScaleMax')].map((label, axis) => numeric(label, `${prefix}-scaleRange-${axis}`, modifier.scaleRange?.[axis] ?? 1,
|
|
4855
|
+
value => { const range = [...(modifier.scaleRange || [1, 1])]; range[axis] = value; update(['scaleRange'], range) }, { min: .05, max: 20 })),
|
|
4856
|
+
numeric(t('editor.scatterUp'), `${prefix}-upwardBias`, modifier.upwardBias ?? 0, value => update(['upwardBias'], value), { min: 0, max: 1 }),
|
|
4857
|
+
el('p', { className: 'db-muted', 'data-scatter-help': true }, t('editor.scatterHelp'))] : null,
|
|
4781
4858
|
el('div', { className: 'db-inline' },
|
|
4782
4859
|
Button({ action: `${prefix}-up`, disabled: disabled || !canModify || index === 0, children: t('editor.up'), onClick: () => actions.editEditorList('modifiers', index, 'up') }),
|
|
4783
4860
|
Button({ action: `${prefix}-down`, disabled: disabled || !canModify || index === draft.entity.modifiers.length - 1, children: t('editor.down'), onClick: () => actions.editEditorList('modifiers', index, 'down') }),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepblend/dsh-blender-bundle",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.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.14.0",
|
|
48
|
+
"@deepblend/dsh-blender-host": "0.14.0",
|
|
49
|
+
"@deepblend/dsh-blender-preset": "0.14.0",
|
|
50
|
+
"@deepblend/dsh-blender-provider-local": "0.14.0",
|
|
51
|
+
"@deepblend/dsh-blender-tool": "0.14.0",
|
|
52
|
+
"@deepblend/dsh-blender-ui": "0.14.0"
|
|
53
53
|
},
|
|
54
54
|
"type": "module",
|
|
55
55
|
"license": "MIT",
|