@volter/editor-threejs 0.5.92 → 0.5.93

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.92",
4
+ "version": "0.5.93",
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.92",
138
+ "@volter/editor-project": "0.5.93",
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.92",
143
+ "@volter/editor-sdk": "0.5.93",
144
144
  "postprocessing": "6.38.3",
145
145
  "quarks.core": "0.16.0",
146
146
  "@fortawesome/free-solid-svg-icons": "^7.2.0"
@@ -13,6 +13,7 @@ import {
13
13
  Button,
14
14
  EditorBanner,
15
15
  EditorIcon,
16
+ editorIcons,
16
17
  EditorPopover,
17
18
  EditorToolbar,
18
19
  IconButton,
@@ -430,6 +431,20 @@ export function Object3DDocumentToolbar({
430
431
  </Text>
431
432
  </label>
432
433
  </ViewportDisplayModeMenu>
434
+ {/* BLENDER'S SHOW GIZMO (`View3D.show_gizmo`), beside Show Overlays as Blender's header
435
+ has them: this stage's transform and navigation gizmos, apart from its overlays. */}
436
+ {stage === null ? null : (
437
+ <Tooltip text={`Gizmos: ${stage.showGizmos ? 'On' : 'Off'}`}>
438
+ <IconButton
439
+ aria-label="Toggle gizmos"
440
+ aria-pressed={stage.showGizmos}
441
+ size="comfortable"
442
+ onClick={() => stage.toggleGizmos()}
443
+ >
444
+ <EditorIcon icon={editorIcons.viewport.gizmos} size="md" />
445
+ </IconButton>
446
+ </Tooltip>
447
+ )}
433
448
  {/* THE EYE WAS THE OVERLAYS CONTROL ALL ALONG — measured by what it
434
449
  toggles, which is Grid and Bounds, exactly Blender's Show Overlays
435
450
  subject. It takes Blender's mark, and Blender's split toggle+chevron:
@@ -472,7 +472,7 @@ export function ViewportFurniture({
472
472
  header's view control and the Home and numpad-period keys, as Blender's is its View
473
473
  menu. The Camera button is not drawn yet: looking through a scene camera is not a
474
474
  view this stage has. */}
475
- {navigationControls ? (
475
+ {navigationControls && store.showGizmos ? (
476
476
  <div
477
477
  data-testid="viewport-navigation"
478
478
  role="toolbar"
@@ -3165,7 +3165,7 @@ export class EditorViewport {
3165
3165
  // same rationale as the per-notify `applyRootHiddenVisibility` above.
3166
3166
  if (hidden) policy.suppressRootEnvironment(this._scene);
3167
3167
  const gizmoEpoch = this._store.gizmoEpoch;
3168
- const gizmoSig = `${this._store.shell.showHelpers}|${JSON.stringify(vis)}|${hiddenRootId ?? ''}|${hidden}|${this._threejsToolContextActive}`;
3168
+ const gizmoSig = `${this._store.shell.showHelpers}|${this._store.shell.showGizmos}|${JSON.stringify(vis)}|${hiddenRootId ?? ''}|${hidden}|${this._threejsToolContextActive}`;
3169
3169
  const mapChanged = this._objectMap !== this._lastGizmoObjectMap;
3170
3170
  const settingsChanged = gizmoSig !== this._lastGizmoSig;
3171
3171
  const membershipChanges = mapChanged
@@ -3261,7 +3261,8 @@ export class EditorViewport {
3261
3261
  ? anyChannelWritable(selectedId)
3262
3262
  : (authoring.transforms?.editability?.(selectedId, activeTransformChannel).writable ?? true)
3263
3263
  : false;
3264
- if (selectedId && selectedTransformWritable) {
3264
+ // Blender's Show Gizmo off draws no transform gizmo, and the selection stays as it is.
3265
+ if (selectedId && selectedTransformWritable && this._store.shell.showGizmos) {
3265
3266
  if (!this._anyGizmoDragging()) {
3266
3267
  if (this._store.shell.pivotMode === 'median-point' && this._store.shell.selectedEntityIds.size > 1) {
3267
3268
  const median = new THREE.Vector3();
@@ -3982,6 +3983,7 @@ export class EditorViewport {
3982
3983
  renderViewCube(renderer: THREE.WebGLRenderer): void {
3983
3984
  if (!this._threeSurfaceShowing) return; // no three stage, no compass (Blender's is persistent on one)
3984
3985
  if (this._navigation === 'hidden') return;
3986
+ if (!this._store.shell.showGizmos) return; // the stage's Show Gizmo is off
3985
3987
  if (this._cameraView) return; // exact camera view owns the viewport
3986
3988
  const w = renderer.domElement.clientWidth;
3987
3989
  const h = renderer.domElement.clientHeight;
@@ -4859,6 +4861,7 @@ export class EditorViewport {
4859
4861
  private _isOverViewCube(clientX: number, clientY: number): boolean {
4860
4862
  // An indicator is only drawn, and a triad has nothing to click: clicks pass to the stage.
4861
4863
  if (this._navigation !== 'interactive' || this._gizmoLook.navigationForm === 'triad') return false;
4864
+ if (!this._store.shell.showGizmos) return false;
4862
4865
  const rect = this._canvas.getBoundingClientRect();
4863
4866
  const x = clientX - rect.left;
4864
4867
  const y = clientY - rect.top;