mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-19 19:54:07 +00:00
Bonsai: migrate viewport decorators onto canonical base
Migrate 17 legacy viewport decorators (ClashDecorator, SolarDecorator, MeasureDecorator, ItemDecorator, GeoreferenceDecorator, NestDecorator, NestModeDecorator, GridDecorator, LoadsDecorator, AggregateDecorator, AggregateModeDecorator, PolylineDecorator, ProductDecorator, WallAxisDecorator, SlabDirectionDecorator, FaceAreaDecorator, BoundingBoxDecorator) from hand-rolled install/uninstall lifecycles onto the canonical tool.Blender.ViewportDecorator base. The legacy uninstall removed each handler from Blender but never cleared cls.handlers, growing a stale-reference list across enable/disable cycles. The base's uninstall clears the list correctly. State-derived install methods (ItemDecorator, ProductDecorator, LoadsDecorator, PolylineDecorator) keep an install override per the base's documented contract. Drop the now-redundant per-class draw_batch copies and the module- or method-scope transparent_color defs in favour of the base helpers introduced in the preceding commit. system/decorator.py and boundary/decorator.py keep their installed-flag lifecycle (different pattern, no leak) but consume tool.Blender.transparent_color. Add an AST forward-compat guard pinning the contract structurally: any class declaring handlers = [] (Assign or AnnAssign) must subclass tool.Blender.ViewportDecorator. Add a runtime regression on ClashDecorator's install/uninstall cycle. Generated with the assistance of an AI coding tool.
This commit is contained in:
@@ -7,9 +7,11 @@ markers =
|
||||
boundary
|
||||
brick
|
||||
bsdd
|
||||
clash
|
||||
classification
|
||||
clip_box
|
||||
context
|
||||
contract_guard
|
||||
cost
|
||||
covering
|
||||
debug
|
||||
|
||||
Reference in New Issue
Block a user