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).
This commit is contained in:
Andrej730
2023-02-20 18:00:17 +05:00
parent bd071cc472
commit 0e1689c2d9
@@ -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
]