@volter/editor-blender 0.1.153 → 0.1.154

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.
@@ -21,7 +21,7 @@ import type {
21
21
  import type * as THREE from 'three';
22
22
  import { threeObject } from '@volter/editor-threejs/adapter/three-contract';
23
23
  import { viewportStages } from '@volter/editor-threejs/viewport-door';
24
- import { blenderExecute, blenderRnaSet, beginBlenderGesture, endBlenderGesture } from '../host/blender-runtime-host';
24
+ import { blenderExecute, blenderRnaSet, blenderSelectionSet, beginBlenderGesture, endBlenderGesture } from '../host/blender-runtime-host';
25
25
  import {
26
26
  blenderEngineSelection,
27
27
  blenderOutlinerState,
@@ -798,28 +798,13 @@ async function runBlenderOperator(
798
798
  }
799
799
 
800
800
 
801
- async function writeBlenderSelection(
802
- names: readonly string[],
803
- active: string | null,
804
- ): Promise<void> {
805
- const body = [
806
- `_sel = {${names.map(py).join(', ')}}`,
807
- '_vl = bpy.context.view_layer',
808
- 'for _o in _vl.objects:',
809
- ' _o.select_set(_o.name in _sel)',
810
- // object_select.cc::base_deselect_all_ex changes BASE_SELECTED without
811
- // clearing the active base. Properties continues to inspect that object.
812
- ...(active === null ? [] : [`_vl.objects.active = bpy.data.objects.get(${py(active)})`]),
813
- ].join('\n');
814
- const answer = await blenderExecute(body, false);
815
- // THE ENGINE'S REFUSAL, VERBATIM — never a shrug. A selection that did not
816
- // land is the difference between the Properties rail showing this object and
817
- // showing the last one, so it is said out loud on the editor's console.
818
- if (answer.error !== null)
819
- editorHost().console.error(
820
- `Blender refused the selection write: ${answer.error}`,
821
- 'blender-outliner',
822
- );
801
+ /** Blender's selection set to the editor's (`session.py::selection_set`), written only where the two differ:
802
+ * selection is saved in the .blend, so a write that matches what Blender holds would ask for a save of nothing.
803
+ * A null `active` leaves the active object as it is (`object_select.cc::base_deselect_all_ex` changes
804
+ * BASE_SELECTED without clearing the active base), so Properties keeps inspecting it. A refusal rejects, and the
805
+ * caller says it on the editor's console. */
806
+ async function writeBlenderSelection(names: readonly string[], active: string | null): Promise<void> {
807
+ await blenderSelectionSet(names, active);
823
808
  }
824
809
 
825
810
  /**
@@ -1140,6 +1140,13 @@ export async function blenderOutlinerSet(
1140
1140
  return written;
1141
1141
  }
1142
1142
 
1143
+ /** The editor's selection into Blender's view layer (`session.py`'s `selection_set`): written,
1144
+ * saved and presented only when it differs from what Blender holds. */
1145
+ export async function blenderSelectionSet(names: readonly string[], active: string | null): Promise<void> {
1146
+ const { changed } = await blenderRuntime().selectionSet(names, active);
1147
+ if (changed) noteBlenderRnaChanged();
1148
+ }
1149
+
1143
1150
  /** Node-view actions share driveNodeView between page commands and the session relay. State reads, focus, framing, zoom and pan update inspection state; editing gestures refuse by name. */
1144
1151
  export const NODE_VIEW_VERBS: readonly ViewVerb[] = (['state', 'look', 'view-all', 'zoom', 'pan', 'move', 'link', 'set-value', 'use-nodes', 'collapse-panel'] as const).map((id) => ({
1145
1152
  id,
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publisher": "volter",
4
4
  "author": "Volter AI, Inc.",
5
5
  "license": "AGPL-3.0-only AND GPL-3.0-or-later",
6
- "version": "0.1.153",
6
+ "version": "0.1.154",
7
7
  "engines": {
8
8
  "vscode": "*"
9
9
  },
@@ -1245,17 +1245,17 @@
1245
1245
  }
1246
1246
  },
1247
1247
  "dependencies": {
1248
- "@volter/editor-movie": "0.5.214",
1248
+ "@volter/editor-movie": "0.5.215",
1249
1249
  "@modelcontextprotocol/sdk": "1.32.1",
1250
- "@volter/blender-engine": "0.1.151",
1251
- "@volter/editor-threejs": "0.5.214",
1250
+ "@volter/blender-engine": "0.1.152",
1251
+ "@volter/editor-threejs": "0.5.215",
1252
1252
  "zod": "^4.3.6",
1253
1253
  "@fortawesome/free-solid-svg-icons": "^7.2.0"
1254
1254
  },
1255
1255
  "peerDependencies": {
1256
- "@volter/live": "0.5.214",
1257
- "@volter/project": "0.5.214",
1258
- "@volter/sdk": "0.5.214",
1256
+ "@volter/live": "0.5.215",
1257
+ "@volter/project": "0.5.215",
1258
+ "@volter/sdk": "0.5.215",
1259
1259
  "react": "^19.0.0",
1260
1260
  "react-dom": "^19.0.0",
1261
1261
  "three": "^0.186.1",