elia-orsini / BlenderWebViewer

a Web Viewer for Blender.
MIT License
59 stars 2 forks source link

File Not Found error in the BlenderWebViewer.py file after clicking on the export button #2

Open knightcube opened 2 years ago

knightcube commented 2 years ago

Clicking on the export button throws this "File Not Found" error.

Python: Traceback (most recent call last):
  File "Blender Foundation\Blender\3.0\scripts\addons\BlenderWebViewer.py", line 108, in execute
    export_gltf(apply_modifiers, path)

File "Blender Foundation\Blender\3.0\scripts\addons\BlenderWebViewer.py", line 21, in export_gltf
    bpy.ops.export_scene.gltf(filepath=path, export_format='GLB', use_selection=True, export_apply=apply_modifiers, export_lights=True, export_cameras=True)

File "Blender Foundation\Blender 3.0\3.0\scripts\modules\bpy\ops.py", line 132, in __call__
    ret = _op_call(self.idname_py(), None, kw)
RuntimeError: Error: Python: Traceback (most recent call last):

File "Blender Foundation\Blender 3.0\3.0\scripts\addons\io_scene_gltf2\__init__.py", line 637, in execute
    return gltf2_blender_export.save(context, export_settings)

File "Blender Foundation\Blender 3.0\3.0\scripts\addons\io_scene_gltf2\blender\exp\gltf2_blender_export.py", line 51, in save
    __write_file(json, buffer, export_settings)

File "Blender Foundation\Blender 3.0\3.0\scripts\addons\io_scene_gltf2\blender\exp\gltf2_blender_export.py", line 142, in __write_file
    gltf2_io_export.save_gltf(

File "..\blender\exp\gltf2_io_export.py", line 80, in save_gltf
    file = open(export_settings['gltf_filepath'], "wb")

FileNotFoundError: [Errno 2] No such file or directory: 'F:\\Blender Add ons\\BlenderWebViewer\\public\\scene.glb'

location: Blender Foundation\Blender 3.0\3.0\scripts\modules\bpy\ops.py:132

location: <unknown location>:-1

Also, running npm run dependencies gave this error👇

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: gltfjsx@4.6.3
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR!   react@"^17.0.0" from the root project
npm ERR!   peer react@"^16.8.0  || >=17.0.0 || >=18.0.0" from @react-spring/web@
9.4.5
npm ERR!   node_modules/@react-spring/web
npm ERR!     @react-spring/web@"^9.2.4" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^18.1.0" from react-dom@18.1.0
npm ERR! node_modules/react-dom
npm ERR!   peer react-dom@"^16.8.0  || >=17.0.0 || >=18.0.0" from @react-spring/
web@9.4.5
npm ERR!   node_modules/@react-spring/web
npm ERR!     @react-spring/web@"^9.2.4" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

So I tried running npm run dependencies --legacy-peer-deps and it compiled successfully but showed "1 high severity vulnerability"

elia-orsini commented 2 years ago

@knightcube I am familiar with the first error. sometimes it happens that the path selected is not absolute and it throws an error. I need to look into it. It can easily be fixed by pasting the absolute url manually. I will also take a look at the dependencies. thanks for reporting those bugs.

knightcube commented 2 years ago

@elia-orsini I actually tried pasting the absolute URL manually too but unfortunately, it still shows the same error. I also tried removing the spaces between the characters. This is the URL that I am using - F:\BlenderAddons\BlenderWebViewer\