In Blender Render I'm facing a problem with imported CityGML building models. I used the Rotterdam dataset available online and used this very good script from batFINGER to import XML files in Blender. The models are already textured.
This just works very well, the thing is that the way it use textures is quite messed up, and I can't figure out how to export that properly with textures to a game engine such as UE4.
The model use a bunch of texture images (around 300) that are all listed here:
When I select only one building and check its UV's, it is all over the place and the UV's are overlapping each other. For some reasons this seems wrong to me, but in view mode the model looks fine. I feel like each building from the model is using textures from different pictures.
I used ctrl+J to join everything, but when I look at the UV's it's even worse:
If I zoom I can see every single UV crossing each other:
Baking the textures seems very promising, but after few try outs my model turns white and the final picture stay black:
*note that I've tried that without unwrapping because I think the model is already "unwrapped" and anytime I try to unwrap it again it crashes.
I've tried many options, without any success:
- Unwrapping model causes crash
- Packing islands causes crash
- Baking the textures makes the final image black, or the model turns white
- Auto unwrap from texture atlas causes crash
- Exporting glTF doesn't export the textures embedded
Even if the UVs and textures looks messy the model is fine in the 3D view but there is no way I can export this properly with one single texture that I can use in my game engine.
The best would be to find a way to combine all theses different texture images into one single image witout losing the texture application, that I can easily import to UE4 (proper baking?). Or find a way to export the model as it is in the view mode, with embedded textures, without modifying anything in the UV editor. I guess there must be a way...
Any help would be much appreciated!