@volter/editor-blender 0.1.149 → 0.1.151

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 (93) hide show
  1. package/LICENSE +18 -9
  2. package/README.md +5 -5
  3. package/contributions/blender-animation-editors.tsx +17 -69
  4. package/contributions/blender-display-settings.ts +36 -0
  5. package/contributions/blender-export-gltf.ts +228 -0
  6. package/contributions/blender-export.verbs.ts +39 -0
  7. package/contributions/blender-gltf-export.verbs.ts +312 -0
  8. package/contributions/blender-header-menus.tsx +37 -133
  9. package/contributions/blender-icon-trace.mjs +8 -98
  10. package/contributions/blender-icons.source.mjs +96 -860
  11. package/contributions/blender-mixer-pose.ts +369 -0
  12. package/contributions/blender-model-opening.tsx +3 -7
  13. package/contributions/blender-node-editor.document.tsx +28 -180
  14. package/contributions/blender-node-geometry.ts +44 -230
  15. package/contributions/blender-node-panels.source.mjs +7 -121
  16. package/contributions/blender-outliner-authoring.ts +61 -415
  17. package/contributions/blender-outliner-model.ts +15 -112
  18. package/contributions/blender-play-area.tsx +100 -0
  19. package/contributions/blender-playback-movie.ts +409 -0
  20. package/contributions/blender-pose.ts +18 -368
  21. package/contributions/blender-properties-context.ts +1 -1
  22. package/contributions/blender-properties-model.ts +15 -90
  23. package/contributions/blender-properties-tab.tsx +3 -50
  24. package/contributions/blender-properties-view.tsx +15 -147
  25. package/contributions/blender-remedy.ts +14 -0
  26. package/contributions/blender-runtime-skin.ts +103 -99
  27. package/contributions/blender-runtime.document.tsx +217 -339
  28. package/contributions/blender-scene-mixer.ts +51 -0
  29. package/contributions/blender-screenshot.service.ts +28 -0
  30. package/contributions/blender-timeline-geometry.ts +16 -136
  31. package/contributions/blender-timeline.document.tsx +142 -332
  32. package/contributions/blender-uv-editor.document.tsx +48 -112
  33. package/contributions/blender-uv-geometry.ts +14 -179
  34. package/contributions/blender-version.status.tsx +43 -23
  35. package/contributions/blender.environment.ts +2 -2
  36. package/contributions/blender.icons.json +0 -9
  37. package/contributions/blender.keymap.ts +9 -51
  38. package/contributions/blender.node-panels.json +4 -13
  39. package/contributions/blender.page.ts +63 -0
  40. package/contributions/blender.status.tsx +9 -145
  41. package/contributions/blender.style.ts +25 -152
  42. package/contributions/blender.verbs.ts +52 -0
  43. package/contributions/model.layout.ts +2 -34
  44. package/contributions/models.finder.ts +12 -32
  45. package/contributions/properties-bone-constraints.inspector.tsx +1 -16
  46. package/contributions/properties-bone.inspector.tsx +2 -31
  47. package/contributions/properties-collection.inspector.tsx +1 -34
  48. package/contributions/properties-constraints.inspector.tsx +1 -21
  49. package/contributions/properties-data.inspector.tsx +2 -39
  50. package/contributions/properties-material.inspector.tsx +2 -33
  51. package/contributions/properties-modifiers.inspector.tsx +2 -30
  52. package/contributions/properties-object.inspector.tsx +2 -44
  53. package/contributions/properties-output.inspector.tsx +1 -27
  54. package/contributions/properties-particles.inspector.tsx +2 -46
  55. package/contributions/properties-physics.inspector.tsx +2 -41
  56. package/contributions/properties-render.inspector.tsx +1 -45
  57. package/contributions/properties-scene.inspector.tsx +1 -35
  58. package/contributions/properties-texture.inspector.tsx +1 -49
  59. package/contributions/properties-view-layer.inspector.tsx +1 -29
  60. package/contributions/properties-world.inspector.tsx +2 -39
  61. package/contributions/shading.layout.ts +3 -78
  62. package/contributions/uv-editing.layout.ts +3 -70
  63. package/dist-node/serving.mjs +13 -30
  64. package/host/blender-runtime-host.ts +541 -372
  65. package/host/scene-sound.ts +143 -0
  66. package/node/blender-mcp.ts +49 -93
  67. package/package.json +1209 -46
  68. package/producticons/blender-icons.otf +0 -0
  69. package/producticons/blender-product-icon-theme.json +129 -0
  70. package/serving/blender-routes.ts +9 -43
  71. package/serving/blender-wasm-artifact.ts +29 -166
  72. package/serving/index.ts +1 -1
  73. package/src/api.ts +9 -0
  74. package/src/layouts.tsx +1 -17
  75. package/src/looks.ts +1 -12
  76. package/src/model-document-saving.ts +25 -0
  77. package/src/model-play-extension.ts +173 -0
  78. package/src/node-view-state.ts +3 -25
  79. package/src/play-mode.ts +64 -38
  80. package/src/presentation.ts +6 -18
  81. package/src/regions.ts +3 -43
  82. package/src/start-document.ts +15 -0
  83. package/src/timeline-view-state.ts +4 -39
  84. package/src/uv-view-state.ts +4 -20
  85. package/themes/blender.json +299 -0
  86. package/view/blender-view-routes.ts +1 -1
  87. package/contributions/blender-game-panel.tsx +0 -809
  88. package/contributions/blender-palette.source.mjs +0 -350
  89. package/contributions/blender-play-skin.ts +0 -508
  90. package/contributions/blender-screenshot.menu.ts +0 -32
  91. package/contributions/blender.command.ts +0 -109
  92. package/contributions/blender.palette.json +0 -102
  93. package/src/play-live.ts +0 -27
@@ -1,85 +1,4 @@
1
- /**
2
- * TRACING A NODE'S SOCKET PANELS FROM BLENDER'S OWN DECLARATIONS — the table
3
- * that closes I5's one named gap (WORK.md §Blender in the tab is Blender,
4
- * "Inspection parity", I5; RULED 2026-09-19: "socket panels are traced from
5
- * Blender's source, like the icons and the palette").
6
- *
7
- * ## Why a trace and not a read
8
- *
9
- * `Node.panel_states` is RNA's whole answer about a node's socket panels: a
10
- * `persistent_uid` and `is_collapsed`, and nothing else
11
- * (`rna_nodetree.cc:9289-9299`, `:9430-9434`). Which SOCKETS belong to a
12
- * panel, what a panel is CALLED, and where a panel sits among the node's
13
- * items all live in the node's C++ declaration — the `root_items` list that
14
- * `node_update_basis_from_declaration` (`node_draw.cc:1086-1218`) walks — and
15
- * bpy exposes no part of it. Measured on the engine: a
16
- * `ShaderNodeBsdfPrincipled` answers 8 panel states and not one of its
17
- * `NodeSocket`s carries a panel field.
18
- *
19
- * So the membership is READ FROM THE SOURCE, exactly as the icons are traced
20
- * out of `release/datafiles/icons_svg/*.svg` (`blender-icon-trace.mjs`) and
21
- * the palette out of `userdef_default_theme.c` (`blender-palette.source.mjs`).
22
- * The reference is Blender's SOURCE as well as its frames
23
- * (ARCHITECTURE-CORE §Blender north star), and a declaration is source.
24
- *
25
- * ## What is traced, and what deliberately is not
26
- *
27
- * ONLY node types that DECLARE A PANEL. A node with no panel is already laid
28
- * out correctly by the flat path — its flattened item list is its socket list
29
- * — so a table row for it would carry no information and would have to be
30
- * kept in step with 558 files instead of 36. Measured at Blender 5.2.0
31
- * (`fbe6228777e7`): 558 `node_*.cc` files, **36** of which call `add_panel`
32
- * in a declaration (17 composite, 11 geometry, 5 shader, 3 function).
33
- *
34
- * TWO `add_panel` CALL SITES ARE EXCLUDED AND THE REASON IS STATED.
35
- * `intern/node_declaration.cc:474` is the builder method itself, not a
36
- * declaration. `intern/node_common.cc:485` is the NODE GROUP's declare, which
37
- * builds its panels in a LOOP over `ntree->tree_interface` — a group's panels
38
- * are runtime data, not a static declaration, and RNA *can* answer them
39
- * (`NodeTree.interface`), so tracing them would be tracing the wrong thing.
40
- * A group node therefore has no row here and keeps the flat fallback.
41
- *
42
- * ## The grammar this reads
43
- *
44
- * A declaration body is a straight-line sequence of builder calls. Measured
45
- * across the 36 files, a panel is introduced in exactly two spellings —
46
- * `PanelDeclarationBuilder &<var> = <recv>.add_panel("Name")` (49 sites) and
47
- * `auto &<var> = <recv>.add_panel("Name")` (17 sites) — and everything else
48
- * is `<recv>.add_input<…>("Name"[, "Identifier"])`,
49
- * `<recv>.add_output<…>(…)`, `<recv>.add_layout(…)`,
50
- * `<recv>.add_default_layout()` and `<recv>.add_separator()`, where `<recv>`
51
- * is either the root builder's own parameter or a bound panel variable. That
52
- * is the whole grammar, and this file parses that and nothing more.
53
- *
54
- * A body with CONTROL FLOW is parsed straight through — both arms of an
55
- * `if`/`else` contribute items, in source order — and the entry is marked
56
- * `conditional`. That is deliberately a LOUD approximation rather than a
57
- * clever one: the consumer checks the traced item list against the engine's
58
- * LIVE socket list before it uses it, and a node whose real declaration took
59
- * the other arm simply disagrees and falls back to flat with its frame
60
- * warning. A static parser cannot evaluate `b.tree_or_null()`, and pretending
61
- * otherwise is how a drawing quietly stops being a measurement.
62
- *
63
- * ## Running it
64
- *
65
- * ```
66
- * node packages/editor-blender/contributions/blender-node-panels.source.mjs \
67
- * [--checkout <path>] [--check]
68
- * ```
69
- * writes (or, with `--check`, verifies) `blender.node-panels.json` beside
70
- * this file. The checkout defaults to `~/volter/blender-src`, the sparse
71
- * checkout pinned at the engine's own commit; `source/blender/nodes` is one
72
- * of the paths it must carry (see the checkout recipe's file map).
73
- *
74
- * ## Licence
75
- *
76
- * What lands in the JSON is a table of PANEL NAMES and SOCKET NAMES read out
77
- * of GPL-2.0-or-later sources. `@volter/editor-blender` is AGPL-3.0-only, which that
78
- * is compatible with (relicense to GPL-3.0, then §13), and the package
79
- * already carries Blender itself — the same standing this file's sibling
80
- * `blender-icon-trace.mjs` records for the icon paths. Nothing traced here
81
- * may be copied into an Apache-2.0 or MIT part of this repo.
82
- */
1
+
83
2
 
84
3
  import { readdirSync, readFileSync, statSync, writeFileSync } from 'node:fs';
85
4
  import { homedir } from 'node:os';
@@ -90,9 +9,7 @@ const DEFAULT_CHECKOUT = join(homedir(), 'volter', 'blender-src');
90
9
  const NODES_ROOT = join('source', 'blender', 'nodes');
91
10
  const OUT = fileURLToPath(new URL('./blender.node-panels.json', import.meta.url));
92
11
 
93
- /** The two `add_panel` call sites that are not a node's declaration — see the
94
- * header. Both are named rather than filtered by a shape rule, so a third one
95
- * appearing upstream shows up as a new row instead of vanishing. */
12
+ /** Exclude the two add_panel call sites outside node declarations. Other upstream call sites remain visible. */
96
13
  const NOT_A_DECLARATION = new Set([
97
14
  join(NODES_ROOT, 'intern', 'node_common.cc'),
98
15
  join(NODES_ROOT, 'intern', 'node_declaration.cc'),
@@ -162,7 +79,7 @@ function blockAt(source, open) {
162
79
  * `;` at nesting depth 0 ends a statement; a `{ … }` that closes back to
163
80
  * depth 0 is spliced in as its own statements, which is what makes an
164
81
  * `if`/`else` body contribute its items in source order (and what makes the
165
- * entry `conditional` — see the header).
82
+ * diagnostic report list conditional declarations).
166
83
  */
167
84
  function statementsOf(block) {
168
85
  const out = [];
@@ -207,15 +124,7 @@ function statementsOf(block) {
207
124
 
208
125
  /* ----------------------------------------------------------------- the walk */
209
126
 
210
- /**
211
- * The string literals in the FIRST call of a chain, and only that call.
212
- *
213
- * `open` is the index of its `(`. Taking the balanced argument list rather
214
- * than "every quoted run in the statement" is not a nicety: the very first
215
- * node measured, `Base Color`, chains
216
- * `.description("Color of the material used for …")`, and a whole-statement
217
- * scan reads that sentence as the socket's identifier.
218
- */
127
+ /** Read string literals only from the first balanced call in a chain. Later description calls are metadata, not socket identifiers. */
219
128
  function firstStrings(call, open) {
220
129
  let depth = 0;
221
130
  let end = call.length;
@@ -302,10 +211,7 @@ function parseDeclaration(body, rootParam) {
302
211
  if (method === 'add_input' || method === 'add_output') {
303
212
  const names = firstStrings(call, open);
304
213
  if (names.length === 0) continue;
305
- // EVERY OPTIONAL FLAG IS OMITTED WHEN IT IS FALSE, and `identifier` when
306
- // it equals the name. The table is 36 node types and is meant to be
307
- // READ in review; spelling four `false`s per socket triples it for no
308
- // information (105 KB against 47 KB, measured).
214
+ // Omit false flags and identifiers equal to the socket name to keep the generated declaration table compact.
309
215
  const socket = {
310
216
  kind: method === 'add_input' ? 'input' : 'output',
311
217
  name: names[0],
@@ -319,10 +225,6 @@ function parseDeclaration(body, rootParam) {
319
225
  // (`node_declaration.cc:528-542`) takes the panel's FIRST item when it
320
226
  // is a panel-toggle boolean input.
321
227
  if (/\.panel_toggle\s*\(/.test(call)) socket.panelToggle = true;
322
- // `.available(<expr>)` — a socket whose availability is COMPUTED. It is
323
- // recorded rather than resolved: the consumer matches against the LIVE
324
- // socket list, where the expression has already been evaluated.
325
- if (/\.available\s*\(/.test(call)) socket.conditional = true;
326
228
  // `SocketDeclaration::align_with_previous_socket` (`:196`): this socket
327
229
  // shares the previous socket's ROW instead of taking one
328
230
  // (`add_flat_items_for_socket`, `node_draw.cc:704-717`).
@@ -347,17 +249,7 @@ function parseDeclaration(body, rootParam) {
347
249
 
348
250
  /* ------------------------------------------------------------ the registry */
349
251
 
350
- /**
351
- * The node types a file registers, each with the declaration function it
352
- * points `ntype.declare` at.
353
- *
354
- * `<x>_node_type_base(&ntype, "IDNAME"_ustr, …)` names the type and
355
- * `ntype.declare = <ns>::<fn>` names the body. Where one file registers two
356
- * types from two nested namespaces with the SAME function name
357
- * (`node_geo_foreach_geometry_element.cc` is the measured case), the body is
358
- * the definition of that name nearest ABOVE the register function — which is
359
- * what C++ name lookup resolves to from inside the namespace.
360
- */
252
+ /** Resolve each registered node type’s declare function to the nearest preceding definition in its namespace. */
361
253
  function registrationsOf(source) {
362
254
  const declares = [];
363
255
  const declareEach =
@@ -371,12 +263,7 @@ function registrationsOf(source) {
371
263
  });
372
264
  }
373
265
  const out = [];
374
- // THREE SPELLINGS, measured across the tree: `static void node_register()`
375
- // with `NOD_REGISTER_NODE(node_register)` (411 sites, the modern one),
376
- // `static void register_node()` (5) and the legacy
377
- // `void register_node_type_sh_*()` (the shader tree's). A function is a
378
- // registration when its body calls `<x>_node_type_base(&ntype, "IDNAME")`,
379
- // which is the test below; these names are only how the body is FOUND.
266
+ // Find node_register, register_node and register_node_type_sh_* bodies; only calls to a node-type base constructor identify registrations.
380
267
  const registerEach =
381
268
  /(?:static\s+)?void\s+(register_node_type_\w+|node_register|register_node)\s*\(\s*\)\s*\{/g;
382
269
  for (let hit = registerEach.exec(source); hit !== null; hit = registerEach.exec(source)) {
@@ -429,7 +316,6 @@ function build(checkout) {
429
316
  // DECLARATION layout path at all. A panel-declaring node that does not
430
317
  // set it is a contradiction worth carrying rather than hiding.
431
318
  customSocketOrder: parsed.customSocketOrder,
432
- ...(parsed.conditional ? { conditional: true } : {}),
433
319
  items: parsed.items,
434
320
  };
435
321
  }