mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
black .
This commit is contained in:
@@ -819,7 +819,7 @@ class IfcImporter:
|
||||
|
||||
for ifcclass in self.classes_to_wireframe_list:
|
||||
if element.is_a(ifcclass):
|
||||
obj.display_type = 'WIRE'
|
||||
obj.display_type = "WIRE"
|
||||
|
||||
if shape:
|
||||
# We use numpy here because Blender mathutils.Matrix is not accurate enough
|
||||
|
||||
@@ -403,10 +403,10 @@ class DocProperties(PropertyGroup):
|
||||
imperial_precision: StringProperty(default="1/32", name="Imperial Precision")
|
||||
tolerance: bpy.props.FloatProperty(default=0.00001, name="A tolerance used when selecting objects")
|
||||
classes_to_wireframe: StringProperty(
|
||||
default="IfcVirtualelement",
|
||||
name="Classes to Wireframe",
|
||||
description = "Upon import, these classes will display as wireframe.\nEx: IfcVirtualelement, IfcSpace"
|
||||
)
|
||||
default="IfcVirtualelement",
|
||||
name="Classes to Wireframe",
|
||||
description="Upon import, these classes will display as wireframe.\nEx: IfcVirtualelement, IfcSpace",
|
||||
)
|
||||
|
||||
|
||||
class BIMCameraProperties(PropertyGroup):
|
||||
|
||||
@@ -2008,7 +2008,7 @@ class OverrideModeSetObject(bpy.types.Operator, tool.Ifc.Operator):
|
||||
elif tool.Geometry.is_representation_item(context.active_object):
|
||||
self.edit_representation_item(context.active_object)
|
||||
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)
|
||||
bpy.context.view_layer.objects.active = None
|
||||
return {"FINISHED"}
|
||||
@@ -2649,9 +2649,9 @@ class ImportRepresentationItems(bpy.types.Operator, tool.Ifc.Operator):
|
||||
tool.Geometry.lock_object(item_obj)
|
||||
|
||||
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
|
||||
|
||||
tool.Root.reload_item_decorator()
|
||||
|
||||
@@ -212,10 +212,11 @@ class BIM_PT_object_material(Panel):
|
||||
box = layout.box()
|
||||
row = box.row()
|
||||
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
|
||||
|
||||
|
||||
def draw_set_ui(self):
|
||||
if self.props.is_editing:
|
||||
return self.draw_editable_set_ui()
|
||||
@@ -245,7 +246,7 @@ class BIM_PT_object_material(Panel):
|
||||
layout = self.layout
|
||||
box = layout.box()
|
||||
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"]):
|
||||
if (
|
||||
@@ -256,9 +257,11 @@ class BIM_PT_object_material(Panel):
|
||||
elif self.props.active_material_set_item_id == set_item["id"]:
|
||||
self.draw_editable_set_item_ui(set_item)
|
||||
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):
|
||||
box = self.layout.box()
|
||||
@@ -355,14 +358,10 @@ class BIM_PT_object_material(Panel):
|
||||
row = self.layout.row(align=True)
|
||||
row.label(text=f" Total Thickness: {formatted_thickness}")
|
||||
|
||||
|
||||
|
||||
|
||||
layout = self.layout
|
||||
box = layout.box()
|
||||
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"]:
|
||||
material_name = set_item["material"]
|
||||
@@ -377,11 +376,8 @@ class BIM_PT_object_material(Panel):
|
||||
row.label(text=set_item["name"], icon=set_item["icon"])
|
||||
op = row.operator("bim.select_by_material", text=material_name, emboss=False)
|
||||
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):
|
||||
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])
|
||||
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)
|
||||
has_layersetdirection = hasattr(element.HasAssociations[0].RelatingMaterial, "LayerSetDirection")
|
||||
if has_layersetdirection:
|
||||
@@ -405,7 +400,7 @@ class BIM_PT_object_material(Panel):
|
||||
box.label(text="----- Bottom -----")
|
||||
else:
|
||||
box.label(text="----- Interior -----")
|
||||
|
||||
|
||||
|
||||
class BIM_UL_materials(UIList):
|
||||
def draw_item(self, context, layout, data, item, icon, active_data, active_propname):
|
||||
|
||||
@@ -821,7 +821,7 @@ class ShowOpenings(Operator, tool.Ifc.Operator):
|
||||
for opening in openings:
|
||||
new = props.openings.add()
|
||||
new.obj = opening
|
||||
opening.display_type = 'WIRE'
|
||||
opening.display_type = "WIRE"
|
||||
DecorationsHandler.install(bpy.context)
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -384,7 +384,7 @@ class BIM_ADDON_preferences(bpy.types.AddonPreferences):
|
||||
row = self.layout.row()
|
||||
row.prop(context.scene.DocProperties, "tolerance")
|
||||
row = self.layout.row()
|
||||
row.prop(context.scene.DocProperties, "classes_to_wireframe")
|
||||
row.prop(context.scene.DocProperties, "classes_to_wireframe")
|
||||
|
||||
|
||||
# Scene panel groups
|
||||
|
||||
Reference in New Issue
Block a user