@deepblend/dsh-blender-preset 0.2.19 → 0.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepblend/dsh-blender-preset",
3
- "version": "0.2.19",
3
+ "version": "0.3.0",
4
4
  "type": "module",
5
5
  "description": "DeepBlend Agent-preset plane: ships the DeepBlend Studio agent presets and the deployer row that installs them into the DSH home.",
6
6
  "main": "lib/index.js",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: deepblend-studio
3
- description: Use when planning or producing a 3D animation with DeepBlend Studio — setting up a shot or product scene, bringing the user's own 3D model into a project, changing a Blender scene through SceneSpec patches, rendering and judging a preview, repairing a scene that measures badly, running, checking, cancelling or resuming a long final render, or delivering a finished video. Also use when a previous session's revision has to be restored.
3
+ description: Use when planning or producing a 3D animation with DeepBlend Studio — setting up a shot or product scene, importing models or visual references, changing a scene through SceneSpec patches, reviewing previews against the saved goal, running or resuming a final render, delivering a video, or restoring a previous revision.
4
4
  ---
5
5
 
6
6
  # DeepBlend Studio
@@ -37,22 +37,157 @@ time (`RENDER_JOB_CONFLICT`).
37
37
 
38
38
  ## The order that works
39
39
 
40
+ ### Establish the visual target before building
41
+
42
+ Record the intended object, dimensions, audience, material identities and delivery
43
+ views in the project goal. Bind available reference images as immutable project assets
44
+ through `project.referenceImages`; describing a file in the goal does not attach it.
45
+ For the import, binding and evidence rules, read [Reference image workflow](references/reference-images.md).
46
+ If no reference is
47
+ available, state the chosen proportions and finish as assumptions. Break a product
48
+ into named parts with distinct silhouettes, seams, thickness and material assignments.
49
+ Choose a route for each part: import an authorized asset, use a supported procedural
50
+ shape, or build a blockout pending a more capable modeling operation. A blockout is
51
+ an intermediate result; describe its missing details explicitly.
52
+
53
+ For rotational products, use `generator.shape: "lathe"` with an ordered
54
+ `profile: [[radius, height], ...]`; returning along the inside models a real wall
55
+ and base. Add profile points along curved shoulders instead of stacking cylinders.
56
+ For a cylindrical ceramic cup with a connected semicircular handle, use
57
+ `shape:"handled_cup"`. Defaults make a 40 mm radius, 105 mm high cup with 3 mm
58
+ walls and a 5 mm base in a metre scene. `handleLower`/`handleUpper` locate the
59
+ attachment centres; `handleRadius`, `rootRadius` and `rootLength` control the
60
+ handle and flared roots. Dimensions constrain one another; an unsupported edit
61
+ is refused before publication. The generated mesh is checked for topology, UVs
62
+ and illegal intersections. Inspect actual clay and glazed root close-ups;
63
+ these checks do not certify curvature continuity, manufacturing thickness or
64
+ artistic quality. Existing modifier stacks can change the generated result.
65
+
66
+ For handles and cables, use `shape: "curve"`, a three-dimensional `path`, `radius`,
67
+ and `pathInterpolation: "bezier"` for smooth bends. Check joins and self-intersections;
68
+ overlapping parts are not automatically fused into one solid.
69
+ Use ordered entity `modifiers` for solidify (wall thickness), mirror, array and
70
+ boolean union/difference/intersect. A boolean's `targetEntityId` names a separate
71
+ single-mesh operand; set that operand's `visible:false` to avoid rendering it twice.
72
+ Inspect the resulting junction: a watertight union does not automatically create
73
+ a rounded transition. Generator bevel runs before these modifiers. Add
74
+ `{type:"bevel",width:0.002,segments:6,angle:30}` after a boolean to round its new
75
+ edges (width is a local distance; angle is in degrees). Overlap clamping can reduce
76
+ the width on dense geometry, so inspect close-ups and adjust the join when needed.
77
+
78
+ The entity bevel modifier accepts `miterInner:"arc"|"sharp"`. Omission preserves
79
+ the existing arc behavior. Sharp can avoid crossing artifacts around curved bores;
80
+ it does not guarantee a smooth union or solve the vessel-handle seam. This option
81
+ does not belong to `generator.bevel`. Inspect real close-ups after changing it.
82
+
83
+ Use these checkpoints before delivery:
84
+
85
+ For environmental reflections and illumination, ingest an equirectangular
86
+ HDR/EXR (linear Rec.709) or PNG/JPEG (sRGB), declare it, and set
87
+ `world:{strength:0.6,environment:{assetId:"studio-environment",rotation:0}}`.
88
+ Rotation is around world Z in radians. `world.set` replaces the whole block;
89
+ retain the environment when adjusting strength, omit it to return to flat color.
90
+ Check highlight placement on the product, not only the background image.
91
+
92
+ For brushed metal, use a Principled material with `parameters.anisotropic` in
93
+ [0,1] and `anisotropicRotation` in turns (0.25 = 90 degrees). Set a real tangent
94
+ with `material.tangent.set`: `{mode:"uv",uvMap:"UVMap"}` follows that named UV
95
+ map, or `{mode:"radial",axis:"z"}` follows Blender's cylindrical projection
96
+ around the object's local x/y/z axis. Active anisotropy requires Cycles; emission
97
+ materials reject these fields. Nonzero strength/rotation or their animation
98
+ requires an explicit tangent. UV existence is checked on faces actually using
99
+ the material, after local slot overrides, including evaluated native curves and
100
+ text without changing their source data. Zero strength and rotation can
101
+ remove tangent with null. Inspect changed highlights in a close-up; procedural
102
+ noise can add microtexture but is not a substitute for anisotropic reflection.
103
+
104
+ For procedural grain, set the full texture with material.texture.set. Coordinates
105
+ default to object space. Use coordinates:"uv" and optional uvMap:"UVMap" to
106
+ follow an authored surface layout; omitting the UV name uses the active render
107
+ layer. Named maps must exist on every evaluated surface actually using the
108
+ material; unused slots do not block compilation. UV mode requires principled
109
+ or glass. On lathe UV (U around circumference, V along profile), noise with
110
+ scale:1 and stretch:[0.0001,800,1] follows circumferential lines. Compare roughness
111
+ and grain separately under fixed lighting and camera; UV frequency is layout
112
+ relative, not a physical groove measurement.
113
+
114
+ For image PBR, ingest PNG/JPEG maps and declare the returned assets, then use
115
+ `material.images.set` with baseColor/roughness/metallic/normal/alpha/emissionColor
116
+ bindings. Each binding names an assetId; optional scale and offset are UV vectors,
117
+ uvMap names an existing UV layer. Scalar maps support channel r/g/b/a (default r),
118
+ normal supports strength and expects OpenGL tangent-space data. Color maps are sRGB;
119
+ numeric maps are Non-Color. Clear procedural texture before binding images. Maps
120
+ replace their socket values; emissionColor still needs emissionStrength. Verify
121
+ actual texture scale and surface response in a close-up, not only node existence.
122
+
123
+ Revise existing geometry with `entity.generator.set` (replace the full generator)
124
+ and `entity.modifiers.set` (replace the full ordered stack; [] clears it). Preserve
125
+ entity identity so material, camera and animation references survive the edit.
126
+
127
+ 1. **Proportions:** inspect a neutral clay preview from front, side and three-quarter
128
+ views. Compare silhouette, scale and part placement with the goal/reference.
129
+ 2. **Geometry:** inspect a close-up for edge rounding, wall thickness, joins and
130
+ repeated details. Use the generator's bevel where suitable; increasing render
131
+ samples cannot repair a coarse silhouette or missing geometry.
132
+ 3. **Materials and lighting:** preserve imported materials unless an override is
133
+ intentional. Inspect metal reflections, surface roughness, glass transparency,
134
+ texture scale and contact shadows. Keep preview and final color transforms the
135
+ same so a finish approved in preview survives final rendering.
136
+ 4. **Motion:** inspect the first, middle and last frames and every important reveal.
137
+ Check intersections, framing and whether the lighting still describes the shape.
138
+
139
+ For each checkpoint, record what was inspected, what remains wrong and the next
140
+ specific change. A high composition/exposure score does not establish visual quality.
141
+ When the current tools cannot produce an essential detail, report that limitation
142
+ and propose an asset or supported construction that meets the requirement.
143
+
144
+ To inspect geometry and finish independently, first call `blender_scene_get` for
145
+ the revision and existing cameras. Call `blender_preview_render` with explicit
146
+ `revision`, `cameraId`, `frame` and `mode:"clay"`; repeat with `mode:"beauty"` at
147
+ the same camera and frame. For example:
148
+
149
+ ```json
150
+ {"projectId":"product","revision":"r0003","cameraId":"camera-detail","frame":1,"mode":"clay","samples":16}
151
+ ```
152
+
153
+ These inspections require Host API 6 or newer and attach the verified PNG when
154
+ an attachment store is available. If the result says no image was attached, the
155
+ model has not seen it; read the actual image before making visual claims. Images
156
+ are rebuilt from SceneSpec in independent storage and do not alter the source
157
+ revision or ordinary previews. Clay removes transparency, emission, textures and
158
+ bump/normal response; imported shader displacement can change the rendered shape.
159
+ It does not prove wall thickness, manifold geometry, no intersections or artistic
160
+ approval. Use declared cameras for front, side, three-quarter and detail checks;
161
+ if a needed camera is absent, add it through the normal revision workflow first.
162
+ Record the source revision, camera, frame, mode and concrete findings, then patch
163
+ the current revision and repeat the affected views with the same settings.
164
+
40
165
  1. **`blender_capabilities`** — what this Blender can actually do: engines, formats,
41
166
  GPU. Call it once per session before promising anything. It reports absence as
42
167
  data (`installed: false` plus a warning), never as a crash.
43
- 2. **`blender_project_create`** — a project owns a SceneSpec, a revision history and
44
- the render output. The first revision is `r0001`.
45
- 3. **`blender_asset_ingest`** — only if the user brought a model file. It is a two-step
46
- contract and the second step is easy to forget; see "Bringing in a model" below.
168
+ 2. **`blender_recipe_list` / `blender_project_create`** — inspect locally validated product recipes
169
+ before building a matching product from scratch. Create from the returned recipe id, version
170
+ and digest, with only its declared parameter overrides; never combine recipe with sceneSpec.
171
+ Recipe colors are scene-linear RGB, not hex/sRGB. Source/license/hash metadata does not prove
172
+ authorship or artistic quality. A project owns its SceneSpec, revision history and render output;
173
+ the first revision is `r0001`. If no recipe fits, use a supplied scene or the minimal scaffold route.
174
+ 3. **`blender_asset_ingest`** — import an authorized model or image into project storage.
175
+ Declare its returned asset descriptor in a patch, then bind its intended use:
176
+ a model instance, material map, environment, or review reference. See the model
177
+ workflow below and the reference image guide above.
47
178
  4. **`blender_scene_get`** — read before writing. Patching without reading is how a
48
179
  stale `baseRevision` produces a refusal you then have to diagnose.
49
180
  5. **`blender_scene_patch`** — the ONLY way to change a scene. There is no free-form
50
181
  edit and no script. See "Revision discipline" below.
51
182
  6. **`blender_preview_render` / `blender_preview_views`** — look at it. `preview_views`
52
- renders several declared views in one Blender launch and returns a contact sheet.
183
+ renders several declared views in one Blender launch and returns contact sheet
184
+ paths and measurements as text. It does not attach those images automatically;
185
+ read the images before claiming to have seen them. Single-frame `preview_render`
186
+ attaches an independent inspection when an explicit beauty/clay mode is set.
53
187
  7. **`blender_visual_review`** — ask for a measured judgement (see "Who decides what").
54
- 8. **`blender_visual_autofix`** — hand the loop a goal and let it iterate, when the
55
- problem is one the measurements can see.
188
+ 8. **`blender_visual_autofix`** — iterate against the revision's saved goal and
189
+ reference images with a bounded budget. It requires evidenced artistic judgment
190
+ as well as technical measurements; it cannot rewrite the target to obtain a pass.
56
191
  9. **`blender_final_render`** — only once the preview is right. It returns as soon as
57
192
  the job is durable, not when it finishes.
58
193
  10. **`blender_job_status`** — poll it, or come back to it in a later turn. A render
@@ -82,6 +217,15 @@ Two steps follow it, and a scene that skips the second one has an asset nobody u
82
217
  import. Setting `license` on anything you downloaded is worth the argument: an asset
83
218
  whose provenance is unrecorded is one nobody can safely ship.
84
219
 
220
+ For local .gltf/.glb buffers/images or .obj MTL/texture dependencies, pass sourceRoot when resources
221
+ live above the model directory. Use the returned path and hash in asset.add;
222
+ dependency changes create a new locked path even if the main-file hash is unchanged.
223
+ Remote external dependencies are refused. Old declarations with unlocked core
224
+ resources must be reimported from the complete local source; compilation refuses
225
+ before clearing the scene. OBJ also includes an existing same-basename .mtl, even
226
+ without mtllib. Used OBJ textures are embedded in checkpoints; undecodable or
227
+ oversized images refuse compilation. Self-contained GLB keeps its single content-addressed file.
228
+
85
229
  ## Revision discipline
86
230
 
87
231
  - **One successful patch = one immutable revision.** Nothing rewrites history.
@@ -90,8 +234,9 @@ whose provenance is unrecorded is one nobody can safely ship.
90
234
  - **Retrying is safe.** An omitted idempotency key is derived from the patch itself, so
91
235
  an accidental resend returns the first result instead of making a second revision.
92
236
  Pass an explicit key only when you deliberately want the same operations twice.
93
- - **Going back is `blender_revision_restore`**, which moves the pointer forward to a
94
- copy — it does not delete anything. Use it when a change measured worse.
237
+ - **Going back is `blender_revision_restore`**, which selects an existing revision
238
+ as the current revision and preserves history. Read the current revision again
239
+ before the next patch. Use it when a change measured worse.
95
240
  - **Long renders resume; they do not restart.** `blender_final_render` with a
96
241
  `resumeJobId` renders only the frames that are missing or corrupt. The frames on disk
97
242
  are the authority, not the job record, so a render killed mid-frame resumes correctly.
@@ -116,11 +261,18 @@ hard to get wrong:
116
261
  the measured issues, and what the vision model *reported*. A reported finding is kept
117
262
  only if the view exists, the category is in the closed set, and the evidence is not
118
263
  empty. Never present a reported finding as a measurement.
119
- - **Autofix only adopts a fix that measurably improved the score.** A round that did not
120
- improve is rolled back — the revision stays in history, but the project does not move
121
- to a worse version. If the loop stops short of the goal it hands back the open issues
264
+ - **Autofix separates technical and artistic quality.** It reviews geometry, materials,
265
+ lighting and goal fit even when the technical score passes. It can adopt an evidenced
266
+ artistic improvement at an unchanged technical score; regressions and unsupported
267
+ equal-score changes are rolled back. Missing artistic evidence is not approval.
268
+ Candidate comparisons receive both the baseline and candidate sheets. If the loop
269
+ stops short of the goal it hands back the open issues
122
270
  with their measurements and the revisions it tried; that handover is the state to
123
271
  continue from, not a failure to re-run.
272
+ - **Reference claims need recorded image evidence.** A referenced dimension passes
273
+ only when its `referenceIds` cover every applicable attached reference. Technical
274
+ scores, successful uploads and scripted reviewer tests do not prove a visual match.
275
+ If the reviewer or image input failed, report that limitation rather than a pass.
124
276
 
125
277
  ## Reading the evidence you get back
126
278
 
@@ -142,3 +294,12 @@ hard to get wrong:
142
294
  - The workbench UI shows the same authoritative state you are reading. If a user says the
143
295
  panel disagrees with you, the panel is reading the host and the host is reading disk —
144
296
  find the difference rather than assuming either side.
297
+
298
+ ### 导入模型的部件材质
299
+
300
+ 先保存导入资产的检查点,再读 `blender_scene_get.assetParts` 的准确 partId;slotIndex 使用
301
+ sourceMaterialSlots 的原始 index。materialSlots 只表示当前结果,可能已被整体覆盖合并。
302
+ 用 `entity.materialBindings.set` 完整替换局部绑定(保留未修改项),每项是
303
+ `{partId,materialId,slotIndex?}`。省略槽位表示这个网格的全部槽,指定槽覆盖优先。
304
+ 保持原几何、UV 和面的材质索引;部件父路径不隐式选择后代。空数组恢复原材质或现有
305
+ entity.materialId 的整体覆盖。局部图片材质同样要求被使用网格有对应 UV;不要猜选择器。
@@ -0,0 +1,100 @@
1
+ # Reference images for DeepBlend review
2
+
3
+ Use this workflow when a design goal includes photographs, sketches or material
4
+ examples. References guide artistic review; they do not become geometry, material
5
+ maps or environment lighting unless explicitly bound for those separate uses.
6
+
7
+ ## Save the target before reviewing
8
+
9
+ 1. Read the current revision with `blender_scene_get`. Identify what each image
10
+ should guide: `geometry`, `materials`, `lighting` or `goalFit`.
11
+ 2. Import the image using `blender_asset_ingest {projectId, sourcePath}`. A remote
12
+ `sourceUrl` uses that tool's existing approval flow. Reviews never fetch an image
13
+ URL directly. Keep the returned `assetId`, `type`, `path` and `sha256`.
14
+ 3. Send one `blender_scene_patch` against the revision you read. Use `asset.add`
15
+ for new assets, followed by `project.brief.set {goal, referenceImages}`. This
16
+ operation replaces the entire brief: preserve every reference still wanted.
17
+ 4. Review the resulting revision with `blender_visual_review`. Use
18
+ `blender_visual_autofix` when bounded corrective changes are wanted. Both read
19
+ the saved revision's references automatically.
20
+
21
+ Each reference has this shape (replace the digest placeholder with the actual
22
+ ingest result):
23
+
24
+ ```json
25
+ {
26
+ "id": "finish-reference",
27
+ "assetId": "finish-photo",
28
+ "sha256": "<returned-sha256>",
29
+ "label": "Brushed champagne metal",
30
+ "purposes": ["materials", "lighting"],
31
+ "notes": "Match the finish and highlights, not the object shape"
32
+ }
33
+ ```
34
+
35
+ Rules that affect the request:
36
+
37
+ - At most four static PNG/JPEG references. Each must be at most 8 MiB,
38
+ 16,000,000 pixels and 8192 pixels per side. A smaller deployment asset limit
39
+ can constrain uploads further. Animated or malformed images are refused.
40
+ - `id` must be unique. `purposes` must contain one to four distinct allowed values.
41
+ `label` is 1–160 characters; optional `notes` is at most 1000.
42
+ - The asset must be declared in the same revision, with matching `sha256` and
43
+ `assets/raw/<sha256>.<type>` path. Do not resolve a newer same-name asset alias.
44
+ - `goal` is at most 2000 characters. Both brief fields are required; `goal:""`
45
+ and `referenceImages:[]` clear the target. Clear a reference before removing
46
+ its asset, including when both operations share one patch.
47
+ - UI uploads store assets only. The user must save the brief to create its new
48
+ revision. An unsaved draft does not change the reference set used for review.
49
+
50
+ ## Choose the main review subject
51
+
52
+ Use `project.reviewSubject.set {entityId}` to save the entity measured for framing,
53
+ exposure and occlusion; `entityId:null` restores automatic selection. Choose an
54
+ existing non-empty entity, commonly the product body. This does not move cameras
55
+ or replace the brief. Clear or replace the binding before removing the entity.
56
+ A hidden bound entity stays selected and is reported unavailable.
57
+
58
+ Automatic selection can choose a long accessory by bounding radius. For multipart
59
+ products, inspect the resolved subject and save an explicit choice when needed.
60
+ `subject-part` marks required body parts; independent `subject` objects are not
61
+ implicitly parts. Artistic review must still inspect the full product and scene.
62
+ Read the actual saved `review.subject` and its availability/reason in QA, not an
63
+ unsaved selector draft. Missing measurements cannot establish technical or artistic
64
+ pass even when the remaining numeric score is high.
65
+
66
+ ## Interpret the evidence
67
+
68
+ `visual_review.score`, `pass` and `technicalPass` describe technical measurements.
69
+ Read `artistic` separately. Each dimension needs an actual rendered `viewId`,
70
+ specific visible evidence and sufficient confidence. For dimensions with references:
71
+
72
+ - `pass` must cite **all** applicable `referenceIds`.
73
+ - `needs_work` must cite at least one applicable reference showing a mismatch.
74
+ - `unassessable` need not claim reference coverage. Hidden or missing evidence is
75
+ not approval; invented, duplicate or wrong-purpose IDs are rejected.
76
+
77
+ The recorded `referenceImages` identify verified image inputs; check
78
+ `reviewer.error` and `referenceInputError` before saying the model inspected them.
79
+ Preserved images and hashes establish which inputs were used, not that the model's
80
+ artistic judgment is correct. Do not claim online visual validation from scripted
81
+ model replies or a green local test suite.
82
+
83
+ ## Keep the evaluation target fixed
84
+
85
+ Autofix fixes the baseline's actual subject ID across candidate renders, including
86
+ when camera targets, tags or dimensions change. It refuses subject selection,
87
+ removal or hiding operations. A missing, hidden or unmeasured subject stops the
88
+ baseline or conditionally restores the candidate. `REVIEW_SUBJECT_OPERATION_REFUSED`,
89
+ `REVIEW_SUBJECT_CHANGED` and `REVIEW_SUBJECT_UNAVAILABLE` are round/handover reasons.
90
+
91
+ Autofix cannot change the brief or delete/replace referenced assets. It compares
92
+ `reviewInputsDigest` before accepting candidates. `REVIEW_INPUT_OPERATION_REFUSED`
93
+ means the proposal was blocked; `REVIEW_INPUTS_CHANGED` means the candidate cannot
94
+ be accepted against the earlier target. These are round/handover reasons.
95
+
96
+ A failed candidate is restored only if the project is still on that candidate.
97
+ On `REVISION_CONFLICT`, read the current revision and inspect intervening changes.
98
+ Do not bypass that guard. On missing or changed reference bytes, restore the
99
+ original asset or deliberately import and save a new target; do not silently
100
+ substitute another picture. A legitimate target change starts a new review.