Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with code when trying to import model in blender #11

Closed
Jsavga opened this issue Dec 15, 2020 · 16 comments
Closed

Error with code when trying to import model in blender #11

Jsavga opened this issue Dec 15, 2020 · 16 comments

Comments

@Jsavga
Copy link

Jsavga commented Dec 15, 2020

Anytime I try to import a msfs model file into blender with this addon I get this error.

Screenshot (159)

@DOJ85
Copy link

DOJ85 commented Dec 20, 2020

Any workaround?
I have the same error, everything is freshly installed

@JackMcLeanGSY
Copy link

same

@JackMcLeanGSY
Copy link

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!

@7799799
Copy link

7799799 commented Jan 3, 2021

I tried to remove Blender from %appdata%, then fresh install Blender and fresh install plugins! But it still doesn't work

@Zordey
Copy link

Zordey commented Jan 3, 2021

I am getting the same error on Linux (Fedora 33) Blender 2.91, fresh install.

@7799799
Copy link

7799799 commented Jan 4, 2021

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

@Jannomag
Copy link

Jannomag commented Jan 4, 2021

Same error for me on Blender 2.82 and 2.91 (Windows 10). Also did a fresh install including removing the directory under %appdata%.

@Hamiltonoshane
Copy link

Try 2.90 but delete from appdata first before fresh install, it worked for me

@Jannomag
Copy link

Jannomag commented Jan 5, 2021

Nope, doesn't work. Tried in on a freshly installed 2.90 - same error.

@7799799
Copy link

7799799 commented Jan 6, 2021

不,不起作用。嘗試使用全新安裝的2.90-同樣的錯誤。

me too

@WeOkSim
Copy link

WeOkSim commented Jan 10, 2021

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

@davidbuckleyni
Copy link

Choose the experimental branch worked for me

@bestdani
Copy link
Owner

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.

@bestdani
Copy link
Owner

bestdani commented Jan 19, 2021

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.

@shidarin
Copy link

I can confirm that adding the [0] index as you quoted fixes the problem.

@bestdani bestdani closed this as completed Aug 6, 2021
@arsenikalbin
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests