Files
Petru Conduraru 6080409c63 Fix ci-bonsai-daily: classification operators honor obj argument
Four classification operators (AddManualClassificationReference,
RemoveClassificationReference, AddClassificationReference,
AddClassificationReferenceFromBSDD) ignored their own obj
StringProperty in the obj_type == "Object" branch and used
context.selected_objects / context.active_object instead. But
bim.assign_class runs first and clears/replaces the selection (it
recreates the object for IfcElementType targets), so active_object is
None by the time these operators run - which is why the BDD scenarios
pass obj='IfcWallType/Cube' explicitly. The operators just never read it,
so they crashed on context.active_object.name being None.

Apply the same precedence AssignClass itself uses: explicit self.obj
first, then selected objects, then a guarded active_object, else empty
(which already no-ops via the `if products:` guard). Fixes the crash and
makes the operators honor the passed argument.

Verified in headless Blender: the 5 classification BDD scenarios
(add/enable-editing/disable-editing/remove/edit classification reference)
go from 5 failed to passing (6 passed incl. sibling).

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

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-12 22:52:08 +03:00
..
2026-02-27 14:52:55 +05:00
2026-01-26 17:13:18 +05:00
2026-02-27 14:52:55 +05:00
2025-12-19 18:53:14 +05:00
2025-12-19 18:53:14 +05:00
2025-12-22 18:44:42 +05:00
2025-12-19 18:53:14 +05:00
2025-12-22 18:44:42 +05:00