@volter/editor-threejs 0.5.156 → 0.5.158

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@volter/editor-threejs",
3
3
  "author": "Volter AI, Inc.",
4
- "version": "0.5.156",
4
+ "version": "0.5.158",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -135,12 +135,12 @@
135
135
  "serving": "./dist-node/serving.mjs"
136
136
  },
137
137
  "dependencies": {
138
- "@volter/editor-project": "0.5.156",
138
+ "@volter/editor-project": "0.5.158",
139
139
  "@sparkjsdev/spark": "^2.1.0",
140
140
  "three.quarks": "^0.16.0",
141
141
  "zod": "^4.3.6",
142
142
  "typescript": "5.9.3",
143
- "@volter/editor-sdk": "0.5.156",
143
+ "@volter/editor-sdk": "0.5.158",
144
144
  "postprocessing": "6.38.3",
145
145
  "quarks.core": "0.16.0",
146
146
  "@fortawesome/free-solid-svg-icons": "^7.2.0"
@@ -1836,6 +1836,12 @@ export function Object3DDocumentViewport({
1836
1836
  // leave behind. The session runs this before it renders; nothing else may
1837
1837
  // hold a second copy of this field list.
1838
1838
  const syncHostScene = () => {
1839
+ // A document's World is its neutral backdrop. Transfer it when it
1840
+ // changes, before the view's explicit backdrop override is applied.
1841
+ if (nativeBackground !== scene.background) {
1842
+ nativeBackground = scene.background;
1843
+ documentSession.setNeutralBackground(nativeBackground ?? host.defaultBackground);
1844
+ }
1839
1845
  // A document draws through its session's camera, which the viewport's own frame
1840
1846
  // does not know is orthographic.
1841
1847
  host.viewport?.alignGridToView(documentSession.camera(), renderer.domElement.width);
@@ -1899,17 +1905,13 @@ export function Object3DDocumentViewport({
1899
1905
  toneMapping: String(renderer.toneMapping),
1900
1906
  });
1901
1907
  }
1902
- if (nativeBackground !== scene.background) {
1903
- nativeBackground = scene.background;
1904
- documentSession.setNeutralBackground(nativeBackground ?? host.defaultBackground);
1905
- }
1906
1908
  };
1907
1909
  host.syncHostScene = syncHostScene;
1908
1910
  documentSession.setBeforeRender((interactive) => {
1909
1911
  host.syncHostScene?.();
1910
1912
  const mode = documentSession.presentation().mode;
1911
1913
  const navigation = interactive && ['solid', 'preview', 'clay', 'unlit', 'matcap'].includes(mode);
1912
- return source.prepareDraw?.(documentSession.camera(), {interactive: navigation, height: renderer.domElement.height, multiDraw: renderer.extensions.has('WEBGL_multi_draw')});
1914
+ return source.prepareDraw?.(documentSession.camera(), {interactive: navigation, height: renderer.domElement.height, multiDraw: renderer.extensions.has('WEBGL_multi_draw'), renderer});
1913
1915
  });
1914
1916
  // This loop draws the compass and every other overlay pass over the
1915
1917
  // document's own render, so it — and only it — can serve the chrome
@@ -57,7 +57,7 @@ export interface ToolObject3DPreviewSource {
57
57
  * returned function restores temporary draw state, including after errors.
58
58
  * Interactive draws may use disposable navigation geometry; omitted/false
59
59
  * always means full detail (captures and default frame-cost readings). */
60
- prepareDraw?(camera: Camera, options?: {interactive: boolean; height: number; multiDraw?: boolean}): void | (() => void);
60
+ prepareDraw?(camera: Camera, options?: {interactive: boolean; height: number; multiDraw?: boolean; renderer?: WebGLRenderer}): void | (() => void);
61
61
  /**
62
62
  * EVERY CHANGE TO WHAT THE SOURCE DRAWS, announced: the host calls
63
63
  * `listener` whenever the source's graph, materials, textures or poses may