mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-13 10:57:49 +00:00
Bug fix in editing material set item profile (#4784)
Fixes bug: Editing a profile under MaterialProfileSetUsage opened dialog boxes under all profiles.
This commit is contained in:
@@ -562,6 +562,7 @@ class EnableEditingMaterialSetItemProfile(bpy.types.Operator):
|
||||
def execute(self, context):
|
||||
obj = bpy.data.objects.get(self.obj) if self.obj else context.active_object
|
||||
self.props = obj.BIMObjectMaterialProperties
|
||||
self.props.active_material_set_item_id = self.material_set_item
|
||||
self.props.material_set_item_profile_attributes.clear()
|
||||
profile = tool.Ifc.get().by_id(self.material_set_item).Profile
|
||||
blenderbim.bim.helper.import_attributes2(profile, self.props.material_set_item_profile_attributes)
|
||||
@@ -577,6 +578,7 @@ class DisableEditingMaterialSetItemProfile(bpy.types.Operator):
|
||||
def execute(self, context):
|
||||
obj = bpy.data.objects.get(self.obj) if self.obj else context.active_object
|
||||
self.props = obj.BIMObjectMaterialProperties
|
||||
self.props.active_material_set_item_id = 0
|
||||
self.props.material_set_item_profile_attributes.clear()
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -228,7 +228,7 @@ class BIM_PT_object_material(Panel):
|
||||
|
||||
total_items = len(ObjectMaterialData.data["set_items"])
|
||||
for index, set_item in enumerate(ObjectMaterialData.data["set_items"]):
|
||||
if len(self.props.material_set_item_profile_attributes):
|
||||
if len(self.props.material_set_item_profile_attributes) and self.props.active_material_set_item_id == set_item["id"]:
|
||||
self.draw_editable_set_item_profile_ui(set_item)
|
||||
elif self.props.active_material_set_item_id == set_item["id"]:
|
||||
self.draw_editable_set_item_ui(set_item)
|
||||
|
||||
Reference in New Issue
Block a user