Closed vvoovv closed 1 year ago
The import in command line works without any errors. Any ideas?
Puuh, very difficult to guess, it happens in a very late state of the process. Is your current code available on GitHub, so that I might try to debug?
It's _streets_forgn branch.
GUI settings:
Please let me know if you can reproduce the problem.
It's streets_for_gn branch.
I don't get the same GUI. Did I miss some settings? The addon version shows 2.5.1 .
Try to check the option Enable experimental features at the bottom of the addon preferences.
Try to check the option Enable experimental features ...
That worked to get the GUI. Additionally, I had to install the latest assets. After selection of the osm-file and pressing 'Import', only the indicator (below) appears at the bottom of Blender. Nothing else happens, and the method do()
of StreetGenerator
does not get executed.
I'll try to install everything from scratch and check what else is required.
Download the file high_rise.pml.txt.
Remove the extension .txt
Copy it to the folder ADDON_ASSETS/default/style/building
Download the file asset_info.json.txt.
Remove the extension .txt
Copy it to the folder ADDON_ASSETS/default/asset_info
Nothing changed, same indicator x'collections' as above, and no message in console. Was I right before to download the assets from Gumroad, or are there others elsewhere?
Was I right before to download the assets from Gumroad? Yes.
- Download the file asset_info.json.txt.
The file above does contain 'collections' as it can be seen in its first line.
ADDON_ASSETS
is the folder you set here:
Right?
Yes.
What are the first few lines in the file C:\SpecialPrograms\blender-osm\assets\default\asset_info\asset_info.json
?
Sorry, was out for a moment. The first lines of this file are
{"collections": [
{
"assets": [
{
"category": "part",
"part": "level",
"class": "apartments_base",
"name": "pro_6908.png",
"type": "texture",
"path": "/default/textures/facades/appartments",
"cladding": 1,
"featureWidthM": 1.5,
"featureLpx": 185,
"featureRpx": 452,
"numTilesU": 3,
"numTilesV": 4
}
]
},
The file is the right one. The key "collections" is there. The error simply can't happen. Try restarting Blender.
Try restarting Blender.
This made it work! Now I get the error that you experienced for this issue. I will now try to find the reason. Thanks for your support!
There is an issue just after the beginning, where the border of the scene is determined for the clipper. In the two lines 165 and 166, these border limits get:
minX, minY = self.app.projection.fromGeographic(self.app.minLat, self.app.minLon)
maxX, maxY = self.app.projection.fromGeographic(self.app.maxLat, self.app.maxLon)
In the command line version, these are
while in Blender these become
At least the minY
value will clip out all way-segments.
There is an issue just after the beginning
I committed the fix.
To proceed:
prochitecture_carriageway_with_sidewalks.blend
to the folder BLOSM/assets
where BLOSM
is the top directory of the source treeThere is another error:
It seems that I still have a configuration issue:
File "C:\Users\Roger\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\blosm\__init__.py", line 299, in importOsm
a.render()
File "C:\Users\Roger\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\blosm\app\blender.py", line 436, in render
m.render()
File "C:\Users\Roger\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\blosm\building2\manager.py", line 15, in render
renderer.render(building, self.data)
File "C:\Users\Roger\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\blosm\building2\renderer.py", line 188, in render
action.do(building, buildingStyle, self)
File "C:\Users\Roger\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\blosm\action\volume\__init__.py", line 89, in do
self.generateVolume(footprint)
File "C:\Users\Roger\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\blosm\action\volume\__init__.py", line 96, in generateVolume
volumeGenerator.do(footprint)
File "C:\Users\Roger\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\blosm\action\volume\roof.py", line 85, in do
roofItem = self.init(footprint)
File "C:\Users\Roger\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\blosm\action\volume\roof.py", line 110, in init
return self.getRoofItem(footprint)
File "C:\Users\Roger\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\blosm\action\volume\roof_hipped.py", line 45, in getRoofItem
return ItemRoofHipped.getItem(self.itemFactory, footprint)
AttributeError: 'RoofHipped' object has no attribute 'itemFactory'
Strange, that I am getting the same error now and not getting the error from my previous message. I'll fix it.
It seems that I still have a configuration issue
I think, this is not true. Before I turned off Blender, I discovered that StreetGenerator
finished its work without any error. The ways are all already rendered, the problem must be with the buildings. Berlin seems to have an extreme number of streetlights :)
Yes, the problem is seemingly in my code.
I committed an number of fixes.
Quite often I am getting the error mentioned above: Maybe you can reproduce it.
Sometimes I am getting an error from my code. I will try to fix it.
Maybe you can reproduce it.
I was able to reproduce this error. It always appeared when I reimported from OSM, after a first import, without closing Blender. The reason was very strange and unexpected. I use the ID of way sections throughout the code for identification of them. It is built by the class variable NetSection.ID
in the class NetSection
, which is incremented for any new instance of this class. The same ID is then used in instances of the class WaySection
. I was not yet able to find where, but new instances of this class are built during the construction of way-clusters, their ID maybe based on the length of the container of way-sections and not of the actual ID's.
Anyway, what I didn't expect was, that the class variable NetSection.ID
sin't zero, when a new instance of StreetGenerator
is created and its method go()
is called. But I found, that it appears with the last value it had, before the last call of go()
ended. It seems that class variables are initialized only once, when their file is imported, and then never again.
I fixed the bug for now by an instruction NetSection.ID = 0
at the beginning of go()
, to get the state as I expected it. This fix is committed. There is still an error, but as I assume in your code.
Should the file _prochitecture_carriageway_withsidewalks.blend be added to assets in the branch? For now, I have put it in my .gitignore
file.
Should the file _prochitecture_carriageway_withsidewalks.blend be added to assets in the branch? For now, I have put it in my
.gitignore
file.
Not yet. It was a test GN-setup. I will create a new one.
I committed the fix that eliminated the problem.
The import in command line works without any errors.
Any ideas?