mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
Add search operator to material enum field
This commit is contained in:
@@ -137,3 +137,7 @@ class BIMObjectMaterialProperties(PropertyGroup):
|
||||
parameterized_profile_classes: EnumProperty(
|
||||
items=getParameterizedProfileClasses, name="Parameterized Profile Classes"
|
||||
)
|
||||
|
||||
getter_enum = {
|
||||
"material": get_materials
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ from ifcopenshell.api.material.data import Data
|
||||
from ifcopenshell.api.profile.data import Data as ProfileData
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
from blenderbim.bim.helper import draw_attributes
|
||||
from blenderbim.bim.ui import prop_with_search
|
||||
from blenderbim.bim.module.material.data import MaterialsData, ObjectMaterialData
|
||||
|
||||
|
||||
@@ -190,7 +191,7 @@ class BIM_PT_object_material(Panel):
|
||||
row = self.layout.row(align=True)
|
||||
row.prop(self.props, "material_type", text="")
|
||||
if self.props.material_type == "IfcMaterial" or self.props.material_type == "IfcMaterialList":
|
||||
row.prop(self.props, "material", text="")
|
||||
prop_with_search(row, self.props, "material", text="")
|
||||
row.operator("bim.assign_material", icon="ADD", text="")
|
||||
|
||||
def draw_material_ui(self):
|
||||
@@ -220,8 +221,7 @@ class BIM_PT_object_material(Panel):
|
||||
return self.draw_read_only_single_ui()
|
||||
|
||||
def draw_editable_single_ui(self):
|
||||
row = self.layout.row(align=True)
|
||||
row.prop(self.props, "material", text="")
|
||||
prop_with_search(self.layout, self.props, "material", text="")
|
||||
|
||||
def draw_read_only_single_ui(self):
|
||||
material = Data.materials[self.product_data["id"]]
|
||||
@@ -242,7 +242,7 @@ class BIM_PT_object_material(Panel):
|
||||
row.prop(attribute, "string_value", text=attribute.name)
|
||||
row.prop(attribute, "is_null", icon="RADIOBUT_OFF" if attribute.is_null else "RADIOBUT_ON", text="")
|
||||
row = self.layout.row(align=True)
|
||||
row.prop(self.props, "material", text="")
|
||||
prop_with_search(row, self.props, "material", text="")
|
||||
|
||||
op = row.operator(f"bim.add_{self.set_item_name}", icon="ADD", text="")
|
||||
setattr(op, f"{self.set_item_name}_set", self.material_set_id)
|
||||
|
||||
@@ -147,7 +147,7 @@ class PsetTemplate(PropertyGroup):
|
||||
applicable_entity: StringProperty(name="Applicable Entity")
|
||||
|
||||
getter_enum = {
|
||||
"template_type": lambda self, context: get_template_type(self, context),
|
||||
"template_type": get_template_type,
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user