BlenderGIS icon indicating copy to clipboard operation
BlenderGIS copied to clipboard

[MacOS] Basemap does not load

Open kaichi0521 opened this issue 2 years ago • 18 comments

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

kaichi0521 avatar Apr 11 '22 12:04 kaichi0521

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 avatar Apr 13 '22 16:04 wittywit

Update

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

image

wittywit avatar Apr 13 '22 16:04 wittywit

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.

Skytale23 avatar Apr 23 '22 18:04 Skytale23

For OpenTopography SRTM error you should do the following :

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

  • Create an account at: https://portal.opentopography.org/

  • Generate a new API: Go to https://portal.opentopography.org/lidarAuthorizationInfo and select or create a new API key

  • Replace your API Key in the following URL: https://portal.opentopography.org/API/globaldem?demtype=SRTMGL1&west={W}&east={E}&south={S}&north={N}&outputFormat=GTiff&API_Key= [YOUR API KEY ]

  • Replace this URL in blender addon settings: Screenshot 2022-04-24 at 12 37 49 AM

wittywit avatar Apr 23 '22 19:04 wittywit

@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.

Timotheus747 avatar May 13 '22 03:05 Timotheus747

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.

aplr avatar Jul 28 '22 01:07 aplr

that works, thanks @aplr

sbusso avatar Aug 21 '22 11:08 sbusso

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

danielhamilton avatar Sep 08 '22 01:09 danielhamilton

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

liurenjie avatar Sep 09 '22 03:09 liurenjie

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

tabrs avatar Sep 25 '22 12:09 tabrs

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

leonitousconforti avatar Apr 26 '23 21:04 leonitousconforti

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

stabelchod avatar Jul 07 '23 09:07 stabelchod

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

the-mitacek avatar Jul 11 '23 20:07 the-mitacek

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.

vavdav avatar Aug 13 '23 13:08 vavdav

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

multitudes avatar Aug 14 '23 09:08 multitudes

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

vvrakking avatar Jan 08 '24 00:01 vvrakking