@volter/editor-blender 0.1.150 → 0.1.152
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/LICENSE +18 -9
- package/README.md +5 -5
- package/contributions/blender-animation-editors.tsx +17 -69
- package/contributions/blender-display-settings.ts +36 -0
- package/contributions/blender-export-gltf.ts +228 -0
- package/contributions/blender-export.verbs.ts +39 -0
- package/contributions/blender-gltf-export.verbs.ts +312 -0
- package/contributions/blender-header-menus.tsx +37 -133
- package/contributions/blender-icon-trace.mjs +8 -98
- package/contributions/blender-icons.source.mjs +96 -860
- package/contributions/blender-mixer-pose.ts +369 -0
- package/contributions/blender-model-opening.tsx +26 -56
- package/contributions/blender-node-editor.document.tsx +30 -181
- package/contributions/blender-node-geometry.ts +44 -230
- package/contributions/blender-node-panels.source.mjs +7 -121
- package/contributions/blender-outliner-authoring.ts +61 -415
- package/contributions/blender-outliner-model.ts +15 -112
- package/contributions/blender-play-area.tsx +99 -0
- package/contributions/blender-playback-movie.ts +409 -0
- package/contributions/blender-pose.ts +18 -368
- package/contributions/blender-properties-context.ts +1 -1
- package/contributions/blender-properties-model.ts +59 -91
- package/contributions/blender-properties-tab.tsx +3 -50
- package/contributions/blender-properties-view.tsx +39 -181
- package/contributions/blender-remedy.ts +14 -0
- package/contributions/blender-runtime-skin.ts +103 -99
- package/contributions/blender-runtime.document.tsx +170 -618
- package/contributions/blender-scene-mixer.ts +51 -0
- package/contributions/blender-screenshot.service.ts +28 -0
- package/contributions/blender-timeline-geometry.ts +16 -136
- package/contributions/blender-timeline.document.tsx +145 -333
- package/contributions/blender-uv-editor.document.tsx +48 -112
- package/contributions/blender-uv-geometry.ts +14 -179
- package/contributions/blender-version.status.tsx +45 -31
- package/contributions/blender.environment.ts +2 -2
- package/contributions/blender.icons.json +0 -9
- package/contributions/blender.keymap.ts +9 -51
- package/contributions/blender.node-panels.json +4 -13
- package/contributions/blender.page.ts +64 -0
- package/contributions/blender.status.tsx +8 -150
- package/contributions/blender.style.ts +25 -152
- package/contributions/blender.verbs.ts +52 -0
- package/contributions/model.layout.ts +2 -34
- package/contributions/models.finder.ts +3 -30
- package/contributions/properties-bone-constraints.inspector.tsx +1 -16
- package/contributions/properties-bone.inspector.tsx +2 -31
- package/contributions/properties-collection.inspector.tsx +1 -34
- package/contributions/properties-constraints.inspector.tsx +1 -21
- package/contributions/properties-data.inspector.tsx +2 -39
- package/contributions/properties-material.inspector.tsx +2 -33
- package/contributions/properties-modifiers.inspector.tsx +2 -30
- package/contributions/properties-object.inspector.tsx +2 -44
- package/contributions/properties-output.inspector.tsx +1 -27
- package/contributions/properties-particles.inspector.tsx +2 -46
- package/contributions/properties-physics.inspector.tsx +2 -41
- package/contributions/properties-render.inspector.tsx +1 -45
- package/contributions/properties-scene.inspector.tsx +1 -35
- package/contributions/properties-texture.inspector.tsx +1 -49
- package/contributions/properties-view-layer.inspector.tsx +1 -29
- package/contributions/properties-world.inspector.tsx +2 -39
- package/contributions/shading.layout.ts +3 -78
- package/contributions/uv-editing.layout.ts +3 -70
- package/dist-node/serving.mjs +13 -32
- package/host/blender-runtime-host.ts +795 -412
- package/host/scene-sound.ts +143 -0
- package/node/blender-mcp.ts +52 -95
- package/package.json +1221 -46
- package/producticons/blender-icons.otf +0 -0
- package/producticons/blender-product-icon-theme.json +129 -0
- package/serving/blender-routes.ts +9 -48
- package/serving/blender-wasm-artifact.ts +29 -166
- package/serving/index.ts +1 -1
- package/src/api.ts +9 -0
- package/src/layouts.tsx +1 -17
- package/src/looks.ts +1 -12
- package/src/model-document-saving.ts +25 -0
- package/src/node-view-state.ts +3 -25
- package/src/play-mode.ts +13 -42
- package/src/play-tool.ts +44 -0
- package/src/presentation.ts +6 -18
- package/src/regions.ts +3 -43
- package/src/start-document.ts +15 -0
- package/src/timeline-view-state.ts +4 -39
- package/src/uv-view-state.ts +4 -20
- package/themes/blender.json +299 -0
- package/view/blender-view-routes.ts +1 -1
- package/contributions/blender-game-panel.tsx +0 -809
- package/contributions/blender-palette.source.mjs +0 -350
- package/contributions/blender-play-skin.ts +0 -508
- package/contributions/blender-screenshot.menu.ts +0 -32
- package/contributions/blender.command.ts +0 -109
- package/contributions/blender.palette.json +0 -102
- package/src/play-live.ts +0 -27
|
@@ -1,53 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TRACING BLENDER'S OWN ICON SOURCES — the half of `blender-icons.source.mjs`
|
|
3
|
-
* that turns one of Blender's per-icon SVGs into a path on this set's 16-unit
|
|
4
|
-
* grid (WORK.md §Blender in the tab is Blender, "Inspection parity", I2
|
|
5
|
-
* decision 2).
|
|
6
|
-
*
|
|
7
|
-
* ## Why a trace and not a drawing
|
|
8
|
-
*
|
|
9
|
-
* The Properties rail's sixteen tabs used to be OUR marks in Blender's idiom,
|
|
10
|
-
* and I1 measured what that cost: thirteen of the sixteen were a distinct NAME
|
|
11
|
-
* over a neighbouring silhouette this set already drew (a globe for World, a
|
|
12
|
-
* magnet for Constraints, a palette for Material), not a measurement of
|
|
13
|
-
* Blender's mark. The north star is "the reference is Blender's SOURCE as well
|
|
14
|
-
* as its frames" (ARCHITECTURE-CORE §Blender north star), and for an icon the
|
|
15
|
-
* source is literally a vector file: `release/datafiles/icons_svg/<name>.svg`
|
|
16
|
-
* in the Blender checkout at the engine's pin. Tracing it is a MEASUREMENT;
|
|
17
|
-
* drawing a lookalike is a guess with a citation stapled to it.
|
|
18
|
-
*
|
|
19
|
-
* ## Licence
|
|
20
|
-
*
|
|
21
|
-
* Blender's icon sources are GPL-2.0-or-later, like the rest of the Blender
|
|
22
|
-
* tree, and a trace of one is a derivative of it. `@volter/editor-blender` therefore
|
|
23
|
-
* carries BOTH licences — its SPDX expression is
|
|
24
|
-
* `AGPL-3.0-only AND GPL-3.0-or-later` (`packages/blender/LICENSE`): our code
|
|
25
|
-
* AGPL-3.0-only, Blender's traced artwork conveyed under GPL-3.0-or-later on
|
|
26
|
-
* Blender's own "or later", and AGPL §13 / GPL §13 permitting the
|
|
27
|
-
* combination. So a GPL icon PATH may live inside this package, and that is
|
|
28
|
-
* deliberate, stated in the package's LICENSE and recorded per glyph in
|
|
29
|
-
* `blender.icons.traced.json` (source file + sha256). Nothing traced here may
|
|
30
|
-
* be copied into an Apache-2.0 or MIT part of this repo — `packages/editor`'s
|
|
31
|
-
* own icon set included.
|
|
32
|
-
*
|
|
33
|
-
* ## The geometry
|
|
34
|
-
*
|
|
35
|
-
* Blender authors each icon on a 16-unit grid and Inkscape writes it out
|
|
36
|
-
* inside a 1600x1600 viewBox with a `matrix(100 0 0 100 tx ty)` on the path —
|
|
37
|
-
* so the trace is: compose the element's transforms, scale by
|
|
38
|
-
* `16 / viewBox width`, and the result is already this set's coordinate
|
|
39
|
-
* system. Nothing is re-proportioned, re-stroked or re-centred; a traced
|
|
40
|
-
* glyph is Blender's own outline.
|
|
41
|
-
*
|
|
42
|
-
* Not every icon is that simple, which is why this is a general affine
|
|
43
|
-
* transform rather than a scale-and-offset: `material.svg` carries a
|
|
44
|
-
* REFLECTION (`matrix(-99.99 0 0 99.99 …)`), `particles.svg` a quarter
|
|
45
|
-
* ROTATION (`matrix(0 100 -100 0 …)`) with a second matrix on the path inside
|
|
46
|
-
* it, and `pointcloud_data.svg` a NON-UNIFORM scale. Under any of those an
|
|
47
|
-
* elliptical arc's radii and x-axis rotation change, and a reflection flips
|
|
48
|
-
* its sweep — {@link transformArc} does that properly instead of assuming the
|
|
49
|
-
* matrix is a scale.
|
|
50
|
-
*/
|
|
1
|
+
/** Trace Blender’s per-icon SVG source into this set’s 16-unit grid. Compose affine transforms and scale by the authored Inkscape grid unit; transformArc handles rotation, reflection and non-uniform scale. Blender artwork is GPL-2.0-or-later and is conveyed here under GPL-3.0-or-later, combined with AGPL-3.0-only code under both licences’ section 13. The package LICENSE and blender.icons.traced.json retain source paths and hashes. Traced artwork must not enter Apache-2.0 or MIT packages. */
|
|
51
2
|
|
|
52
3
|
// ------------------------------------------------------------------ matrices
|
|
53
4
|
|
|
@@ -287,47 +238,13 @@ function chunk(values, size) {
|
|
|
287
238
|
return out;
|
|
288
239
|
}
|
|
289
240
|
|
|
290
|
-
/**
|
|
291
|
-
* THE AUTHORED UNIT, WHICH IS NOT THE ARTBOARD. Blender's icons are drawn on
|
|
292
|
-
* an Inkscape canvas whose grid the file itself declares —
|
|
293
|
-
* `<inkscape:grid spacingx="100" spacingy="100">` — and one square of that
|
|
294
|
-
* grid is one unit of the 16-unit icon grid. So the scale from a file's user
|
|
295
|
-
* units to this set's is `1 / spacing`, and the viewBox does not enter it.
|
|
296
|
-
*
|
|
297
|
-
* MEASURED at the engine's pin (v5.2.0, 790 files in
|
|
298
|
-
* `release/datafiles/icons_svg/`): 755 declare `spacingx="100"`, two
|
|
299
|
-
* (`key_shift*.svg`) declare 50, and 33 declare no grid at all — those 33 are
|
|
300
|
-
* machine-written with a `matrix(100 …)` on the group and take the default
|
|
301
|
-
* below. The viewBox is NOT square with the grid: only **536 of the 790 are
|
|
302
|
-
* 1600 wide**, and the rest run from 48 to 5236. A mark authored on a
|
|
303
|
-
* 14-unit-wide canvas is fourteen units wide, not sixteen, so scaling it by
|
|
304
|
-
* `16 / 1400` inflated it by a seventh and pushed its ink off the bottom of
|
|
305
|
-
* the cell — `light_data.svg` traced to a box 18.29 tall. That was the defect
|
|
306
|
-
* this constant replaces (WORK.md §Blender in the tab is Blender, I5,
|
|
307
|
-
* orchestrator ruling 2 of 2026-09-19: "the icon trace scales by the authored
|
|
308
|
-
* unit, not the artboard").
|
|
309
|
-
*/
|
|
241
|
+
/** Scale from the authored Inkscape grid spacing, not the viewBox width; source files without a grid use the default authored unit below. */
|
|
310
242
|
const DEFAULT_GRID_SPACING = 100;
|
|
311
243
|
|
|
312
244
|
/**
|
|
313
|
-
*
|
|
314
|
-
*
|
|
315
|
-
*
|
|
316
|
-
* This is the other half of the same measurement, and the data states it
|
|
317
|
-
* plainly: rescaled by the authored unit, **every one of the 197 traced marks
|
|
318
|
-
* has its ink box starting at exactly (1, 1)** and ending exactly one unit
|
|
319
|
-
* short of the artboard — `mod_particle_instance.svg` 1600×1600 → [1, 1, 15,
|
|
320
|
-
* 15], `light_data.svg` 1400×1700 → [1, 1, 13, 16], `dot.svg` 600×600 →
|
|
321
|
-
* [1, 1, 5, 5]. That is Inkscape's "resize page to drawing" with a one-grid
|
|
322
|
-
* margin, run per file. So the page carries the mark's SIZE and nothing about
|
|
323
|
-
* where it sits in a 16-unit cell, and reading its top-left corner as the
|
|
324
|
-
* cell's corner is what put the 4-unit dot and the 10-unit checkbox in the
|
|
325
|
-
* top-left eighth of their cells.
|
|
326
|
-
*
|
|
327
|
-
* Centring the PAGE (not the ink) keeps the authored margins symmetric, and
|
|
328
|
-
* it is exactly zero for a 1600×1600 artboard — which is why this leaves the
|
|
329
|
-
* 158 glyphs authored on that page byte-identical and moves only the 39 that
|
|
330
|
-
* are not.
|
|
245
|
+
* Scale the artboard by its authored grid spacing, then centre it in the
|
|
246
|
+
* 16-unit cell. Centring the artboard preserves its symmetric margins when
|
|
247
|
+
* its extent differs from the cell's size.
|
|
331
248
|
*/
|
|
332
249
|
const centreOffset = (extent, spacing) => (16 - extent / spacing) / 2;
|
|
333
250
|
|
|
@@ -344,16 +261,9 @@ const withOwn = (matrix, tag) =>
|
|
|
344
261
|
* so the caller can state how much of the box the mark fills rather than
|
|
345
262
|
* assume it.
|
|
346
263
|
*
|
|
347
|
-
*
|
|
348
|
-
*
|
|
349
|
-
*
|
|
350
|
-
* set". Measured at the pin: **21 of the 790 files nest two or more
|
|
351
|
-
* transformed groups**, and `mod_particle_instance.svg` — a `matrix(0 -1 -1 0
|
|
352
|
-
* 558.008 761.005)` quarter turn INSIDE a `matrix(100 0 0 -100 …)` flip —
|
|
353
|
-
* traced to a box at [273, −60], seventeen grid units clear of the canvas. A
|
|
354
|
-
* single-sample read cannot see an inner transform at all, so this keeps a
|
|
355
|
-
* STACK: a `<g>` pushes the matrix in force times its own, `</g>` pops, and a
|
|
356
|
-
* `<path>` draws under whatever is on top.
|
|
264
|
+
* Group transforms compose through a stack: `<g>` pushes the current matrix
|
|
265
|
+
* times its own transform, `</g>` pops, and each `<path>` composes its own
|
|
266
|
+
* transform with the matrix on top.
|
|
357
267
|
*/
|
|
358
268
|
export function traceBlenderIcon(svg) {
|
|
359
269
|
const viewBox = /viewBox="([^"]+)"/.exec(svg);
|