@deepblend/dsh-blender-tool 0.19.0 → 0.21.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/tools.js +21 -3
- package/package.json +2 -2
package/lib/tools.js
CHANGED
|
@@ -135,8 +135,11 @@ export function apply(ctx) {
|
|
|
135
135
|
function placeOnSurface(ctx) {
|
|
136
136
|
return defineTool({
|
|
137
137
|
name: 'blender_place_on_surface',
|
|
138
|
-
description: 'Place a saved entity above a chosen support using
|
|
139
|
-
'
|
|
138
|
+
description: 'Place a saved entity or a complete saved lamp above a chosen support using actual evaluated meshes, then save one editable Blender revision and preview. ' +
|
|
139
|
+
'Default entity scope moves only the selected subject’s world Z and keeps its XY, rotation and scale; supports generated meshes and whole imported asset instances. ' +
|
|
140
|
+
'For the complete pinned metal-lamp2.2 assembly, use scope="recipe-assembly" and the subjectEntityId returned in scene.assemblyPlacement. ' +
|
|
141
|
+
'This moves every lamp member, including the cable: optional pose applies relative world translation in mm and upright yaw in degrees, then the complete native mesh union settles vertically onto the selected support. ' +
|
|
142
|
+
'pose.pivotMm defaults to the saved base origin; translation is applied after rotation. All camera/light settings are retained, so inspect framing after a large move and explicitly edit photography if needed. ' +
|
|
140
143
|
'Read blender_scene_get first and pass its current baseRevision, both entity IDs and an explicit frame. ' +
|
|
141
144
|
'clearanceMm is a vertical gap, not distance along a surface normal. Requires static geometry without related cross-entity geometry dependencies. ' +
|
|
142
145
|
'The receipt describes this selected pair at that frame; it does not certify physical stability, collisions with other objects or the movement path. ' +
|
|
@@ -146,6 +149,13 @@ function placeOnSurface(ctx) {
|
|
|
146
149
|
projectId: { type: 'string', required: true, description: 'The existing project.' },
|
|
147
150
|
baseRevision: { type: 'string', required: true, description: 'Current revision returned by blender_scene_get. Stale revisions are refused.' },
|
|
148
151
|
subjectEntityId: { type: 'string', required: true, description: 'Entity to move vertically; use the whole entity ID for an imported asset instance.' },
|
|
152
|
+
scope: { type: 'string', enum: ['entity', 'recipe-assembly'], description: 'Default entity preserves existing single-entity semantics. recipe-assembly explicitly selects every member of the supported saved complete metal lamp2.2.' },
|
|
153
|
+
pose: { type: 'object', additionalProperties: false, description: 'For recipe-assembly only. Apply a relative world pose first, then settle the complete lamp in world Z; no scale or tilt.',
|
|
154
|
+
properties: {
|
|
155
|
+
translationMm: { type: 'array', items: { type: 'number' }, description: 'Relative world [dx,dy,dz] in mm, exactly3 finite numbers within ±1000000. Default[0,0,0]. The provisional Z is adjusted by surface settling.' },
|
|
156
|
+
yawDegrees: { type: 'number', description: 'Relative rotation about world Z in degrees, ±360; default0. Positive is counter-clockwise viewed from above.' },
|
|
157
|
+
pivotMm: { type: 'array', items: { type: 'number' }, description: 'World [x,y,z] rotation pivot in mm, exactly3 finite numbers within ±1000000. Default is the current saved base origin. Rotate first, then translate.' },
|
|
158
|
+
} },
|
|
149
159
|
supportEntityId: { type: 'string', required: true, description: 'Different entity whose evaluated surface should support the subject.' },
|
|
150
160
|
frame: { type: 'integer', required: true, description: 'Explicit frame to measure and verify, from 0 to 1000000. The Host enforces this range.' },
|
|
151
161
|
clearanceMm: { type: 'number', description: 'Required vertical gap in millimetres, 0–1000; defaults to 0. The Host enforces this range.' },
|
|
@@ -162,10 +172,16 @@ function placeOnSurface(ctx) {
|
|
|
162
172
|
throw new BlenderError(BlenderErrorCode.RUNTIME_UNAVAILABLE,
|
|
163
173
|
'This Host cannot perform measured surface placement. Update the DeepBlend Host bundle and restart the profile before retrying.')
|
|
164
174
|
}
|
|
175
|
+
if (args.scope === 'recipe-assembly' && resolved.studio.assemblyPlacementSupported !== true) {
|
|
176
|
+
throw new BlenderError(BlenderErrorCode.RUNTIME_UNAVAILABLE,
|
|
177
|
+
'This Host cannot place the complete lamp assembly. Update the DeepBlend Host bundle and restart the profile before retrying.')
|
|
178
|
+
}
|
|
165
179
|
const { data, canonicalWarnings } = await canonicalCall(resolved.studio.placeOnSurface({
|
|
166
180
|
// Preserve unknown fields so the Host can reject them rather than silently changing the intent.
|
|
167
181
|
...args,
|
|
168
182
|
projectId: args.projectId, baseRevision: args.baseRevision,
|
|
183
|
+
...(args.scope === undefined ? {} : { scope: args.scope }),
|
|
184
|
+
...(args.pose === undefined ? {} : { pose: args.pose }),
|
|
169
185
|
subjectEntityId: args.subjectEntityId, supportEntityId: args.supportEntityId, frame: args.frame,
|
|
170
186
|
clearanceMm: args.clearanceMm ?? 0, renderPreview: args.renderPreview ?? true,
|
|
171
187
|
cameraId: args.cameraId, idempotencyKey: args.idempotencyKey, signal: exec?.signal,
|
|
@@ -186,7 +202,9 @@ function placeOnSurface(ctx) {
|
|
|
186
202
|
return { ok: false, ...failure }
|
|
187
203
|
}
|
|
188
204
|
},
|
|
189
|
-
presentCall: args => ({ card: 'generic', title:
|
|
205
|
+
presentCall: args => ({ card: 'generic', title: args?.scope === 'recipe-assembly'
|
|
206
|
+
? `Place the complete lamp on "${args?.supportEntityId ?? ''}"`
|
|
207
|
+
: `Place "${args?.subjectEntityId ?? ''}" on "${args?.supportEntityId ?? ''}"`,
|
|
190
208
|
kind: 'move', projectId: args?.projectId }),
|
|
191
209
|
})
|
|
192
210
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepblend/dsh-blender-tool",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Agent-preset tool consumer: registers the model-visible DeepBlend Blender tools. Publishes no service.",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"./package.json": "./package.json"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@deepblend/dsh-blender-contracts": "0.
|
|
14
|
+
"@deepblend/dsh-blender-contracts": "0.21.0"
|
|
15
15
|
},
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"repository": {
|