Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Haven texture leather_red_02 fails to load #456

Open
Victorlouisdg opened this issue Feb 4, 2022 · 3 comments
Open

[BUG]: Haven texture leather_red_02 fails to load #456

Victorlouisdg opened this issue Feb 4, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@Victorlouisdg
Copy link
Contributor

Victorlouisdg commented Feb 4, 2022

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:
image

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

This texture has two color variations, with names Coll1 and Coll2, which are not downloaded by the download_texture()

Possible solution:

  • add Coll1 and Coll2 to keys to be downloaded
  • check for _coll1_ in load_haven_mat() as well
@Victorlouisdg Victorlouisdg added the bug Something isn't working label Feb 4, 2022
@themasterlink
Copy link
Contributor

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.

@Victorlouisdg
Copy link
Contributor Author

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_coll1
  • leather_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.

@Victorlouisdg
Copy link
Contributor Author

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.

Victorlouisdg added a commit to Victorlouisdg/BlenderProc that referenced this issue Feb 12, 2022
Also look for col and diff_png keys in Haven API response for textures, instead of only the Diffuse key. This change allows more textures (e.g. leather_red_02 and fabric_pattern_05) to be downloadedwith all their base color image variations.

closes DLR-RM#456
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
2 participants