Issue with imported .obj files only displaying albedo but not metalness or roughness

4.2.2

I ran into some problems with importing baked (with SimpleBake) materials attached as .mtl files to .obj meshes.
I’m using a plugin that only accepts .obj straight from the file manager, which is why I can’t make use of .gltf exports of my blender models, and said plugin extends GridMaps/MeshLibraries which is why I can’t assign new materials to my meshes after importing them, in case you were wondering.
So getting the initial import of .obj files and their .mtl files right seems kind of crucial right now.

The problem at hand is, that of the 3 maps in .jpg format (for diffuse, metalness & roughness) only the diffuse one is actually applied to the mesh…

My steps are as follows:

  1. Export objects and materials from Blender:

• Apply transformations
• Manual UV unwrap
• Bake textures to images stored in seperate folders
• Export models as .obj files.

  1. Import objects and materials into Godot 4.2.2

• Import folders with .jpg files into a folder in the Godot file manager
• Import .obj and .mtl file into my assets folder

  1. Despair over my flat green models because only the diffuse texture is applied as Albedo for the StandardMaterial3D assigned to my mesh in the Editor.

My conclusions:

• Reimporting the object and material files into Blender works just fine, so my export is probably not the problem…
• Since one of the maps is applied correctly, I doubt that it is a general import mistake like faulty paths to the maps?

My explorations to fix my issue so far include:

• Finding and fixing my own mistakes (inconclusive)
• Checking the .mtl files for errors (found none)
• Thinking about workarounds like:
Implementing/changing scripts to enable editing/replacement/overriding materials in the MeshLib…
Or
Implementing a script to automatically replace items set within the GridMap with accuratly shaded versions stored somewhere else…

But I’m at quite the early stage in my adventures a with game development and Godot and am hitting a wall right now, so I’d be thankful for sugguestions or other approaches!

What is the plugin?

A 3D WFC Implementation by pietru2004

It‘s the only one I have found that supports Godot 4.X, more than a single layer on the y-axis and is working properly…

Summary

This text will be hidden

I actually managed to solve the problem:

  1. I changed the plugin’s script MeshLibItem.gd
    to export a StandardMaterial3D (probably going to do the same for ORM), which I can access in the editor.
  2. I also changed the plugin‘s MeshLibDefiner.gd so that it recognizes and applies said Material to override the inaccessible Material of the Mesh when generating the MeshLib.
1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.