This commit is contained in:
Andrej730
2025-03-17 11:57:21 +05:00
parent 37ec2bf0e4
commit 210257de8e
7 changed files with 23 additions and 10 deletions
@@ -654,6 +654,7 @@ class DisableEditingWorkCalendar(bpy.types.Operator):
core.disable_editing_work_calendar(tool.Sequence) core.disable_editing_work_calendar(tool.Sequence)
return {"FINISHED"} return {"FINISHED"}
class ImportCSV(bpy.types.Operator, tool.Ifc.Operator, ImportHelper): class ImportCSV(bpy.types.Operator, tool.Ifc.Operator, ImportHelper):
bl_idname = "bim.import_csv" bl_idname = "bim.import_csv"
bl_label = "Import CSV" bl_label = "Import CSV"
+2 -2
View File
@@ -678,13 +678,13 @@ class BIM_OT_add_section_plane(bpy.types.Operator):
continue continue
# In EEVEE rendering engine, `blend_mode` is deprecated and replaced by `surface_render_method` # 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 # 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" material.surface_render_method = "DITHERED"
else: else:
material.blend_method = "HASHED" material.blend_method = "HASHED"
# TODO: Find an alternative to `shadow_method` for EEVEE engine # 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.shadow_method = "HASHED"
material_output = tool.Blender.get_material_node(material, "OUTPUT_MATERIAL", {"is_active_output": True}) material_output = tool.Blender.get_material_node(material, "OUTPUT_MATERIAL", {"is_active_output": True})
-1
View File
@@ -47,7 +47,6 @@ class Collector(bonsai.core.tool.Collector):
if element.is_a("IfcSlab"): if element.is_a("IfcSlab"):
tool.Geometry.lock_rotation(obj, x=True) tool.Geometry.lock_rotation(obj, x=True)
if element.is_a("IfcGridAxis"): if element.is_a("IfcGridAxis"):
if tool.Geometry.is_locked(element): if tool.Geometry.is_locked(element):
tool.Geometry.lock_object(obj) tool.Geometry.lock_object(obj)
+7 -1
View File
@@ -178,7 +178,13 @@ class Geometry(bonsai.core.tool.Geometry):
obj.lock_scale = (False, False, False) obj.lock_scale = (False, False, False)
@classmethod @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) obj.lock_rotation = (x, y, z)
@classmethod @classmethod
+10 -3
View File
@@ -245,9 +245,14 @@ class Snap(bonsai.core.tool.Snap):
# Then it sorts them to get the shortest first # Then it sorts them to get the shortest first
intersections = [] intersections = []
if snap_point["type"] == "Face": 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: 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: if not intersections:
x_axis = tool.Polyline.use_transform_orientations(Vector((1, 0, 0))) x_axis = tool.Polyline.use_transform_orientations(Vector((1, 0, 0)))
y_axis = tool.Polyline.use_transform_orientations(Vector((0, 1, 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] face_index = result[2]
if hit is not None: if hit is not None:
# Wireframes # 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) snap_points = tool.Raycast.ray_cast_by_proximity(context, event, snap_obj)
if snap_points: if snap_points:
for point in snap_points: for point in snap_points: