From 0e1689c2d92869ee296e82a94793fc1dda5db51a Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Mon, 20 Feb 2023 18:00:17 +0500 Subject: [PATCH] Solving test fail - keeping unnamed profiles when updating profiles in MaterialsData Solves test_enable_editing_material_set_item test error ``` FAILED test/bim/test_feature.py::test_enable_editing_material_set_item - RuntimeError: Error: Python: Traceback (most recent call last). RuntimeError: Error: Python: Traceback (most recent call last): File "\blenderbim\bim\module\material\operator.py", line 587, in execute self.mprops.profiles = str(material_set_item.Profile.id()) TypeError: bpy_struct: item.attr = val: enum "107" not found in ('79', '98') Location: C:\software\Steam\steamapps\common\Blender\3.4\scripts\modules\bpy\ops.py:113 ``` The problem was `bim.enable_editing_material_set_item"` was trying to set `MaterialsData` profiles and wasn't able to set unnamed profile because `MaterialsData.profiles()` was discarding unnamed profiles (which is seems contradictory because `profiles()` is also handling unnamed profiles anyway). --- src/blenderbim/blenderbim/bim/module/material/data.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/blenderbim/blenderbim/bim/module/material/data.py b/src/blenderbim/blenderbim/bim/module/material/data.py index 81be795f0d..3dd00ffa71 100644 --- a/src/blenderbim/blenderbim/bim/module/material/data.py +++ b/src/blenderbim/blenderbim/bim/module/material/data.py @@ -76,7 +76,6 @@ class MaterialsData: return [ (str(p.id()), p.ProfileName or "Unnamed", "") for p in tool.Ifc.get().by_type("IfcProfileDef") - if p.ProfileName ]