@deepblend/dsh-blender-bundle 0.27.0 → 0.28.1

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.
Files changed (2) hide show
  1. package/lib/client.js +26 -2
  2. package/package.json +7 -7
package/lib/client.js CHANGED
@@ -546,6 +546,9 @@ window.__ModuleLoader__.load({
546
546
  'editor.halfLap.role': '当前木条组',
547
547
  'editor.halfLap.lower': '保留下半部',
548
548
  'editor.halfLap.upper': '保留上半部',
549
+ 'editor.halfLap.edgeWidth': '边缘倒角(mm)',
550
+ 'editor.halfLap.edgeHelp': '0 保持锐边。部分宽度可能不适合此接头;若预览失败,请减小宽度后重新预览。',
551
+ 'editor.halfLap.edgeInvalid': '请输入 0 到 5 mm 的倒角宽度。',
549
552
  'editor.halfLap.help': '两组木条须正交,顶面和底面分别等高。',
550
553
  'editor.halfLap.invalid': '半搭接需要静态长方体网格。请移除不支持的修饰器,或将搭接对象设为「无搭接」。',
551
554
  'editor.halfLap.inspect': '预览槽口',
@@ -1462,6 +1465,9 @@ window.__ModuleLoader__.load({
1462
1465
  'editor.halfLap.role': 'Selected timber group',
1463
1466
  'editor.halfLap.lower': 'Keep the lower half',
1464
1467
  'editor.halfLap.upper': 'Keep the upper half',
1468
+ 'editor.halfLap.edgeWidth': 'Edge width (mm)',
1469
+ 'editor.halfLap.edgeHelp': '0 keeps sharp edges. Some widths cannot fit this joint. If preview fails, reduce the width and preview again.',
1470
+ 'editor.halfLap.edgeInvalid': 'Enter an edge width from 0 to 5 mm.',
1465
1471
  'editor.halfLap.help': 'The groups must cross at right angles and share top and bottom heights.',
1466
1472
  'editor.halfLap.invalid': 'Half laps need static box meshes. Remove unsupported modifiers or set Join with to “No joint.”',
1467
1473
  'editor.halfLap.inspect': 'Preview recesses',
@@ -2867,6 +2873,7 @@ window.__ModuleLoader__.load({
2867
2873
  scalar(draft.uvProjection.scale, t('editor.uv.scale'), 0.0001, 10000)
2868
2874
  }
2869
2875
  if (draft.halfLap) {
2876
+ scalar(Object.hasOwn(draft.halfLap, 'edgeWidth') ? draft.halfLap.edgeWidth : 0, t('editor.halfLap.edgeWidth'), 0, .005)
2870
2877
  const partner = editorHalfLapPartner(draft.halfLap, draft.entityId)
2871
2878
  if (!editorTimberCandidate(draft.entity, draft.tracks) || !editorHalfLapPartners(draft).some(entity => entity.id === partner)) {
2872
2879
  errors.push(t('editor.halfLap.invalid'))
@@ -2998,11 +3005,13 @@ window.__ModuleLoader__.load({
2998
3005
  if (draft.uvProjection != null) operations.push({ op: 'entity.uv.project', entityId: draft.entityId, ...editorClone(draft.uvProjection) })
2999
3006
  if (!editorEqual(entity.modifiers, original.modifiers)) operations.push({ op: 'entity.modifiers.set', entityId: draft.entityId, modifiers: editorClone(entity.modifiers) })
3000
3007
  const { halfLap, originalHalfLap } = draft
3001
- if (halfLap?.lowerEntityId !== originalHalfLap?.lowerEntityId || halfLap?.upperEntityId !== originalHalfLap?.upperEntityId) {
3008
+ if (halfLap?.lowerEntityId !== originalHalfLap?.lowerEntityId || halfLap?.upperEntityId !== originalHalfLap?.upperEntityId
3009
+ || (halfLap?.edgeWidth ?? 0) !== (originalHalfLap?.edgeWidth ?? 0)) {
3002
3010
  if (originalHalfLap && editorHalfLapPartner(originalHalfLap, draft.entityId) !== editorHalfLapPartner(halfLap, draft.entityId)) {
3003
3011
  operations.push({ op: 'joint.halfLap.set', ...originalHalfLap, enabled: false })
3004
3012
  }
3005
- if (halfLap) operations.push({ op: 'joint.halfLap.set', ...halfLap })
3013
+ if (halfLap) operations.push({ op: 'joint.halfLap.set', ...halfLap,
3014
+ ...((halfLap.edgeWidth ?? 0) !== (originalHalfLap?.edgeWidth ?? 0) ? { edgeWidth: halfLap.edgeWidth ?? 0 } : {}) })
3006
3015
  }
3007
3016
  const material = draft.material.definition, baseMaterial = editorMaterialOriginal(draft)
3008
3017
  const changedProperties = material && baseMaterial ? ['baseColor', 'roughness'].filter(key => !editorEqual(material.parameters?.[key], baseMaterial.parameters?.[key])) : []
@@ -3057,6 +3066,7 @@ window.__ModuleLoader__.load({
3057
3066
  && preview.baseRevision === intent.patch.baseRevision && preview.baseDigest === intent.expectedDigest
3058
3067
  && preview.storeIdentity === intent.expectedStoreIdentity && /^[a-f0-9]{64}$/.test(preview.candidateSpecHash ?? '')
3059
3068
  && preview.joint?.lowerEntityId === intent.joint.lowerEntityId && preview.joint?.upperEntityId === intent.joint.upperEntityId
3069
+ && (preview.joint?.edgeWidth ?? 0) === (intent.joint.edgeWidth ?? 0)
3060
3070
  && Number.isSafeInteger(preview.crossings) && preview.crossings > 0 && Number.isSafeInteger(preview.partialCrossings)
3061
3071
  && preview.partialCrossings >= 0 && preview.partialCrossings <= preview.crossings
3062
3072
  && preview.sample === (preview.partialCrossings ? 'partial' : 'full') && isImage(preview.lower) && isImage(preview.upper)
@@ -5503,8 +5513,17 @@ window.__ModuleLoader__.load({
5503
5513
  const halfLap = !partner ? null : role === 'upper'
5504
5514
  ? { lowerEntityId: partner, upperEntityId: entityId }
5505
5515
  : { lowerEntityId: entityId, upperEntityId: partner }
5516
+ if (halfLap && Object.hasOwn(current.halfLap || {}, 'edgeWidth')) halfLap.edgeWidth = current.halfLap.edgeWidth
5506
5517
  set({ editorDrafts: { ...data.editorDrafts, [editorKey(current.projectId, entityId)]: { ...current, halfLap } } })
5507
5518
  },
5519
+ setEditorHalfLapWidth: width => {
5520
+ const current = editorDraftFor(data)
5521
+ if (!current?.halfLap || data.busy.editor || current.baseRevision !== data.selected?.scene?.revision) return
5522
+ const halfLap = { ...current.halfLap }
5523
+ if (width === 0) delete halfLap.edgeWidth
5524
+ else halfLap.edgeWidth = width
5525
+ set({ editorDrafts: { ...data.editorDrafts, [editorKey(current.projectId, current.entityId)]: { ...current, halfLap } } })
5526
+ },
5508
5527
  cancelHalfLapPreview: () => {
5509
5528
  halfLapPreviewController?.abort()
5510
5529
  halfLapPreviewController = undefined
@@ -6436,6 +6455,7 @@ window.__ModuleLoader__.load({
6436
6455
  const halfLapPartners = editorHalfLapPartners(draft)
6437
6456
  const halfLapPartner = editorHalfLapPartner(draft.halfLap, draft.entityId)
6438
6457
  const halfLapRole = draft.halfLap?.upperEntityId === draft.entityId ? 'upper' : 'lower'
6458
+ const halfLapEdgeWidth = Object.hasOwn(draft.halfLap || {}, 'edgeWidth') ? draft.halfLap.edgeWidth : 0
6439
6459
  const halfLapOptions = halfLapPartners.map(entity => [entity.id, entity.id])
6440
6460
  if (halfLapPartner && !halfLapPartners.some(entity => entity.id === halfLapPartner)) halfLapOptions.push([halfLapPartner, halfLapPartner])
6441
6461
  const slotIntent = halfLapPreviewIntent(state, draft)
@@ -6536,6 +6556,10 @@ window.__ModuleLoader__.load({
6536
6556
  [['', t('editor.halfLap.none')], ...halfLapOptions], partner => actions.setEditorHalfLap(partner, halfLapRole)),
6537
6557
  halfLapPartner ? choose(t('editor.halfLap.role'), 'editor-half-lap-role', halfLapRole,
6538
6558
  [['lower', t('editor.halfLap.lower')], ['upper', t('editor.halfLap.upper')]], role => actions.setEditorHalfLap(halfLapPartner, role)) : null,
6559
+ halfLapPartner ? numeric(t('editor.halfLap.edgeWidth'), 'editor-half-lap-edge-width', halfLapEdgeWidth,
6560
+ actions.setEditorHalfLapWidth, { factor: 1000, min: 0, max: 5, step: .05,
6561
+ invalid: halfLapEdgeWidth < 0 || halfLapEdgeWidth > .005, error: t('editor.halfLap.edgeInvalid') }) : null,
6562
+ halfLapPartner ? el('p', { className: 'db-muted', key: 'edge-width-help' }, t('editor.halfLap.edgeHelp')) : null,
6539
6563
  slotIntent ? HalfLapPreview({ slotWork, apply, disabled, actions }) : null) : null] : null,
6540
6564
  el('p', { className: 'db-muted', key: 'local-size' }, t('editor.localDimensions', { scale: (draft.entity.transform.scale || [1, 1, 1]).join(' × ') })),
6541
6565
  geometry.shape === 'rounded_box' ? el('p', { className: 'db-muted', key: 'rounded' }, t('editor.roundedRequired')) : null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepblend/dsh-blender-bundle",
3
- "version": "0.27.0",
3
+ "version": "0.28.1",
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.27.0",
48
- "@deepblend/dsh-blender-host": "0.27.0",
49
- "@deepblend/dsh-blender-preset": "0.27.0",
50
- "@deepblend/dsh-blender-provider-local": "0.27.0",
51
- "@deepblend/dsh-blender-tool": "0.27.0",
52
- "@deepblend/dsh-blender-ui": "0.27.0"
47
+ "@deepblend/dsh-blender-contracts": "0.28.1",
48
+ "@deepblend/dsh-blender-host": "0.28.1",
49
+ "@deepblend/dsh-blender-preset": "0.28.1",
50
+ "@deepblend/dsh-blender-provider-local": "0.28.1",
51
+ "@deepblend/dsh-blender-tool": "0.28.1",
52
+ "@deepblend/dsh-blender-ui": "0.28.1"
53
53
  },
54
54
  "type": "module",
55
55
  "license": "MIT",