mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-23 21:58:46 +00:00
black .
This commit is contained in:
@@ -819,7 +819,7 @@ class IfcImporter:
|
|||||||
|
|
||||||
for ifcclass in self.classes_to_wireframe_list:
|
for ifcclass in self.classes_to_wireframe_list:
|
||||||
if element.is_a(ifcclass):
|
if element.is_a(ifcclass):
|
||||||
obj.display_type = 'WIRE'
|
obj.display_type = "WIRE"
|
||||||
|
|
||||||
if shape:
|
if shape:
|
||||||
# We use numpy here because Blender mathutils.Matrix is not accurate enough
|
# We use numpy here because Blender mathutils.Matrix is not accurate enough
|
||||||
|
|||||||
@@ -405,8 +405,8 @@ class DocProperties(PropertyGroup):
|
|||||||
classes_to_wireframe: StringProperty(
|
classes_to_wireframe: StringProperty(
|
||||||
default="IfcVirtualelement",
|
default="IfcVirtualelement",
|
||||||
name="Classes to Wireframe",
|
name="Classes to Wireframe",
|
||||||
description = "Upon import, these classes will display as wireframe.\nEx: IfcVirtualelement, IfcSpace"
|
description="Upon import, these classes will display as wireframe.\nEx: IfcVirtualelement, IfcSpace",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class BIMCameraProperties(PropertyGroup):
|
class BIMCameraProperties(PropertyGroup):
|
||||||
|
|||||||
@@ -2008,7 +2008,7 @@ class OverrideModeSetObject(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
elif tool.Geometry.is_representation_item(context.active_object):
|
elif tool.Geometry.is_representation_item(context.active_object):
|
||||||
self.edit_representation_item(context.active_object)
|
self.edit_representation_item(context.active_object)
|
||||||
tool.Root.reload_item_decorator()
|
tool.Root.reload_item_decorator()
|
||||||
#So you can keep hitting tab to cycle out of edit mode
|
# So you can keep hitting tab to cycle out of edit mode
|
||||||
context.active_object.select_set(False)
|
context.active_object.select_set(False)
|
||||||
bpy.context.view_layer.objects.active = None
|
bpy.context.view_layer.objects.active = None
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
@@ -2649,9 +2649,9 @@ class ImportRepresentationItems(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
tool.Geometry.lock_object(item_obj)
|
tool.Geometry.lock_object(item_obj)
|
||||||
|
|
||||||
if "IfcOpeningElement" in obj.name:
|
if "IfcOpeningElement" in obj.name:
|
||||||
item_obj.display_type = 'WIRE'
|
item_obj.display_type = "WIRE"
|
||||||
|
|
||||||
item_obj.select_set(True)#so you can quickly hit tab again, for edit mode
|
item_obj.select_set(True) # so you can quickly hit tab again, for edit mode
|
||||||
context.view_layer.objects.active = item_obj
|
context.view_layer.objects.active = item_obj
|
||||||
|
|
||||||
tool.Root.reload_item_decorator()
|
tool.Root.reload_item_decorator()
|
||||||
|
|||||||
@@ -212,10 +212,11 @@ class BIM_PT_object_material(Panel):
|
|||||||
box = layout.box()
|
box = layout.box()
|
||||||
row = box.row()
|
row = box.row()
|
||||||
row.label(text="Name")
|
row.label(text="Name")
|
||||||
op = row.operator("bim.select_by_material", text=ObjectMaterialData.data["material_name"], icon="NONE", emboss=False)
|
op = row.operator(
|
||||||
|
"bim.select_by_material", text=ObjectMaterialData.data["material_name"], icon="NONE", emboss=False
|
||||||
|
)
|
||||||
op.material = material_id
|
op.material = material_id
|
||||||
|
|
||||||
|
|
||||||
def draw_set_ui(self):
|
def draw_set_ui(self):
|
||||||
if self.props.is_editing:
|
if self.props.is_editing:
|
||||||
return self.draw_editable_set_ui()
|
return self.draw_editable_set_ui()
|
||||||
@@ -245,7 +246,7 @@ class BIM_PT_object_material(Panel):
|
|||||||
layout = self.layout
|
layout = self.layout
|
||||||
box = layout.box()
|
box = layout.box()
|
||||||
active_object = bpy.context.active_object
|
active_object = bpy.context.active_object
|
||||||
self.layerset_bounds (box, active_object, location="Top_Exterior")
|
self.layerset_bounds(box, active_object, location="Top_Exterior")
|
||||||
|
|
||||||
for index, set_item in enumerate(ObjectMaterialData.data["set_items"]):
|
for index, set_item in enumerate(ObjectMaterialData.data["set_items"]):
|
||||||
if (
|
if (
|
||||||
@@ -256,9 +257,11 @@ class BIM_PT_object_material(Panel):
|
|||||||
elif self.props.active_material_set_item_id == set_item["id"]:
|
elif self.props.active_material_set_item_id == set_item["id"]:
|
||||||
self.draw_editable_set_item_ui(set_item)
|
self.draw_editable_set_item_ui(set_item)
|
||||||
else:
|
else:
|
||||||
self.draw_read_only_set_item_ui(box, set_item, index, is_first=index == 0, is_last=index == total_items - 1)
|
self.draw_read_only_set_item_ui(
|
||||||
|
box, set_item, index, is_first=index == 0, is_last=index == total_items - 1
|
||||||
|
)
|
||||||
|
|
||||||
self.layerset_bounds (box, active_object, location="Bottom_Interior")
|
self.layerset_bounds(box, active_object, location="Bottom_Interior")
|
||||||
|
|
||||||
def draw_editable_set_item_profile_ui(self, set_item):
|
def draw_editable_set_item_profile_ui(self, set_item):
|
||||||
box = self.layout.box()
|
box = self.layout.box()
|
||||||
@@ -355,14 +358,10 @@ class BIM_PT_object_material(Panel):
|
|||||||
row = self.layout.row(align=True)
|
row = self.layout.row(align=True)
|
||||||
row.label(text=f" Total Thickness: {formatted_thickness}")
|
row.label(text=f" Total Thickness: {formatted_thickness}")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
box = layout.box()
|
box = layout.box()
|
||||||
active_object = bpy.context.active_object
|
active_object = bpy.context.active_object
|
||||||
self.layerset_bounds (box, active_object, location="Top_Exterior")
|
self.layerset_bounds(box, active_object, location="Top_Exterior")
|
||||||
|
|
||||||
|
|
||||||
for set_item in ObjectMaterialData.data["set_items"]:
|
for set_item in ObjectMaterialData.data["set_items"]:
|
||||||
material_name = set_item["material"]
|
material_name = set_item["material"]
|
||||||
@@ -378,10 +377,7 @@ class BIM_PT_object_material(Panel):
|
|||||||
op = row.operator("bim.select_by_material", text=material_name, emboss=False)
|
op = row.operator("bim.select_by_material", text=material_name, emboss=False)
|
||||||
op.material = material_id
|
op.material = material_id
|
||||||
|
|
||||||
self.layerset_bounds (box, active_object, location="Bottom_Interior")
|
self.layerset_bounds(box, active_object, location="Bottom_Interior")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def get_material_id_from_name(self, material_name):
|
def get_material_id_from_name(self, material_name):
|
||||||
for index, set_item in enumerate(ObjectMaterialData.data["materials"]):
|
for index, set_item in enumerate(ObjectMaterialData.data["materials"]):
|
||||||
@@ -389,8 +385,7 @@ class BIM_PT_object_material(Panel):
|
|||||||
material_id = int(ObjectMaterialData.data["materials"][index][0])
|
material_id = int(ObjectMaterialData.data["materials"][index][0])
|
||||||
return material_id
|
return material_id
|
||||||
|
|
||||||
|
def layerset_bounds(self, box, obj, location="Top_Exterior"):
|
||||||
def layerset_bounds (self, box, obj, location="Top_Exterior"):
|
|
||||||
element = tool.Ifc.get_entity(obj)
|
element = tool.Ifc.get_entity(obj)
|
||||||
has_layersetdirection = hasattr(element.HasAssociations[0].RelatingMaterial, "LayerSetDirection")
|
has_layersetdirection = hasattr(element.HasAssociations[0].RelatingMaterial, "LayerSetDirection")
|
||||||
if has_layersetdirection:
|
if has_layersetdirection:
|
||||||
|
|||||||
@@ -821,7 +821,7 @@ class ShowOpenings(Operator, tool.Ifc.Operator):
|
|||||||
for opening in openings:
|
for opening in openings:
|
||||||
new = props.openings.add()
|
new = props.openings.add()
|
||||||
new.obj = opening
|
new.obj = opening
|
||||||
opening.display_type = 'WIRE'
|
opening.display_type = "WIRE"
|
||||||
DecorationsHandler.install(bpy.context)
|
DecorationsHandler.install(bpy.context)
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user