BlenderProc
BlenderProc copied to clipboard
[BUG]: Haven texture leather_red_02 fails to load
The following line does not create a new material and does not load the texture:
bproc.api.loader.load_haven_mat(haven_textures_folder, ["leather_red_02"])
The reason is that the no color base texture was downloaded:

When manually downloading the texture from Haven, the issue becomes apparent:

This texture has two color variations, with names Coll1 and Coll2, which are not downloaded by the download_texture()
Possible solution:
- add
Coll1andColl2to keys to be downloaded - check for
_coll1_in load_haven_mat() as well
Maybe we should make two different materials in such cases, that we have one copy with Coll1 and one copy with Coll2. That way both materials could been used.
Initially I had the same idea as you, but now I think I'd prefer a solution where this is handled by the HavenMaterialLoader.
When the loader encounters a folder with several color variations, it would then create Blender materials for all of them, e.g:
leather_red_02_coll1leather_red_02_coll2
Another benefit of handling this with the loader is that it saves disk space, because we don't need to duplicate the other textures maps.
I just realised that maybe you already meant that we should handle this during loading.
I'll try to implement a solution that:
- Downloads the color variations into a single folder
- Creates multiple Blender materials when loading a texture folder with several variations
Also, the names I suggested above are bad, because on the thrid line here, the material would not be found:
texture_name = "leather_red_02"
load_haven_mat(haven_folder, texture_name)
material = bpy.data.materials[texture_name]
Now I'm thinking we should load all the variations with the name leather_red_02, and Blender will automatically name the second material leather_red_02.001.