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
Crash on calculating random building heights when using non-integer like number (0.5, 0.3, etc.) instead of (1, 5, 42, etc.)
How to Reproduce
Select a piece of map
Try to get OSM data with provided settings:
Error message
Because of the non-integer value of the random height, random.randint() fails because they get resulted into floats:
Python: Traceback (most recent call last):
File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\python\lib\random.py", line 303, in randrange
istart = _index(start)
TypeError: 'float' object cannot be interpreted as an integer
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\JKCTech\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\BlenderGIS-master\operators\io_import_osm.py", line 681, in execute
self.build(context, result, geoscn.crs)
File "C:\Users\JKCTech\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\BlenderGIS-master\operators\io_import_osm.py", line 443, in build
seed(way.id, way.tags, pts)
File "C:\Users\JKCTech\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\BlenderGIS-master\operators\io_import_osm.py", line 287, in seed
offset = random.randint(minH, maxH)
File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\python\lib\random.py", line 370, in randint
return self.randrange(a, b+1)
File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\python\lib\random.py", line 309, in randrange
raise ValueError("non-integer arg 1 for randrange()")
ValueError: non-integer arg 1 for randrange()
Managed to quickly fix it by manually casting the resulted values to an integer:
offset=random.randint(int(minH), int(maxH))
at line 287 of operators/io_import_osm.py
The text was updated successfully, but these errors were encountered:
Blender and OS versions
Windows 11
Blender 3.6.5
Describe the bug
Crash on calculating random building heights when using non-integer like number (0.5, 0.3, etc.) instead of (1, 5, 42, etc.)
How to Reproduce
Select a piece of map
Try to get OSM data with provided settings:
Error message
Because of the non-integer value of the random height,
random.randint()
fails because they get resulted into floats:Managed to quickly fix it by manually casting the resulted values to an integer:
at line 287 of
operators/io_import_osm.py
The text was updated successfully, but these errors were encountered: