mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 06:58:56 +00:00
Less console errors if failed to find external styles library
Now:
```
Error: Error loading external style - cannot find file: 'D:\Dropbox\GitHub\OD_Textures\Closed (Encrypted)\Materials.blend'
```
Before:
```
File "\blenderbim\bim\module\style\prop.py", line 250, in update_shading_style
Error: Error loading external style - cannot find file: 'D:\Dropbox\GitHub\OD_Textures\Closed (Encrypted)\Materials.blend'
Traceback (most recent call last):
File "\blenderbim\bim\module\style\prop.py", line 255, in update_shading_style
bpy.ops.bim.activate_external_style(material_name=blender_material.name)
File "L:\Games\SteamLibrary\steamapps\common\Blender\4.0\scripts\modules\bpy\ops.py", line 109, in __call__
ret = _op_call(self.idname_py(), kw)
RuntimeError: Error: Error loading external style - cannot find file: 'D:\Dropbox\GitHub\OD_Textures\Closed (Encrypted)\Materials.blend'
```
This commit is contained in:
@@ -252,7 +252,12 @@ def update_shading_style(self, context):
|
|||||||
style_elements = tool.Style.get_style_elements(blender_material)
|
style_elements = tool.Style.get_style_elements(blender_material)
|
||||||
if self.active_style_type == "External":
|
if self.active_style_type == "External":
|
||||||
if tool.Style.has_blender_external_style(style_elements):
|
if tool.Style.has_blender_external_style(style_elements):
|
||||||
bpy.ops.bim.activate_external_style(material_name=blender_material.name)
|
try:
|
||||||
|
bpy.ops.bim.activate_external_style(material_name=blender_material.name)
|
||||||
|
except RuntimeError as error:
|
||||||
|
if str(error).startswith("Error: Error loading external style - "):
|
||||||
|
return
|
||||||
|
raise error
|
||||||
|
|
||||||
elif self.active_style_type == "Shading":
|
elif self.active_style_type == "Shading":
|
||||||
style_elements = tool.Style.get_style_elements(blender_material)
|
style_elements = tool.Style.get_style_elements(blender_material)
|
||||||
|
|||||||
Reference in New Issue
Block a user