@volter/editor-threejs 0.5.88 → 0.5.89

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.88",
4
+ "version": "0.5.89",
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.88",
138
+ "@volter/editor-project": "0.5.89",
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.88",
143
+ "@volter/editor-sdk": "0.5.89",
144
144
  "postprocessing": "6.38.3",
145
145
  "quarks.core": "0.16.0",
146
146
  "@fortawesome/free-solid-svg-icons": "^7.2.0"
@@ -432,13 +432,15 @@ export function Object3DDocumentToolbar({
432
432
  </ViewportDisplayModeMenu>
433
433
  {/* THE EYE WAS THE OVERLAYS CONTROL ALL ALONG — measured by what it
434
434
  toggles, which is Grid and Bounds, exactly Blender's Show Overlays
435
- subject. It takes Blender's mark. It does NOT take Blender's split
436
- toggle+chevron: that toggle binds to a MASTER overlays flag this
437
- document's session does not have, and deriving one from "any
438
- overlay is on" would silently drop the per-overlay state on the
439
- first click. One button, one job, until the session has the flag. */}
435
+ subject. It takes Blender's mark, and Blender's split toggle+chevron:
436
+ the toggle is the MASTER flag, this stage's own helpers switch
437
+ (`StageHost` takes the grid, axis lines and selection marks down
438
+ with it), and each overlay below keeps its own choice under it. */}
440
439
  <ViewportOverlaysMenu
441
440
  glyph={<ViewportOverlaysGlyph />}
441
+ {...(stage === null
442
+ ? {}
443
+ : { master: { enabled: stage.showHelpers, onToggle: () => stage.toggleHelpers() } })}
442
444
  choices={[
443
445
  {
444
446
  id: 'grid',
@@ -1244,8 +1244,14 @@ export function Object3DDocumentViewport({
1244
1244
  const rig = new StagePresentationRig(host.scene, invalidateStages);
1245
1245
  host.presentationRig = rig;
1246
1246
  bindViewPresentation(documentId, viewStageKind);
1247
+ // THE STAGE'S SHOW OVERLAYS is its store's helpers switch (Blender's
1248
+ // `View3DOverlay.show_overlays`, one per area): off, the grid, the axis lines and the
1249
+ // selection's outline and origins go with the helpers, and each keeps its own choice
1250
+ // for when it comes back on.
1251
+ let overlaysShown = host.store.shell.showHelpers;
1247
1252
  const applyPresentation = () => {
1248
1253
  const presentation = viewPresentation(documentId);
1254
+ overlaysShown = host.store.shell.showHelpers;
1249
1255
  rig.apply(presentation, renderer, dressingToneMapping);
1250
1256
  // The view's overlays: its selection marks and its grid's major step. The native
1251
1257
  // outline is also the stage's own switch (a shared preview draws none).
@@ -1255,7 +1261,7 @@ export function Object3DDocumentViewport({
1255
1261
  host.viewport?.setGridMajorEvery(presentation.overlays.grid.majorEvery);
1256
1262
  host.viewport?.setAxisLines(presentation.overlays.axes);
1257
1263
  host.viewport?.setNavigation(presentation.overlays.navigation);
1258
- host.viewport?.setGridVisible(presentation.overlays.grid.visible);
1264
+ host.viewport?.setGridVisible(presentation.overlays.grid.visible && overlaysShown);
1259
1265
  if (host.session) {
1260
1266
  // An X-ray with no surface draws no outline: the selection is its wires' colour.
1261
1267
  const surfaceless =
@@ -1263,8 +1269,12 @@ export function Object3DDocumentViewport({
1263
1269
  presentation.xray.enabled &&
1264
1270
  presentation.xray.alpha <= 0;
1265
1271
  host.session.selectionOutlineEnabled =
1266
- !shared && selectionOutlineRef.current && presentation.overlays.selection.outline && !surfaceless;
1267
- host.session.selectionOriginsEnabled = !shared && presentation.overlays.selection.origins;
1272
+ !shared &&
1273
+ overlaysShown &&
1274
+ selectionOutlineRef.current &&
1275
+ presentation.overlays.selection.outline &&
1276
+ !surfaceless;
1277
+ host.session.selectionOriginsEnabled = !shared && overlaysShown && presentation.overlays.selection.origins;
1268
1278
  host.session.setXray(presentation.xray);
1269
1279
  }
1270
1280
  invalidateStages();
@@ -1272,6 +1282,11 @@ export function Object3DDocumentViewport({
1272
1282
  host.applyPresentation = applyPresentation;
1273
1283
  applyPresentation();
1274
1284
  host.cleanups.push(subscribeViewportPresentation(applyPresentation));
1285
+ host.cleanups.push(
1286
+ host.store.shell.subscribe(() => {
1287
+ if (host.store.shell.showHelpers !== overlaysShown) applyPresentation();
1288
+ }),
1289
+ );
1275
1290
  // A view may name an environment image its integration registers later.
1276
1291
  host.cleanups.push(
1277
1292
  subscribeEnvironmentImages(() => {
@@ -363,7 +363,10 @@ export function ViewportFurniture({
363
363
 
364
364
  return (
365
365
  <>
366
- {chrome.viewName === 'text' ? (
366
+ {/* The view text is an overlay (Blender's `show_text`), gone with the stage's Show Overlays;
367
+ the camera's frame below is not (`drawviewborder`: "When overlays are disabled, only
368
+ show camera outline & passepartout"). */}
369
+ {chrome.viewName === 'text' && store.showHelpers ? (
367
370
  <div
368
371
  data-testid="viewport-view-text"
369
372
  aria-hidden="true"