mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-13 02:47:48 +00:00
Add option for door glazing material
This commit is contained in:
@@ -94,6 +94,7 @@ def update_door_modifier_representation(obj: bpy.types.Object) -> None:
|
||||
if fallback_material := (int(props.lining_material) or int(props.panel_material)):
|
||||
lining_material = tool.Ifc.get().by_id(int(props.lining_material) or fallback_material)
|
||||
panel_material = tool.Ifc.get().by_id(int(props.panel_material) or fallback_material)
|
||||
glazing_material = tool.Ifc.get().by_id(int(props.glazing_material) or fallback_material)
|
||||
should_create_new_material_set = False
|
||||
if material := ifcopenshell.util.element.get_material(element):
|
||||
if (
|
||||
@@ -122,6 +123,7 @@ def update_door_modifier_representation(obj: bpy.types.Object) -> None:
|
||||
styles = {
|
||||
"Lining": ifcopenshell.util.representation.get_material_style(lining_material, body),
|
||||
"Framing": ifcopenshell.util.representation.get_material_style(panel_material, body),
|
||||
"Glazing": ifcopenshell.util.representation.get_material_style(glazing_material, body),
|
||||
}
|
||||
for item in model_representation.Items:
|
||||
if aspect := ifcopenshell.util.representation.get_item_shape_aspect(model_representation, item):
|
||||
|
||||
@@ -667,6 +667,7 @@ class BIMDoorProperties(PropertyGroup):
|
||||
# Material properties
|
||||
panel_material: bpy.props.EnumProperty(name="Panel Material", items=get_materials, options=set())
|
||||
lining_material: bpy.props.EnumProperty(name="Lining Material", items=get_materials, options=set())
|
||||
glazing_material: bpy.props.EnumProperty(name="Glazing Material", items=get_materials, options=set())
|
||||
|
||||
if TYPE_CHECKING:
|
||||
is_editing: bool
|
||||
@@ -703,6 +704,7 @@ class BIMDoorProperties(PropertyGroup):
|
||||
# Material.
|
||||
panel_material: str
|
||||
lining_material: str
|
||||
glazing_material: str
|
||||
|
||||
def get_general_kwargs(self, convert_to_project_units=False):
|
||||
kwargs = {
|
||||
|
||||
@@ -549,6 +549,8 @@ class BIM_PT_door(bpy.types.Panel):
|
||||
self.layout.label(text="Material Properties")
|
||||
self.layout.prop(props, "lining_material")
|
||||
self.layout.prop(props, "panel_material")
|
||||
if props.transom_thickness:
|
||||
self.layout.prop(props, "glazing_material")
|
||||
|
||||
update_door_modifier_bmesh(context)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user