Error with code when trying to import model in blender
Closed this issue · 16 comments
Any workaround?
I have the same error, everything is freshly installed
same
Any workaround?
I have the same error, everything is freshly installed
if you delete blender from %appdata% and fresh install of blender and fresh install of the addon! should work as it did for me!
I tried to remove Blender from %appdata%, then fresh install Blender and fresh install plugins! But it still doesn't work
I am getting the same error on Linux (Fedora 33) Blender 2.91, fresh install.
Python: Traceback (most recent call last):
File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_msfs_gltf.py", line 330, in execute
return import_msfs_gltf(context, self.filepath, self.report)
File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_msfs_gltf.py", line 301, in import_msfs_gltf
gltf, buffer = load_gltf_file(gltf_file)
File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_msfs_gltf.py", line 259, in load_gltf_file
bin_file_name = gltf_file_path.with_name(gltf['buffers']['uri'])
TypeError: list indices must be integers or slices, not str
location: :-1
Same error for me on Blender 2.82 and 2.91 (Windows 10). Also did a fresh install including removing the directory under %appdata%.
Try 2.90 but delete from appdata first before fresh install, it worked for me
Nope, doesn't work. Tried in on a freshly installed 2.90 - same error.
不,不起作用。嘗試使用全新安裝的2.90-同樣的錯誤。
me too
For everyone experiencing this problem of complete error at import - try experimental branch - it worked for me, even without compolete reinstalling.
I removed main plugin completely (via Blender menu)
My blender looks like installed in vanilla location, maybe this is important
Choose the experimental branch worked for me
Hello, unfortunately I currently have no MSFS subscription anymore due to lack of time for using it and therefore I cannot test it myself, but it seems that the latest blender updates introduced some API changes that lead to incompatibilities, therefore use the experimental branch.
Some information in the MSFS Forums stated that line 259 has to be changed to: bin_file_name = gltf_file_path.with_name(gltf['buffers'][0]['uri'])
(note the array index 0 that appears there).
Does this mean the file formats have changed? Does this apply to all or just some models? If someone who was able to test it could make a PR (in the master branch, the experimental branch gets the bin file name by assuming it is the same as the glTF file name) I would be happy to accept it.
I can confirm that adding the [0]
index as you quoted fixes the problem.
Some information in the MSFS Forums stated that line 259 has to be changed to:
bin_file_name = gltf_file_path.with_name(gltf['buffers'][0]['uri'])
(note the array index 0 that appears there).Does this mean the file formats have changed? Does this apply to all or just some models? If someone who was able to test it could make a PR (in the master branch, the experimental branch gets the bin file name by assuming it is the same as the glTF file name) I would be happy to accept it.
Which file?