You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I got error message in Blender4.3.
I fixed “view3d_mapviewer.py” according to the error message.
Fixed GIS is work success in my Blender.
I don't know how many people it will help, but I hope it will.
fixed code↓
def place(self):
'''Set map as background image'''
# Get or load bpy image
try:
self.img = [img for img in bpy.data.images if img.filepath == self.imgPath and len(img.packed_files) == 0][0]
except IndexError:
self.img = bpy.data.images.load(self.imgPath)
# Get or load background image
empties = [obj for obj in self.scn.objects if obj.type == 'EMPTY']
bkgs = [obj for obj in empties if obj.empty_display_type == 'IMAGE']
for bkg in bkgs:
bkg.hide_viewport = True
try:
self.bkg = [bkg for bkg in bkgs if bkg.data.filepath == self.imgPath and len(bkg.data.packed_files) == 0][0]
except IndexError:
self.bkg = bpy.data.objects.new(self.name, None) # None will create an empty
# Ensure correct context
bpy.context.collection.objects.link(self.bkg)
bpy.context.view_layer.objects.active = self.bkg
self.bkg.empty_display_type = 'IMAGE'
self.bkg.empty_image_depth = 'BACK'
self.bkg.data = self.img
else:
self.bkg.hide_viewport = False
# Get some image props
img_ox, img_oy = self.mosaic.center
img_w, img_h = self.mosaic.size
res = self.mosaic.pxSize.x
# Set background size
sizex = img_w * res / self.scale
sizey = img_h * res / self.scale
size = max([sizex, sizey])
self.bkg.empty_display_size = 1 # A size of 1 means image width=1bu
self.bkg.scale = (size, size, 1)
# Set background offset (image origin does not match scene origin)
dx = (self.crsx - img_ox) / self.scale
dy = (self.crsy - img_oy) / self.scale
self.bkg.location = (-dx, -dy, 0)
# Get 3d area's number of pixels and resulting size at the requested zoom level resolution
dst = max([self.area.width, self.area.height])
z = self.lockedZoom if self.lockedZoom is not None else self.zoom
res = self.tm.getRes(z)
dst = dst * res / self.scale
# Compute 3dview FOV and needed z distance
view3D_aperture = 36 # Blender constant (see source code)
view3D_zoom = 2 # Blender constant (see source code)
fov = 2 * math.atan(view3D_aperture / (self.view3d.lens * 2))
fov = math.atan(math.tan(fov / 2) * view3D_zoom) * 2
zdst = (dst / 2) / math.tan(fov / 2)
zdst = math.floor(zdst)
self.reg3d.view_distance = zdst
self.viewDstZ = zdst
# Update image drawing
self.img.reload()
Logs↓
INFO:BlenderGIS-master:92:###### Starting new Blender session : 2024-07-26 20:05:19
DEBUG:BlenderGIS-master.core.checkdeps:9:GDAL Python binding unavailable
DEBUG:BlenderGIS-master.core.checkdeps:20:PyProj unavailable
DEBUG:BlenderGIS-master.core.checkdeps:31:Pillow unavailable
DEBUG:BlenderGIS-master.core.checkdeps:46:ImageIO Freeimage plugin available
DEBUG:BlenderGIS-master.operators.view3d_mapviewer:201:Bounding box request : (-89620886.92380345, -72401153.19171895, 89620886.92380345, 72401153.19171895)
DEBUG:BlenderGIS-master.core.basemaps.mapservice:726:25 tiles requested, 0 already in cache, 25 remains to download
DEBUG:BlenderGIS-master.operators.view3d_mapviewer:201:Bounding box request : (-89620893.6647588, -72401146.33765973, 89620880.1828481, 72401160.04577817)
DEBUG:BlenderGIS-master.core.basemaps.mapservice:726:25 tiles requested, 0 already in cache, 25 remains to download
DEBUG:BlenderGIS-master.operators.view3d_mapviewer:201:Bounding box request : (-89620896.944754, -72401149.52717246, 89620876.9028529, 72401156.85626544)
DEBUG:BlenderGIS-master.core.basemaps.mapservice:726:25 tiles requested, 0 already in cache, 25 remains to download
DEBUG:BlenderGIS-master.core.basemaps.mapservice:580:http://mt0.google.com/vt/lyrs=s&x=0&y=0&z=0
ERROR:BlenderGIS-master:96:Uncaught exception
Traceback (most recent call last):
File "C:\Users{USERNAME}\AppData\Roaming\Blender Foundation\Blender\4.3\scripts\addons\BlenderGIS-master\operators\view3d_mapviewer.py", line 231, in place
self.bkg = [bkg for bkg in bkgs if bkg.data.filepath == self.imgPath and len(bkg.data.packed_files) == 0][0]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users{USERNAME}\AppData\Roaming\Blender Foundation\Blender\4.3\scripts\addons\BlenderGIS-master_init_.py", line 117, in run_with_except_hook
run_original(*args2, **kwargs2)
File "E:\blender-4.3.0-alpha+main.e30a1326a44c-windows.amd64-release\4.3\python\Lib\threading.py", line 982, in run
self._target(*self._args, **self._kwargs)
File "C:\Users{USERNAME}\AppData\Roaming\Blender Foundation\Blender\4.3\scripts\addons\BlenderGIS-master\operators\view3d_mapviewer.py", line 161, in run
self.place()
File "C:\Users{USERNAME}\AppData\Roaming\Blender Foundation\Blender\4.3\scripts\addons\BlenderGIS-master\operators\view3d_mapviewer.py", line 234, in place
self.bkg.empty_display_type = 'IMAGE'
The text was updated successfully, but these errors were encountered:
Blender4.3 Alpha
Windows11
Hi, I got error message in Blender4.3.
I fixed “view3d_mapviewer.py” according to the error message.
Fixed GIS is work success in my Blender.
I don't know how many people it will help, but I hope it will.
fixed code↓
Logs↓
INFO:BlenderGIS-master:92:###### Starting new Blender session : 2024-07-26 20:05:19
DEBUG:BlenderGIS-master.core.checkdeps:9:GDAL Python binding unavailable
DEBUG:BlenderGIS-master.core.checkdeps:20:PyProj unavailable
DEBUG:BlenderGIS-master.core.checkdeps:31:Pillow unavailable
DEBUG:BlenderGIS-master.core.checkdeps:46:ImageIO Freeimage plugin available
DEBUG:BlenderGIS-master.operators.view3d_mapviewer:201:Bounding box request : (-89620886.92380345, -72401153.19171895, 89620886.92380345, 72401153.19171895)
DEBUG:BlenderGIS-master.core.basemaps.mapservice:726:25 tiles requested, 0 already in cache, 25 remains to download
DEBUG:BlenderGIS-master.operators.view3d_mapviewer:201:Bounding box request : (-89620893.6647588, -72401146.33765973, 89620880.1828481, 72401160.04577817)
DEBUG:BlenderGIS-master.core.basemaps.mapservice:726:25 tiles requested, 0 already in cache, 25 remains to download
DEBUG:BlenderGIS-master.operators.view3d_mapviewer:201:Bounding box request : (-89620896.944754, -72401149.52717246, 89620876.9028529, 72401156.85626544)
DEBUG:BlenderGIS-master.core.basemaps.mapservice:726:25 tiles requested, 0 already in cache, 25 remains to download
DEBUG:BlenderGIS-master.core.basemaps.mapservice:580:http://mt0.google.com/vt/lyrs=s&x=0&y=0&z=0
ERROR:BlenderGIS-master:96:Uncaught exception
Traceback (most recent call last):
File "C:\Users{USERNAME}\AppData\Roaming\Blender Foundation\Blender\4.3\scripts\addons\BlenderGIS-master\operators\view3d_mapviewer.py", line 231, in place
self.bkg = [bkg for bkg in bkgs if bkg.data.filepath == self.imgPath and len(bkg.data.packed_files) == 0][0]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users{USERNAME}\AppData\Roaming\Blender Foundation\Blender\4.3\scripts\addons\BlenderGIS-master_init_.py", line 117, in run_with_except_hook
run_original(*args2, **kwargs2)
File "E:\blender-4.3.0-alpha+main.e30a1326a44c-windows.amd64-release\4.3\python\Lib\threading.py", line 982, in run
self._target(*self._args, **self._kwargs)
File "C:\Users{USERNAME}\AppData\Roaming\Blender Foundation\Blender\4.3\scripts\addons\BlenderGIS-master\operators\view3d_mapviewer.py", line 161, in run
self.place()
File "C:\Users{USERNAME}\AppData\Roaming\Blender Foundation\Blender\4.3\scripts\addons\BlenderGIS-master\operators\view3d_mapviewer.py", line 234, in place
self.bkg.empty_display_type = 'IMAGE'
The text was updated successfully, but these errors were encountered: