mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-16 21:42:19 +00:00
Fixed error on saving styles without textures after 3aff29dec
This commit is contained in:
@@ -183,13 +183,15 @@ class Style(blenderbim.core.tool.Style):
|
|||||||
|
|
||||||
texture_maps = TEXTURE_MAPS_BY_METHODS[style_data["ReflectanceMethod"]]
|
texture_maps = TEXTURE_MAPS_BY_METHODS[style_data["ReflectanceMethod"]]
|
||||||
unused_texture_maps = list(STYLE_TEXTURE_PROPS_MAP.keys())
|
unused_texture_maps = list(STYLE_TEXTURE_PROPS_MAP.keys())
|
||||||
for texture in texture_style.Textures:
|
|
||||||
if texture.Mode not in texture_maps:
|
if texture_style:
|
||||||
print(f"WARNING. Unsupported texture mode: {texture.Mode}. Supported maps: {texture_maps}")
|
for texture in texture_style.Textures:
|
||||||
continue
|
if texture.Mode not in texture_maps:
|
||||||
prop_blender = STYLE_TEXTURE_PROPS_MAP.get(texture.Mode, None)
|
print(f"WARNING. Unsupported texture mode: {texture.Mode}. Supported maps: {texture_maps}")
|
||||||
setattr(props, prop_blender, texture.URLReference)
|
continue
|
||||||
unused_texture_maps.remove(texture.Mode)
|
prop_blender = STYLE_TEXTURE_PROPS_MAP.get(texture.Mode, None)
|
||||||
|
setattr(props, prop_blender, texture.URLReference)
|
||||||
|
unused_texture_maps.remove(texture.Mode)
|
||||||
|
|
||||||
# clear empty texture fields
|
# clear empty texture fields
|
||||||
for texture_mode in unused_texture_maps:
|
for texture_mode in unused_texture_maps:
|
||||||
|
|||||||
Reference in New Issue
Block a user