diff --git a/blenderproc/python/loader/CCMaterialLoader.py b/blenderproc/python/loader/CCMaterialLoader.py index 0779228e1..938f96f04 100644 --- a/blenderproc/python/loader/CCMaterialLoader.py +++ b/blenderproc/python/loader/CCMaterialLoader.py @@ -69,6 +69,10 @@ def load_ccmaterials(folder_path: str = "resources/cctextures", used_assets: lis current_path = os.path.join(folder_path, asset) if os.path.isdir(current_path): base_image_path = os.path.join(current_path, f"{asset}_2K_Color.jpg") + # Filenames have been changed (https://docs.ambientcg.com/updates/2023/08/29/minor-changes-to-the-filename-structure-of-pbr-materials/) + if not os.path.exists(base_image_path): + base_image_path = os.path.join(current_path, f"{asset}_2K-JPG_Color.jpg") + if not os.path.exists(base_image_path): continue @@ -78,6 +82,9 @@ def load_ccmaterials(folder_path: str = "resources/cctextures", used_assets: lis roughness_image_path = base_image_path.replace("Color", "Roughness") alpha_image_path = base_image_path.replace("Color", "Opacity") normal_image_path = base_image_path.replace("Color", "Normal") + # Filenames have been changed (blender uses opengl normal maps) + if not os.path.exists(normal_image_path): + normal_image_path = base_image_path.replace("Color", "NormalGL") displacement_image_path = base_image_path.replace("Color", "Displacement") # if the material was already created it only has to be searched