This commit is contained in:
Andrej730
2025-03-13 18:43:14 +05:00
parent 609f468ce1
commit ef67d866b6
3 changed files with 13 additions and 7 deletions
@@ -35,13 +35,14 @@ class LoadGroups(bpy.types.Operator, tool.Ifc.Operator):
self.expanded_groups = json.loads(context.scene.ExpandedGroups.json_string)
self.props.groups.clear()
groups = [group for group in tool.Ifc.get().by_type("IfcGroup", include_subtypes=False) if not group.HasAssignments]
groups = [
group for group in tool.Ifc.get().by_type("IfcGroup", include_subtypes=False) if not group.HasAssignments
]
sorted_groups = sorted(groups, key=lambda group: group.Name or "Unnamed")
for group in sorted_groups:
self.load_group(group)
self.props.is_editing = True
bpy.ops.bim.disable_editing_group()
return {"FINISHED"}
@@ -54,7 +55,12 @@ class LoadGroups(bpy.types.Operator, tool.Ifc.Operator):
new.has_children = False
new.is_expanded = group.id() in self.expanded_groups
related_groups = [related_object for rel in group.IsGroupedBy or [] for related_object in rel.RelatedObjects if related_object.is_a("IfcGroup")]
related_groups = [
related_object
for rel in group.IsGroupedBy or []
for related_object in rel.RelatedObjects
if related_object.is_a("IfcGroup")
]
sorted_related_groups = sorted(related_groups, key=lambda group: group.Name or "Unnamed")
for related_group in sorted_related_groups:
+2 -2
View File
@@ -331,7 +331,7 @@ class Snap(bonsai.core.tool.Snap):
hit = None
face_index = None
# Wireframes
if obj.type in {"EMPTY", "CURVE"} or (hasattr(obj.data, "polygons") and len(obj.data.polygons) == 0) :
if obj.type in {"EMPTY", "CURVE"} or (hasattr(obj.data, "polygons") and len(obj.data.polygons) == 0):
snap_points = tool.Raycast.ray_cast_by_proximity(context, event, obj)
if snap_points:
hit = sorted(snap_points, key=lambda x: x["distance"])[0]["point"]
@@ -569,7 +569,7 @@ class Snap(bonsai.core.tool.Snap):
snap["distance"] *= weight_factor / 5
if snap["type"] == "Edge Intersection":
snap["distance"] *= weight_factor / 10
if snap["type"] in ["Plane", "Axis", "Face"]:
if snap["type"] in ["Plane", "Axis", "Face"]:
snap["distance"] = weight_factor / 50
return sorted(snapping_points, key=lambda x: x["distance"])
+2 -2
View File
@@ -344,13 +344,13 @@ class System(bonsai.core.tool.System):
edge_ortho = obj.matrix_world.col[j].to_3d().normalized()
second_ortho = edge_dir.cross(edge_ortho)
edge_ortho = second_ortho.cross(edge_dir)
# direction lines should be around the edge center
n_direction_lines, start_offset = divmod(edge_length, direction_lines_offset)
n_direction_lines = int(n_direction_lines) + 1
start_offset /= 2
start_offset = edge_dir * start_offset + base_vert
if both_directions:
cur_vert_index = start_vert_i + len(port_data) + j * 2 * n_direction_lines
else: