Gridmaps: how to export a textured tile in Blender?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Emilio Moretti

Hi, I’m not seeing textures when I import a custom tile with a texture into Godot.

These are the steps I followed

  1. Imported a .obj tile from the Kenney - Extended Nature Pack into Blender 2.80 (it’s a box. no more no less)
  2. Removed all materials
  3. Went to UV Editing:
  • Loaded my texture
  • Unwrapped the box
  • set the UV mapping the way I wanted it to look with my texture
  1. Went to Modeling
  2. Selected the top face of the tile (the two triangles)
  3. Added a Texture material with UV coordinates
  • The render looks good. The texture is shown in the top face.
  1. I export the .obj file.
  2. I copy the texture, the ‘textured-tile.mtl’ and the ‘textured-tile.obj’ files into the godot project
  3. I drag the object from the list of assets into the scene
  4. The texture is missing.

Did I miss any step to make it work? I thought that was all I needed. Am I supposed to export it differently?
I also tried copying the texture into the project, and updated the .mtl file to fix the path location, but it didn’t work.

I exported it as Collada (.dae), and it worked on first try, but it adds an entire scene, an animation player, and a mesh. I just wanted the mesh. The mesh is also rotated, and I haven’t found a way to lay it as floor yet, because changing the transform actually changes the entire gridmap plane.

Thank you in advance

I didn’t fix this, but it’s partially working with the collada format, since .obj textures are not shown. The model rotation is broken and I have to manually fix that when laying down the floor, but at least I can use it. The .dae and .tscn files are easy enough to modify, so I took one model, with one scene + collissions… and used a script to create 160 copies with different textures. I just had to make sure the internal materials had different names. It’s definitely not a good fix, but at least I’m able to export a usable gridmap with 161 different textures.

Emilio Moretti | 2019-05-09 17:32