@volter/blender-engine 0.1.119 → 0.1.121

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/browser/worker.ts CHANGED
@@ -407,8 +407,15 @@ async function blenderIsServed(): Promise<{ available: boolean; missing: string[
407
407
  }
408
408
  }
409
409
 
410
- async function start(project: string, document?: string): Promise<unknown> {
410
+ /** The engine's filesystem is POSIX, so a Windows project root (`C:\Users\me\p`) is
411
+ * mounted at its URI path (`/C:/Users/me/p`); a POSIX root is its own mount. */
412
+ export function projectMount(project: string): string {
413
+ return /^[A-Za-z]:[\\/]/.test(project) ? `/${project.replaceAll('\\', '/')}` : project;
414
+ }
415
+
416
+ async function start(hostProject: string, document?: string): Promise<unknown> {
411
417
  if (session) throw new Error('The Blender session is already started');
418
+ const project = projectMount(hostProject);
412
419
  if (!project.startsWith('/'))
413
420
  throw new Error("The Blender session needs the project's absolute path");
414
421
  // The document is the project's own file and is named the project's own way.
@@ -473,7 +480,7 @@ async function projectIndex(project: string): Promise<ProjectFile[] | null> {
473
480
  return unreadable(String(error));
474
481
  }
475
482
  const { root, files } = payload;
476
- if (root !== project)
483
+ if (projectMount(root) !== project)
477
484
  say(
478
485
  `The editor serving this tab has ${root} open, not ${project}; its files ` +
479
486
  `are mounted at ${project}, which is where Python is looking.`,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@volter/blender-engine",
3
3
  "author": "Volter AI, Inc.",
4
4
  "license": "GPL-3.0-or-later",
5
- "version": "0.1.119",
5
+ "version": "0.1.121",
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },