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

[MAC] Addon immediately throws exception in Blender 4 #851

Closed
hot-portafilter opened this issue Jan 2, 2024 · 3 comments
Closed

[MAC] Addon immediately throws exception in Blender 4 #851

hot-portafilter opened this issue Jan 2, 2024 · 3 comments
Labels

Comments

@hot-portafilter
Copy link

hot-portafilter commented Jan 2, 2024

Blender and OS versions

  • Blender 4.0.2
  • MacOS Sonoma 14.2.1

Describe the bug

Blender UI locks up and ~/.bgis/bgis.log shows an error.

GIS > Web geodata > Basemap, Ok with defaults (Google & Satellite)

In ~/.bgis/bgis.log:

DEBUG:BlenderGIS-228.core.basemaps.mapservice:726:77 tiles requested, 0 already in cache, 77 remains to download
DEBUG:BlenderGIS-228.core.basemaps.mapservice:580:http://mt0.google.com/vt/lyrs=s&x=0&y=0&z=0
ERROR:BlenderGIS-228.core.basemaps.mapservice:885:Corrupted tile on cache
...
File "/Users/{user}/Library/Application Support/Blender/4.0/scripts/addons/BlenderGIS-228/core/lib/imageio/core/functions.py", line 107, in get_reader
raise ValueError('Could not find a format to read the specified file '
ValueError: Could not find a format to read the specified file in mode 'i'

Full error log and tile file in attached zip. I tried deleting the cache but same error reoccurs systematically.
fail.zip

@ssgraham767
Copy link

ssgraham767 commented Jan 3, 2024

@hot-portafilter & @domlysz

Its a bit clunky but I have managed to fix this (on OSX) with a couple changes. The issue is that there is no freeimage support for ARM architectures from the source provided in the FAQ. However, homebrew has a version that works.

So...

  1. Run brew install freeimage
  2. brew list freeimage to locate the installed files.
  3. Copy the appropriate dylib into your freeimage folder. In my case, I put libfreeimage.3.18.0.dylib into /Users/yourUserHere/Library/Application Support/Blender/3.6/scripts/addons/BlenderGIS-master/core/lib/imageio/resources/freeimage (add the freeimage directory if it does not yet exist)
  4. Open /Users/yourUserHere/Library/Application Support/Blender/3.6/scripts/addons/BlenderGIS-master/core/lib/imageio/plugins/_freeimage.py in a code editor
  5. Edit lines 31-38 to match the following:
FNAME_PER_PLATFORM = {
    'osx32': 'libfreeimage.3.18.0.dylib',  # universal library
    'osx64': 'libfreeimage.3.18.0.dylib',
    'win32': 'FreeImage-3.15.4-win32.dll',
    'win64': 'FreeImage-3.15.1-win64.dll',
    'linux32': 'libfreeimage-3.16.0-linux32.so',
    'linux64': 'libfreeimage-3.16.0-linux64.so',
}

You probably only need to alter the pointer for osx64. I just did both to be sure. Make it match the name of your copied dylib file (in my case, libfreeimage.3.18.0.dylib).

For me, Blender's buttons don't work while navigating the map. So, use command++ to zoom, and e to select an area. After doing so, your buttons should work again—or at least they do for me. Now, hopefully, you can proceed.

Hope this helps!

EDIT: I have added a partial fix in pull request #852
It has a slightly cleaner fix than the one shown above. Assuming you are on mac, you can download the arm64-freeimage-support branch on my fork (https://github.com/ssgraham767/BlenderGIS/tree/arm64-freeimage-support) and this should work for you without having to do the steps above.

@frankievx
Copy link

You're a legend! Thank you, this fixed my issue on my M2 Macbook Pro Sonoma 14.1.1! I installed using the branch on your fork

@domlysz domlysz changed the title Addon immediately throws exception in Blender 4 [MAC] Addon immediately throws exception in Blender 4 May 3, 2024
@domlysz domlysz added the mac label May 3, 2024
@domlysz
Copy link
Owner

domlysz commented May 7, 2024

@domlysz domlysz closed this as completed May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants