@volter/editor-live 0.5.93 → 0.5.95

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-live",
3
3
  "author": "Volter AI, Inc.",
4
- "version": "0.5.93",
4
+ "version": "0.5.95",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -30,8 +30,8 @@
30
30
  "node": ">=22"
31
31
  },
32
32
  "dependencies": {
33
- "@volter/editor-sdk": "0.5.93",
34
- "@volter/editor-project": "0.5.93",
33
+ "@volter/editor-sdk": "0.5.95",
34
+ "@volter/editor-project": "0.5.95",
35
35
  "undici": "^7.28.0"
36
36
  },
37
37
  "devDependencies": {
package/src/editor.ts CHANGED
@@ -10,6 +10,7 @@ import type {
10
10
  AssetPreviewSource,
11
11
  CaptureDimensions,
12
12
  DocumentLookOutcome,
13
+ StageFrameCostReading,
13
14
  EditorChromeCapture,
14
15
  EditorChromeCaptureOptions,
15
16
  EditorClient,
@@ -304,6 +305,17 @@ export class LiveEditor {
304
305
  return this.#client.turntableDocument(options);
305
306
  }
306
307
 
308
+ /**
309
+ * What a frame of the open 3D document's stage costs when nothing caps it: `frames` of the
310
+ * stage's own frame back to back, each waited out on the GPU (median, p95, min ms), the canvas
311
+ * with its device pixel ratio, what was drawn after culling against what the scene holds, and
312
+ * the draw mode. `stage` names another stage by its id (a split's second area,
313
+ * `<documentId>#area-2`).
314
+ */
315
+ async frameCost(options?: { readonly frames?: number; readonly stage?: string }): Promise<StageFrameCostReading> {
316
+ return this.#client.frameCostDocument(options);
317
+ }
318
+
307
319
  async view(preset: ViewPreset): Promise<void> {
308
320
  await this.#client.viewPreset(preset);
309
321
  }
@@ -387,6 +399,12 @@ export class LiveEditor {
387
399
 
388
400
  /** `kind` inferred from `path`'s extension when omitted (`inferAssetKind`) — pass it explicitly to override. */
389
401
  async openAsset(path: string, kind?: AssetKind): Promise<void> {
402
+ // A `.blend` is not an asset but a Model document the project's finder lists; opened as an
403
+ // asset it fell to the extension guess's `json` and showed its bytes.
404
+ if (kind === undefined && path.toLowerCase().endsWith('.blend'))
405
+ throw new Error(
406
+ `${path} is a Blender Model document, not an asset: open it with editor.open("document:model:${path}").`,
407
+ );
390
408
  await this.#client.openAsset(path, kind ?? inferAssetKind(path));
391
409
  }
392
410