domlysz / BlenderGIS

Blender addons to make the bridge between Blender and geographic data
GNU General Public License v3.0
7.61k stars 1.34k forks source link

[MacOS] Basemap does not load #655

Open kaichi0521 opened 2 years ago

kaichi0521 commented 2 years ago
macOS Monterey 12.3.1 # **Blender and OS versions** Blender 3.1.2 (relased on 4.1.2022) # **Describe the bug** I can't load the basemap. More specifically, I added and installed GIS zip file correctly. However, google map did not show up. # **How to Reproduce**

Error message

wittywit commented 2 years ago

Blender and OS versions

macOS Monterey 12.3.1 MacBook Pro M1 14 inch Blender 3.0.0

Describe the bug

I have the same issue I have installed the addon. The cache folder also has a GOOGLE_SAT_WM.gpkg file. But no map loads from basemap option. I even waited for 10 minutes still nothing. Downgrading the blender to 2.93 LTS also same result it did not work at all.

image

How to Reproduce

I believe just use any mac. maybe a mac specific bug.

Error message

no error messages popup.

wittywit commented 2 years ago

Update

I downgraded the Blender even further to 2.83 LTS and the addon now works it showcases the map.

image
Skytale23 commented 2 years ago

macOS Monterey 12.3.1 M1 mini (M1, 2020)

Similar issue - using Blender 2.93, 3.0 and 3.1 all for Apple Silicon: basemap not loading, Blender frozen - force quit to exit.

Solution to the freeze: Downloaded Blender 3.1.2 for Intel, installed Addon, selected area, E key downloaded map to plane, then GIS-Webgeo Data-Get Elevation (SRTM)-Server: Marine Geo.org - worked.

Other servers ie OpenTopography SRTM returned error.

wittywit commented 2 years ago

For OpenTopography SRTM error you should do the following :

The solution was also discussed here: https://github.com/domlysz/BlenderGIS/issues/619

Timotheus747 commented 2 years ago

@Skytale23 You got it to work in 3.1? I couldn't get it to show the map, so downgraded to 3.0 and it worked fine.

aplr commented 2 years ago

TL;DR

imageio lib is outdated, temp. workaround:

brew install freeimage
launchctl setenv IMAGEIO_FREEIMAGE_LIB /opt/homebrew/Cellar/freeimage/3.18.0/lib/libfreeimage.dylib

running on macOS 12.3, blender 3.2.1, blendergis 2.2.8

cheers.

Long story

So, I dug in a bit and found, that the error message was a symptom, but not the root cause. The original error was shadowed, and is thrown in thrown here. This error simply means: “The freeimage library could not be loaded.” So, the imageio library can't find the freeimage library it depends upon. Also, it can't download the library, as the version of freeimage is outdated and does not know about the existence of an arm macos. So even if you have installed freeimage on your system, imageio won’t find it.

So, what can we do? Luckily, I found this block of code, which gave hope.

# Add the path specified with IMAGEIO_FREEIMAGE_LIB:
lib = os.getenv('IMAGEIO_FREEIMAGE_LIB', None)
if lib is not None:
    exact_lib_names.insert(0, lib)

I installed the freeimage library using brew install freeimage, there’s an arm build also.

Then, setting the env var in the terminal and starting blender did the job (yay 🥳). It’s not the most convenient solution, as you always have to start blender from the terminal or some custom script, even if you set the env var in ~/.zshrc or something.

Fortunately, you can set env vars for gui applications with launchctl, so it’s as easy as running the following:

launchctl setenv IMAGEIO_FREEIMAGE_LIB /opt/homebrew/Cellar/freeimage/3.18.0/lib/libfreeimage.dylib

Just make sure you’re entering the correct version, it was 3.18.0 at the time of writing.

cheers again.

sbusso commented 2 years ago

that works, thanks @aplr

danielhamilton commented 2 years ago

Thanks, @aplr. Can confirm that it also works on MacOS 12.5.1, Blender 3.3.0, BlenderGIS 2.2.8

liurenjie commented 1 year ago

launchctl setenv IMAGEIO_FREEIMAGE_LIB ... The environment-variables setting will out of work after the MacOS reboot.

tabrs commented 1 year ago

Thenks a lot! Helped Mac M1 Pro, MacOS 12.7, Blender 3.3

TL;DR

imageio lib is outdated, temp. workaround:

brew install freeimage
launchctl setenv IMAGEIO_FREEIMAGE_LIB /opt/homebrew/Cellar/freeimage/3.18.0/lib/libfreeimage.dylib

running on macOS 12.3, blender 3.2.1, blendergis 2.2.8

leonitousconforti commented 1 year ago

Thank you @aplr! Still works perfectly on macos 13.0, Blender 3.5.1, BlenderGIS 2.2.8

stabelchod commented 1 year ago

Working also on Blender 3.6 for Apple Silicon. Thanks!

brew install freeimage launchctl setenv IMAGEIO_FREEIMAGE_LIB /opt/homebrew/Cellar/freeimage/3.18.0/lib/libfreeimage.dylib

the-mitacek commented 1 year ago

Hi, can anyone help, how to use this hack? GIS not working on my M1 MacOS 13.4, Blender 3.6.0

Thanks!

brew install freeimage launchctl setenv IMAGEIO_FREEIMAGE_LIB /opt/homebrew/Cellar/freeimage/3.18.0/lib/libfreeimage.dylib

vavdav commented 1 year ago

Hi, can anyone help, how to use this hack? GIS not working on my M1 MacOS 13.4, Blender 3.6.0

Thanks!

brew install freeimage launchctl setenv IMAGEIO_FREEIMAGE_LIB /opt/homebrew/Cellar/freeimage/3.18.0/lib/libfreeimage.dylib

you just need terminal and homebrew (package installer) https://brew.sh/

Then just run those commands. You have to check that /opt/homebrew/Cellar/freeimage/3.18.0/lib/libfreeimage.dylib path exists. It could be different version.

multitudes commented 1 year ago

AlsoI I had to check my environment to make it work..and sometimes launching blender from the terminal produced different results!

vvrakking commented 8 months ago

Worked for me on Mac Studio - MacOS 14.2.1, Blender 4.0.2. with BlenderGIS 2.2.8. Thank you very much! Cheerio!

airbag00 commented 4 months ago

This worked for me! blender 4.1 on a M1 mac mini running macos Sonoma 14.0. Thank you very much!!

nurlopez commented 4 months ago

@aplr amazing and thank you! 🙌

This workaround worked smoothly for me: M1 MacOS 14.1.1 and Blender 4.1.1 🎉

k05yra commented 2 weeks ago

I've installed both homebrew and freeimage on my macOS 14.2.1, ensuring that the paths are correct. I'm running Blender 4.2.1 with a topography API key. However, whenever I load a basemap, all I see is what's pictured below. Sometimes, the entire application freezes and crashes. Any advice on how to fix this?

Screenshot 2024-08-21 at 4 13 05 AM