Fix ReferenceError in update_bbox_accumulation

Guard against objects that have already been removed from
Blender's data (StructRNA removed) before the function runs.
This occurs when switch_representation is called on temporary
annotation objects that are freed before returning.

Generated with the assistance of an AI coding tool.
This commit is contained in:
Ryan Schultz
2026-03-19 12:10:34 -05:00
parent 9d2e25aa4e
commit 3d99ff709c
+4 -1
View File
@@ -2477,7 +2477,10 @@ class Geometry(bonsai.core.tool.Geometry):
Stores the union of all representation bboxes ever loaded for this object as
``obj["ifc_bbox_min"]`` and ``obj["ifc_bbox_max"]`` in object-local space.
"""
if not obj.bound_box:
try:
if not obj.bound_box:
return
except ReferenceError:
return
corners = obj.bound_box
xs = [v[0] for v in corners]