Fix #6363. Improve how Curves are handled by the snapping system.

This commit is contained in:
Bruno Perdigão
2025-03-14 21:43:26 -03:00
parent 7e42b10159
commit 615ca24825
2 changed files with 3 additions and 8 deletions
+2
View File
@@ -204,6 +204,8 @@ class Raycast(bonsai.core.tool.Raycast):
}
points.append(snap_point)
return points
if obj and obj.type == "CURVE":
obj = bpy.data.objects.new("new_object", obj.to_mesh().copy())
if not custom_bmesh:
bm = bmesh.new()
+1 -8
View File
@@ -358,20 +358,13 @@ class Snap(bonsai.core.tool.Snap):
face_index = result[2]
if hit is not None:
# Wireframes
if snap_obj.type == "EMPTY" 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:
point["group"] = "Wireframe"
detected_snaps.append(point)
elif snap_obj.type == "CURVE":
new_object = bpy.data.objects.new("new_object", obj.to_mesh().copy())
snap_points = tool.Raycast.ray_cast_by_proximity(context, event, new_object)
if snap_points:
for point in snap_points:
point["group"] = "Wireframe"
detected_snaps.append(point)
# Meshes
else:
# Add face snap