BlenderGIS icon indicating copy to clipboard operation
BlenderGIS copied to clipboard

M1 Mac Blender 2.93

Open Keeneori opened this issue 4 years ago • 6 comments

**I am using Blender 2.93 on M1 Mac **

**None of the basemap/elevation data will load. It just goes idle after attempting to add **

How to Reproduce

Error message

Keeneori avatar Jun 16 '21 14:06 Keeneori

I've got a similar problem on my M1 Mac and Blender 2.93.1 - but I got a window with the error messages pasted below. gdal is installed with MacPorts at /opt/local/lib - in the Mac's system path, but I'm not sure if the Python environment bundled in Blender is looking there. I loaded an OpenStreetMap export file to define the location.

The ~/.bgis directory contains two files -

bgis.log GOOGLE_SAT_WM.gpkg

Here is the relevant portion of bgis.log when attempting to download the elevation data -

DEBUG:BlenderGIS-master.operators.io_get_dem:103:https://portal.opentopography.org/API/globaldem?demtype=SRTMGL1&west=-92.96237460587611&east=-92.858273912316&south=35.091570302688545&north=35.13370518098602&outputFormat=GTiff ERROR:BlenderGIS-master:96:Uncaught exception Traceback (most recent call last): File "/Volumes/ExternalSSD/Users/dsward/Library/Application Support/Blender/2.93/scripts/addons/BlenderGIS-master/operators/io_import_georaster.py", line 387, in execute grid = bpyGeoRaster(filePath, subBoxGeo=subBox, clip=self.clip, fillNodata=self.fillNodata, useGDAL=HAS_GDAL, raw=True) File "/Volumes/ExternalSSD/Users/dsward/Library/Application Support/Blender/2.93/scripts/addons/BlenderGIS-master/operators/utils/georaster_utils.py", line 239, in init img = self.readAsNpArray() File "/Volumes/ExternalSSD/Users/dsward/Library/Application Support/Blender/2.93/scripts/addons/BlenderGIS-master/core/georaster/georaster.py", line 253, in readAsNpArray img = NpImage(self.path, subBoxPx=self.subBoxPx, noData=self.noData, georef=self.georef, adjustGeoref=True) File "/Volumes/ExternalSSD/Users/dsward/Library/Application Support/Blender/2.93/scripts/addons/BlenderGIS-master/core/georaster/npimg.py", line 127, in init self.data = self._npFromPath(data) File "/Volumes/ExternalSSD/Users/dsward/Library/Application Support/Blender/2.93/scripts/addons/BlenderGIS-master/core/georaster/npimg.py", line 227, in _npFromPath return self._npFromImgIO(path) File "/Volumes/ExternalSSD/Users/dsward/Library/Application Support/Blender/2.93/scripts/addons/BlenderGIS-master/core/georaster/npimg.py", line 258, in _npFromImgIO data = imageio.imread(img) File "/Volumes/ExternalSSD/Users/dsward/Library/Application Support/Blender/2.93/scripts/addons/BlenderGIS-master/core/lib/imageio/core/functions.py", line 181, in imread reader = read(uri, format, 'i', **kwargs) File "/Volumes/ExternalSSD/Users/dsward/Library/Application Support/Blender/2.93/scripts/addons/BlenderGIS-master/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' ERROR:BlenderGIS-master:96:Uncaught exception Traceback (most recent call last): File "/Volumes/ExternalSSD/Users/dsward/Library/Application Support/Blender/2.93/scripts/addons/BlenderGIS-master/operators/io_get_dem.py", line 140, in execute bpy.ops.importgis.georaster( File "/Applications/Blender.app/Contents/Resources/2.93/scripts/modules/bpy/ops.py", line 130, in call ret = _op_call(self.idname_py(), C_dict, kw, C_exec, C_undo) RuntimeError: Error: Python: Traceback (most recent call last): File "/Volumes/ExternalSSD/Users/dsward/Library/Application Support/Blender/2.93/scripts/addons/BlenderGIS-master/operators/io_import_georaster.py", line 387, in execute grid = bpyGeoRaster(filePath, subBoxGeo=subBox, clip=self.clip, fillNodata=self.fillNodata, useGDAL=HAS_GDAL, raw=True) File "/Volumes/ExternalSSD/Users/dsward/Library/Application Support/Blender/2.93/scripts/addons/BlenderGIS-master/operators/utils/georaster_utils.py", line 239, in init img = self.readAsNpArray() File "/Volumes/ExternalSSD/Users/dsward/Library/Application Support/Blender/2.93/scripts/addons/BlenderGIS-master/core/georaster/georaster.py", line 253, in readAsNpArray img = NpImage(self.path, subBoxPx=self.subBoxPx, noData=self.noData, georef=self.georef, adjustGeoref=True) File "/Volumes/ExternalSSD/Users/dsward/Library/Application Support/Blender/2.93/scripts/addons/BlenderGIS-master/core/georaster/npimg.py", line 127, in init self.data = self._npFromPath(data) File "/Volumes/ExternalSSD/Users/dsward/Library/Application Support/Blender/2.93/scripts/addons/BlenderGIS-master/core/georaster/npimg.py", line 227, in _npFromPath return self._npFromImgIO(path) File "/Volumes/ExternalSSD/Users/dsward/Library/Application Support/Blender/2.93/scripts/addons/BlenderGIS-master/core/georaster/npimg.py", line 258, in _npFromImgIO data = imageio.imread(img) File "/Volumes/ExternalSSD/Users/dsward/Library/Application Support/Blender/2.93/scripts/addons/BlenderGIS-master/core/lib/imageio/core/functions.py", line 181, in imread reader = read(uri, format, 'i', **kwargs) File "/Volumes/ExternalSSD/Users/dsward/Library/Application Support/Blender/2.93/scripts/addons/BlenderGIS-master/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'

location: /Applications/Blender.app/Contents/Resources/2.93/scripts/modules/bpy/ops.py:130

dsward2 avatar Jun 26 '21 09:06 dsward2

Apple released macOS Big Sur 11.5 today, and it seems to fix the problems with Basemap and Get Elevation in the BlenderGIS addon on the Apple Silicon M1 Mac.

UPDATE: Well, it worked for a while, then it reverted to the bug situation again. I'm trying to figure out a way to reset the app or the addon to restore the functions.

UPDATE 2: I've had no luck yet on restoring the BlenderGIS functions on my M1 Mac, but it seems like there should be a viable workaround or fix since it did work earlier today. I deleted some temporary files, but that did not help.

dsward2 avatar Jul 21 '21 18:07 dsward2

I have the same issues on my M1 MacBook pro under macOS 11.6. My blender version is 2.93.3.

This is what blender says when I'm trying to import google maps satellite data:

bpy.ops.view3d.map_start(dialog="MAP") Python: Traceback (most recent call last): File "/Users/user_name/Library/Application Support/Blender/2.93/scripts/addons/BlenderGIS-master/operators/view3d_mapviewer.py", line 792, in modal loc1 = mouseTo3d(context, self.x1, self.y1) File "/Applications/Blender.app/Contents/Resources/2.93/scripts/modules/bpy_types.py", line 728, in getattribute return super().getattribute(attr) AttributeError: 'VIEW3D_OT_map_viewer' object has no attribute 'x1'

location: :-1

somcsongor avatar Oct 08 '21 15:10 somcsongor

This seems to be an issue with BlenderGIS using FreeImage through imageIO, which only has an x86 library available.

I fixed this by installing the ARM version of FreeImage through MacPorts: https://ports.macports.org/port/freeimage/ and restarting Blender.

bvkNL avatar Nov 23 '21 19:11 bvkNL

I use Homebrew and it installs arm64 library under /opt/homebrew/Cellar/freeimage/3.18.0/lib/libfreeimage.dylib. It looks like there is a way to manually set the freeimage library via environment variable (https://github.com/domlysz/BlenderGIS/blob/master/core/lib/imageio/plugins/_freeimage.py#L45).

bash> IMAGEIO_FREEIMAGE_LIB=/opt/homebrew/Cellar/freeimage/3.18.0/lib/libfreeimage.dylib /Applications/Blender.app/Contents/MacOS/Blender

bchoi avatar Feb 04 '22 08:02 bchoi

The installation of FreeImage with MacPorts fixed the problem here, thanks for the info.

dsward2 avatar Feb 04 '22 18:02 dsward2