diff --git a/src/bonsai/bonsai/bim/module/model/slab.py b/src/bonsai/bonsai/bim/module/model/slab.py index ad553bbfc7..78418971f9 100644 --- a/src/bonsai/bonsai/bim/module/model/slab.py +++ b/src/bonsai/bonsai/bim/module/model/slab.py @@ -322,7 +322,7 @@ class DumbSlabPlaner: abs(existing_x_angle) < (pi / 2) and direction_ratios.z < 0 ): # The extrusion direction is negative. If the layer_parameter is set to positive, - # then the we change the extrusion direction. And the offset direction should remain positive + # then the we change the extrusion direction. And the offset direction should remain positive # for either direction sense, so we change it. offset_direction *= -1 if layer_params["direction_sense"] == "POSITIVE": diff --git a/src/bonsai/bonsai/bim/module/model/wall.py b/src/bonsai/bonsai/bim/module/model/wall.py index ed3e32702e..49811c8cbd 100644 --- a/src/bonsai/bonsai/bim/module/model/wall.py +++ b/src/bonsai/bonsai/bim/module/model/wall.py @@ -343,7 +343,7 @@ class ChangeExtrusionXAngle(bpy.types.Operator, tool.Ifc.Operator): ): # The extrusion direction is negative. If the layer_parameter is set to positive, # then the we change the extrusion direction. - # then the we change the extrusion direction. And the offset direction should remain positive + # then the we change the extrusion direction. And the offset direction should remain positive # for either direction sense, so we change it. offset_direction *= -1 if layer_params["direction_sense"] == "POSITIVE": diff --git a/src/bonsai/bonsai/bim/module/sequence/operator.py b/src/bonsai/bonsai/bim/module/sequence/operator.py index b7730f2b93..5eccfd04a8 100644 --- a/src/bonsai/bonsai/bim/module/sequence/operator.py +++ b/src/bonsai/bonsai/bim/module/sequence/operator.py @@ -654,6 +654,7 @@ class DisableEditingWorkCalendar(bpy.types.Operator): core.disable_editing_work_calendar(tool.Sequence) return {"FINISHED"} + class ImportCSV(bpy.types.Operator, tool.Ifc.Operator, ImportHelper): bl_idname = "bim.import_csv" bl_label = "Import CSV" diff --git a/src/bonsai/bonsai/bim/operator.py b/src/bonsai/bonsai/bim/operator.py index bcb31264c5..54dc26617a 100644 --- a/src/bonsai/bonsai/bim/operator.py +++ b/src/bonsai/bonsai/bim/operator.py @@ -678,13 +678,13 @@ class BIM_OT_add_section_plane(bpy.types.Operator): continue # In EEVEE rendering engine, `blend_mode` is deprecated and replaced by `surface_render_method` # https://developer.blender.org/docs/release_notes/4.2/eevee_migration/#materials - if (hasattr(material, "surface_render_method")): + if hasattr(material, "surface_render_method"): material.surface_render_method = "DITHERED" else: material.blend_method = "HASHED" - + # TODO: Find an alternative to `shadow_method` for EEVEE engine - if (hasattr(material, "shadow_method")): + if hasattr(material, "shadow_method"): material.shadow_method = "HASHED" material_output = tool.Blender.get_material_node(material, "OUTPUT_MATERIAL", {"is_active_output": True}) diff --git a/src/bonsai/bonsai/tool/collector.py b/src/bonsai/bonsai/tool/collector.py index 55bcd75f05..fdef8c9c71 100644 --- a/src/bonsai/bonsai/tool/collector.py +++ b/src/bonsai/bonsai/tool/collector.py @@ -47,7 +47,6 @@ class Collector(bonsai.core.tool.Collector): if element.is_a("IfcSlab"): tool.Geometry.lock_rotation(obj, x=True) - if element.is_a("IfcGridAxis"): if tool.Geometry.is_locked(element): tool.Geometry.lock_object(obj) diff --git a/src/bonsai/bonsai/tool/geometry.py b/src/bonsai/bonsai/tool/geometry.py index cca73f3fb4..9f3a5fee30 100644 --- a/src/bonsai/bonsai/tool/geometry.py +++ b/src/bonsai/bonsai/tool/geometry.py @@ -178,7 +178,13 @@ class Geometry(bonsai.core.tool.Geometry): obj.lock_scale = (False, False, False) @classmethod - def lock_rotation(cls, obj: bpy.types.Object, x: bool=False, y: bool=False, z: bool=False,) -> None: + def lock_rotation( + cls, + obj: bpy.types.Object, + x: bool = False, + y: bool = False, + z: bool = False, + ) -> None: obj.lock_rotation = (x, y, z) @classmethod diff --git a/src/bonsai/bonsai/tool/snap.py b/src/bonsai/bonsai/tool/snap.py index 4915f93bf3..f1b3f04464 100644 --- a/src/bonsai/bonsai/tool/snap.py +++ b/src/bonsai/bonsai/tool/snap.py @@ -245,9 +245,14 @@ class Snap(bonsai.core.tool.Snap): # Then it sorts them to get the shortest first intersections = [] if snap_point["type"] == "Face": - face_normal = snap_point["object"].rotation_euler.to_matrix() @ snap_point["object"].data.polygons[snap_point["face_index"]].normal + face_normal = ( + snap_point["object"].rotation_euler.to_matrix() + @ snap_point["object"].data.polygons[snap_point["face_index"]].normal + ) if face_normal.z == 0: - intersections.append(tool.Cad.intersect_edge_plane(axis_start, axis_end, snap_point["point"], face_normal.normalized())) + intersections.append( + tool.Cad.intersect_edge_plane(axis_start, axis_end, snap_point["point"], face_normal.normalized()) + ) if not intersections: x_axis = tool.Polyline.use_transform_orientations(Vector((1, 0, 0))) y_axis = tool.Polyline.use_transform_orientations(Vector((0, 1, 0))) @@ -358,7 +363,9 @@ class Snap(bonsai.core.tool.Snap): face_index = result[2] if hit is not None: # Wireframes - if snap_obj.type in {"EMPTY", "CURVE"} or (snap_obj.type == "MESH" and len(snap_obj.data.polygons) == 0): + if snap_obj.type in {"EMPTY", "CURVE"} or ( + snap_obj.type == "MESH" and len(snap_obj.data.polygons) == 0 + ): snap_points = tool.Raycast.ray_cast_by_proximity(context, event, snap_obj) if snap_points: for point in snap_points: