Sketchfab's automatic matching of textures to materials has flaws

materials
textures

(Lewis2e) #1

Hi

I am writing a Sketchfab exporter module for my SImpleBake add-on for Blender 2.8 using the Sketchfab API.

I am bring hampered by what seems to be a bug (or at least a limitation) in how Sketchfab matches texture files to materials.

In a nutshell, if the materials (and textures) don’t have very different names, this seems to confuse Sketchfab’s pattern matching.

It’s probably best explained by example. See the attached files, which illustrate this problem. As a summary:

DoesntWork.zip
Material: “Cube”
Material: “OtherCube”
Texture: “Cube_diffuse.png”
Texture: “Cube_metalness.png”
Texture: “OtherCube_diffuse.png”
Texture: “OtherCube_metalness.png”
Result: FAIL - Both materials Cube and OtherCube have the textures OtherCube_*** applied.

In comparison, this configuration would work fine.

Works.zip
Material: “Bob”
Material: “Teddy”
Texture: “Bob_diffuse.png”
Texture: “Bob_metalness.png”
Texture: “Teddy_diffuse.png”
Texture: “Teddy_metalness.png”
Result: PASS - Textures are correctly applied to the respective materials.

Happy to clarify if any of that doesn’t make sense.

DoesntWork.zip (105.8 KB)

Works.zip (105.7 KB)


#2

Hello,

Yes, we’re aware of this limitation. The material matching doesn’t do very well with material names that have matching substrings, in this case, “cube”. We hope to improve this in the future, but for now it’s best to use completely unique material names that don’t share substrings.


(Lewis2e) #4

Thanks for confirming this.