mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Fix UI errors opening non-IfcMaterials in Materials UI
There was UI errors because ui data wasn't updated, now ui data update is tied to load_materials
This commit is contained in:
@@ -751,8 +751,6 @@ class ExpandMaterialCategory(bpy.types.Operator):
|
|||||||
props.active_material_index = index
|
props.active_material_index = index
|
||||||
break
|
break
|
||||||
core.load_materials(tool.Material, props.material_type)
|
core.load_materials(tool.Material, props.material_type)
|
||||||
# Update UI data as material_styles_data depends on props.materials.
|
|
||||||
bonsai.bim.handler.refresh_ui_data()
|
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -134,6 +134,10 @@ class Material(bonsai.core.tool.Material):
|
|||||||
new.ifc_definition_id = material.id()
|
new.ifc_definition_id = material.id()
|
||||||
new.total_elements = len(ifcopenshell.util.element.get_elements_by_material(tool.Ifc.get(), material))
|
new.total_elements = len(ifcopenshell.util.element.get_elements_by_material(tool.Ifc.get(), material))
|
||||||
|
|
||||||
|
from bonsai.bim.module.material.data import MaterialsData
|
||||||
|
|
||||||
|
MaterialsData.data["material_styles_data"] = MaterialsData.material_styles_data()
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def is_editing_materials(cls) -> bool:
|
def is_editing_materials(cls) -> bool:
|
||||||
return bpy.context.scene.BIMMaterialProperties.is_editing
|
return bpy.context.scene.BIMMaterialProperties.is_editing
|
||||||
|
|||||||
Reference in New Issue
Block a user