0
$\begingroup$

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.

textured model of Bloemhof

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!

$\endgroup$
2
  • $\begingroup$ You could use the "baking highpoly to lowpoly" method to bake individual buildings. Create a copy of that building, fix the UVs of that copy, then create a new texture, select the original, then shift-select the copy and check "Selected to active" in the Bake settings. $\endgroup$ Commented May 14, 2019 at 18:29
  • $\begingroup$ Thanks for your reply, but whenever I try this my model still turns white. Note that I can only see these textures in the texture mode of the viewport. Also there is no material nor texture in the tabs on the right pane. I think that's why it doesn't work, I feel like the script I used to import didn't created the materials I need, but applying the textures through the UV editor, that's weird... What can I do? $\endgroup$
    – molmoc
    Commented May 16, 2019 at 23:13

1 Answer 1

1
$\begingroup$

Ok I finally figured out this issue. The problem was that I didn't had any material in the material tabs, so there was nothing to bake. I had to go through other programs to convert properly the cityGML files before to bake them in blender. I had to use Autodesk Infraworks and FME cityGML importer to get there. It works at least for me with the models I got from Rotterdam.

Here is my workflow:

  • Download the model from the website in cityGML format, thematic classes: buildings, textures: RhinoCity texturing.
  • FME quick translator: run CityGML to IMX workspace and convert it to a .imx file.
  • Open Infraworks and import the .imx file, then export it to FBX (uncheck merge textures toggle and do not export the ground).

Then in Blender I can open the FBX that contains the materials and textures ready for baking. Clear parents and keep transformations with alt+P, group meshes with ctrl+J. Create a new UV map, a new texture image, unwrap (smart UV project) and finally bake the textures. Use the baked image as a new material, and the texture is mapped on the UV map created. I exported the file in FBX and the import in UE4 is very smooth. It looks great!

It works very well this way, hope that it can help someone else!

enter image description here

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .