@volter/editor-blender 0.1.69 → 0.1.71

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.
@@ -376,6 +376,7 @@ function BlenderViewportArea({
376
376
  const build = useCallback(
377
377
  () => ({
378
378
  root: view.root,
379
+ prepareDraw: (camera: THREE.Camera) => view.prepareDraw(camera),
379
380
  // What the view draws changes with each frame and the work after it,
380
381
  // and with the skin's poses when the Timeline scrubs.
381
382
  onChange(listener: () => void) {
@@ -51,6 +51,8 @@ const verb = (derivedRefresh: CommandDerivedRefresh, timeoutMs?: number): Comman
51
51
  });
52
52
 
53
53
  export const commands: CommandContribution['commands'] = {
54
+ // Presentation-only comparison, no engine mutation or derived frame refresh.
55
+ 'blender-draw-batching': verb('none'),
54
56
  'blender-start': verb('none', 120_000),
55
57
  // Stop drains accepted modeling work and persists it before teardown.
56
58
  'blender-stop': verb('none', 30 * 60_000),
@@ -731,6 +731,8 @@ interface RuntimeView {
731
731
  stageFrame(part: { session: string; revision: number; abort?: boolean; mesh?: string; image?: string; piece?: unknown }): void;
732
732
  applyFrame(frame: unknown): unknown;
733
733
  snapshot(): ReturnType<BlenderRuntimeView['snapshot']>;
734
+ drawStatistics(): ReturnType<BlenderRuntimeView['drawStatistics']>;
735
+ setDrawBatching(enabled: boolean): void;
734
736
  /** Own a detached revision for render lighting, never the interactive view. */
735
737
  captureSnapshot(): ReturnType<BlenderRuntimeView['captureSnapshot']>;
736
738
  /** Keep the description of the frame just applied, and the two poses of every
@@ -1146,6 +1148,13 @@ export async function handleBlenderCommand(cmd: {
1146
1148
  [key: string]: unknown;
1147
1149
  }): Promise<EditorCommandResult> {
1148
1150
  const host = editorHost();
1151
+ if (cmd.type === 'blender-draw-batching') {
1152
+ if (typeof cmd['enabled'] !== 'boolean') return {ok: false, error: 'blender-draw-batching requires boolean enabled'};
1153
+ if (!runtime?.project || !host.session.open()) return {ok: false, error: 'Open a Blender document before changing draw batching'};
1154
+ const view = await runtimeView();
1155
+ view.setDrawBatching(cmd['enabled']);
1156
+ return {ok: true, data: {instancing: view.drawStatistics()}};
1157
+ }
1149
1158
  // A read of this tab, answered ABOVE `blenderRuntime()` because that call
1150
1159
  // spawns the worker: this is the one Blender command that must not create
1151
1160
  // the session it is asked about. A caller uses it to find out whether the
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@volter/editor-blender",
3
3
  "author": "Volter AI, Inc.",
4
4
  "license": "AGPL-3.0-only AND GPL-3.0-or-later",
5
- "version": "0.1.69",
5
+ "version": "0.1.71",
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },
@@ -70,14 +70,14 @@
70
70
  },
71
71
  "dependencies": {
72
72
  "@modelcontextprotocol/sdk": "1.30.0",
73
- "@volter/blender-engine": "0.1.67",
74
- "@volter/editor-threejs": "0.5.129",
73
+ "@volter/blender-engine": "0.1.69",
74
+ "@volter/editor-threejs": "0.5.131",
75
75
  "zod": "^4.3.6"
76
76
  },
77
77
  "peerDependencies": {
78
- "@volter/editor-live": "0.5.129",
79
- "@volter/editor-project": "0.5.129",
80
- "@volter/editor-sdk": "0.5.129",
78
+ "@volter/editor-live": "0.5.131",
79
+ "@volter/editor-project": "0.5.131",
80
+ "@volter/editor-sdk": "0.5.131",
81
81
  "react": "^19.0.0",
82
82
  "react-dom": "^19.0.0",
83
83
  "three": "^0.180.0",