mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-19 11:43:53 +00:00
material.unassign_material - support batching #4474
This commit is contained in:
@@ -324,8 +324,8 @@ class UpdateRepresentation(bpy.types.Operator, Operator):
|
||||
# We are explicitly casting to a tessellation, so remove all parametric materials.
|
||||
element_type = ifcopenshell.util.element.get_type(product)
|
||||
if element_type: # Some invalid IFCs use material sets without a type.
|
||||
ifcopenshell.api.run("material.unassign_material", tool.Ifc.get(), product=element_type)
|
||||
ifcopenshell.api.run("material.unassign_material", tool.Ifc.get(), product=product)
|
||||
ifcopenshell.api.run("material.unassign_material", tool.Ifc.get(), products=[element_type])
|
||||
ifcopenshell.api.run("material.unassign_material", tool.Ifc.get(), products=[product])
|
||||
else:
|
||||
# These objects are parametrically based on an axis and should not be modified as a mesh
|
||||
return
|
||||
|
||||
@@ -551,7 +551,7 @@ def ensure_material_assigned(usecase_path, ifc_file, settings):
|
||||
|
||||
|
||||
def ensure_material_unassigned(usecase_path, ifc_file, settings):
|
||||
elements = [settings["product"]]
|
||||
elements = settings["products"]
|
||||
if elements[0].is_a("IfcElementType"):
|
||||
elements.extend(ifcopenshell.util.element.get_types(elements[0]))
|
||||
for element in elements:
|
||||
|
||||
@@ -116,12 +116,12 @@ def unassign_material(ifc, material_tool, objects):
|
||||
inherited_material = material_tool.get_material(element, should_inherit=True)
|
||||
if material and "Usage" in material.is_a():
|
||||
element_type = material_tool.get_type(element)
|
||||
ifc.run("material.unassign_material", product=element_type)
|
||||
ifc.run("material.unassign_material", products=[element_type])
|
||||
elif not material and inherited_material:
|
||||
element_type = material_tool.get_type(element)
|
||||
ifc.run("material.unassign_material", product=element_type)
|
||||
ifc.run("material.unassign_material", products=[element_type])
|
||||
elif material:
|
||||
ifc.run("material.unassign_material", product=element)
|
||||
ifc.run("material.unassign_material", products=[element])
|
||||
|
||||
|
||||
def patch_non_parametric_mep_segment(ifc, material_tool, profile_tool, obj):
|
||||
|
||||
Reference in New Issue
Block a user