@volter/blender-engine 0.1.41 → 0.1.43

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.
@@ -1768,12 +1768,20 @@ class Session:
1768
1768
  if not os.path.exists(self.document):
1769
1769
  return {"document": relative_path, "opened": False}
1770
1770
  bpy.ops.wm.open_mainfile(filepath=self.document)
1771
+ size = os.path.getsize(self.document)
1772
+ # THE STAGED COPY GOES ONCE BLENDER HAS READ IT. It sits in the engine's heap (WasmFS keeps
1773
+ # file data in linear memory) and nothing reads it again: the load took everything into
1774
+ # Blender's own memory, packed pictures included, and the next save writes the path anew.
1775
+ # Freed before the first present, its bytes serve that present's evaluation instead of
1776
+ # raising the heap's high-water mark by the file's size (307 MB for the Stoneguard file).
1777
+ # The worker still holds the host's stamp for it, so it is not staged in again.
1778
+ os.remove(self.document)
1771
1779
  self.present()
1772
1780
  # The load did not dirty anything: what is in memory IS the file.
1773
1781
  self.save_due = False
1774
1782
  return {"document": relative_path, "opened": True,
1775
1783
  "objects": len(bpy.data.objects),
1776
- "size": os.path.getsize(self.document)}
1784
+ "size": size}
1777
1785
 
1778
1786
  def mark_changed(self):
1779
1787
  """A request that can change the model ran: the next present carries
@@ -1493,9 +1493,22 @@ export class BlenderRuntimeView {
1493
1493
  // is ahead of this presenter — a page reloaded under a still-running
1494
1494
  // session — and saying so by name is what makes it re-send the frame
1495
1495
  // in full (`dispatch.mts`, `runtime_present`).
1496
- if (this.frame?.session === next.session && this.meshes.has(id)) continue;
1496
+ // AND AT THAT REVISION: the frame names every mesh with the revision the engine holds
1497
+ // it at, so it is a whole manifest of what this presenter should hold, and a resident
1498
+ // geometry at another revision has drifted from the engine (a present the session
1499
+ // recorded that never landed here). Refusing it by name is the same resync as a mesh
1500
+ // not held at all: the session drops its record and re-sends in full.
1501
+ const resident = this.meshes.get(id)?.signature;
1502
+ if (
1503
+ this.frame?.session === next.session &&
1504
+ resident !== undefined &&
1505
+ (resident === `revision:${data.revision}` || !resident.startsWith('revision:'))
1506
+ )
1507
+ continue;
1497
1508
  throw new Error(
1498
- `${UNKNOWN_GEOMETRY}: the presenter does not hold runtime mesh ${id} (store ${data.store}, revision ${data.revision})`,
1509
+ resident === undefined
1510
+ ? `${UNKNOWN_GEOMETRY}: the presenter does not hold runtime mesh ${id} (store ${data.store}, revision ${data.revision})`
1511
+ : `${UNKNOWN_GEOMETRY}: the presenter holds runtime mesh ${id} at ${resident}, not revision ${data.revision}`,
1499
1512
  );
1500
1513
  }
1501
1514
  const drawn = 'hash' in data;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@volter/blender-engine",
3
3
  "author": "Volter AI, Inc.",
4
4
  "license": "GPL-3.0-or-later",
5
- "version": "0.1.41",
5
+ "version": "0.1.43",
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },
package/wasm/BUNDLE.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "blender": "5.2.0 LTS",
3
- "source": "071e080a21c09e07f2dac8593dca2f9a566e591e",
4
- "reviewedSource": "071e080a21c09e07f2dac8593dca2f9a566e591e",
3
+ "source": "1b2547991d6841a6ea4c1394b8d648086b9af6c9",
4
+ "reviewedSource": "1b2547991d6841a6ea4c1394b8d648086b9af6c9",
5
5
  "upstream": "fbe6228777e7d9afefcd61a413844e790ae75db7",
6
6
  "sourceRepository": "https://github.com/volter-ai/blender",
7
- "sourceRecipe": "https://github.com/volter-ai/blender/blob/071e080a21c09e07f2dac8593dca2f9a566e591e/build_files/emscripten/RELEASE.md",
8
- "sourceRelease": "https://github.com/volter-ai/blender/releases/tag/blender-5.2.0-wasm.3",
9
- "verification": "https://github.com/volter-ai/blender/releases/download/blender-5.2.0-wasm.3/VERIFICATION.json",
7
+ "sourceRecipe": "https://github.com/volter-ai/blender/blob/1b2547991d6841a6ea4c1394b8d648086b9af6c9/build_files/emscripten/RELEASE.md",
8
+ "sourceRelease": "https://github.com/volter-ai/blender/releases/tag/blender-5.2.0-wasm.4",
9
+ "verification": "https://github.com/volter-ai/blender/releases/download/blender-5.2.0-wasm.4/VERIFICATION.json",
10
10
  "factoryEngine": "BLENDER_EEVEE",
11
11
  "files": {
12
12
  "blender_browser.js": "raw",
@@ -15,12 +15,12 @@
15
15
  },
16
16
  "rawFiles": {
17
17
  "blender_browser.js": {
18
- "bytes": 408162,
19
- "sha256": "2a5d4dbcc90cab571eb16eef9672ef8583e1c0a3638d0b85165d1944d191d9a7"
18
+ "bytes": 408423,
19
+ "sha256": "0c63c29e7d4b1ba1fce4e94057778b0757767b25ea4f6f01d329e99351568f30"
20
20
  },
21
21
  "blender_browser.wasm": {
22
- "bytes": 86305783,
23
- "sha256": "a9927fc4c71b41b9d464c34e8700b234bd736f75425e10a8b4d9986770d0954e"
22
+ "bytes": 86318165,
23
+ "sha256": "722b181cec94f1bdf2f088e0ae92f04ffa5a79c267bf5b04af7260c16e34eb0f"
24
24
  },
25
25
  "blender_browser.data": {
26
26
  "bytes": 52698568,
@@ -29,12 +29,12 @@
29
29
  },
30
30
  "shippedFiles": {
31
31
  "blender_browser.js": {
32
- "bytes": 408162,
33
- "sha256": "2a5d4dbcc90cab571eb16eef9672ef8583e1c0a3638d0b85165d1944d191d9a7"
32
+ "bytes": 408423,
33
+ "sha256": "0c63c29e7d4b1ba1fce4e94057778b0757767b25ea4f6f01d329e99351568f30"
34
34
  },
35
35
  "blender_browser.wasm.br": {
36
- "bytes": 18601875,
37
- "sha256": "63098ef8988e1040aa9e97c9aa7c01f06c5f835582732e057daf2ccf69040440"
36
+ "bytes": 18597884,
37
+ "sha256": "55ef6f9d63a4c8afa7e7aec4388d1f8c462f5294fcbba8bfbbabe5c41a13f8f9"
38
38
  },
39
39
  "blender_browser.data.br": {
40
40
  "bytes": 8056563,
@@ -48,6 +48,6 @@
48
48
  "note": "Official Blender v5.2.0 plus our headless wasm changes and our existing export/session integration. Dependencies are rebuilt from pinned official sources. No third-party Blender port commits or build scripts are inputs. PROXY_TO_PTHREAD, WasmFS, 512 MiB initial / 4 GiB maximum memory, twelve-worker pool. Build information is disabled. The source release includes the exact source tree, materialized startup.blend, dependency archives, pure Python wheels, and notices.",
49
49
  "callTrampoline": "CPython 3.13.13 is compiled with PY_CALL_TRAMPOLINE for Blender CPython slot arity casts. This applies to CPython dispatch, not arbitrary indirect calls.",
50
50
  "engineIds": "The existing session registers Python render engines under CYCLES, BLENDER_EEVEE and BLENDER_WORKBENCH; the headless build permits built-in IDs to be shadowed.",
51
- "exportDoor": "The source-owned bpy_web_export.cc exports Principled physical inputs, normal images, eight named UV layers and evaluated corner normals, and takes graph_materials/graph_images/graph_generated: materials the session draws from their node graph are reduced quietly (a shader mix to the one Principled BSDF it reaches), the images their graphs sample ship at the door revisions (a UDIM image with every tile), and a deformed mesh whose graph reads Generated coordinates ships its orco. Datablock revisions are keyed by session_uid. blender_web_session.cc is unchanged.",
51
+ "exportDoor": "The source-owned bpy_web_export.cc exports Principled physical inputs, normal images, eight named UV layers and evaluated corner normals, and takes graph_materials/graph_images/graph_generated (a graph-drawn shader mix reduced to the one Principled BSDF it reaches, graph images at the door revisions with every UDIM tile, orco for deformed meshes whose graph reads Generated coordinates). A frame can defer its changed meshes and pictures (defer) for the caller to pull one at a time (export_mesh, export_image), each call freeing the previous one's columns and a picture it decoded; an undo step keeps the revisions when Blender kept the depsgraph (session_undo); Blender's CPU subdivision descriptor is released once a mesh is read; the memory door reports malloc in-use and free. Datablock revisions are keyed by session_uid. writefile.cc writes one copy of the document per save in the browser build.",
52
52
  "preloadedPayload": "releasePreloadedFileData releases the JS preload buffer after session ready. The measured working payload exclusions are retained."
53
53
  }