Compare commits

...

1 Commits

Author SHA1 Message Date
Petru Conduraru a197a1b909 Fix ci-bonsai-daily: get_linked_element_geom_slice uses hidden-shifted index space
get_linked_element_geom_slice slices into the mesh polygon index space
that excludes hidden faces, but built its cumulative guid_ids with
get_linked_element_guid_ids(obj, skip_hidden=False) - the raw,
un-shifted index space - so the returned slice was wrong whenever any
face was hidden. The sibling call two lines up (get_guid_by_face_index)
already uses skip_hidden=True; align this one.

Verified in headless Blender: test/tool/test_project.py::TestGettingLinkedElementGeomSlice
goes from 2 failed / 3 passed to 5 passed (the two skip_hidden cases now
return the correct slice).

This change was made with the assistance of an AI tool.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-12 22:25:26 +03:00
+1 -1
View File
@@ -745,7 +745,7 @@ class Project(bonsai.core.tool.Project):
index = obj_guids.index(guid)
if index in obj_hidden_indices:
assert False, "Unexpected. Why would you need the geometry for the hidden element?"
obj_guid_ids = cls.get_linked_element_guid_ids(obj, skip_hidden=False)
obj_guid_ids = cls.get_linked_element_guid_ids(obj, skip_hidden=True)
guid_end_index = obj_guid_ids[index]
guid_start_index = index and obj_guid_ids[index - 1]
return slice(guid_start_index, guid_end_index)