From 53084ca94ca82dd38cd37194d801bf6482533518 Mon Sep 17 00:00:00 2001 From: CyrilWaechter Date: Sun, 2 Aug 2026 00:12:08 +0200 Subject: [PATCH] Fix covering operators to unpack tuple return from get_space_polygon_from_context_visible_objects Three covering core functions (add_instance_flooring_covering_from_cursor, add_instance_ceiling_covering_from_cursor, regen_selected_covering_object) used the old single-value assignment from get_space_polygon_from_context_visible_objects, which now returns a (polygon, bounding_walls) tuple. The isinstance(str) guard never fired, causing the tuple to flow into set_covering_representation_from_polygon and raise a shapely error. Fix by unpacking space_polygon, _ at all three call sites. Generated with the assistance of an AI coding tool. --- src/bonsai/bonsai/core/covering.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bonsai/bonsai/core/covering.py b/src/bonsai/bonsai/core/covering.py index b23cdd7229..336432587d 100644 --- a/src/bonsai/bonsai/core/covering.py +++ b/src/bonsai/bonsai/core/covering.py @@ -46,7 +46,7 @@ def add_instance_flooring_covering_from_cursor( else: x, y, z, h, mat = spatial.get_x_y_z_h_mat_from_cursor() - space_polygon = spatial.get_space_polygon_from_context_visible_objects(x, y) + space_polygon, _ = spatial.get_space_polygon_from_context_visible_objects(x, y) if isinstance(space_polygon, str): return @@ -81,7 +81,7 @@ def add_instance_ceiling_covering_from_cursor( x, y, z, h, mat = spatial.get_x_y_z_h_mat_from_cursor() ceiling_height = covering.get_z_from_ceiling_height() - space_polygon = spatial.get_space_polygon_from_context_visible_objects(x, y) + space_polygon, _ = spatial.get_space_polygon_from_context_visible_objects(x, y) if isinstance(space_polygon, str): return @@ -106,7 +106,7 @@ def regen_selected_covering_object(root: type[tool.Root], spatial: type[tool.Spa else: assert False, "Object has to be active and selected." - space_polygon = spatial.get_space_polygon_from_context_visible_objects(x, y) + space_polygon, _ = spatial.get_space_polygon_from_context_visible_objects(x, y) if isinstance(space_polygon, str): return