Debug drawing faster failure search#8228
Open
theoryshaw wants to merge 5 commits into
Open
Conversation
Fix failure detection by switching from `except Exception` to checking the return value, then back to `except Exception` once it was confirmed that `bpy.ops` re-raises inside another operator. Identify the drawing via the active scene camera (consistent with CreateDrawing) to avoid the `ifc_definition_id=0` crash on non-drawing list entries. Improve the binary search to test each candidate in isolation, enabling multiple independent failures to be found in one pass. Suppress drawing-generation log noise during tests and print a clean summary with element id, type, and name. Add a `should_export_isolated_file` operator property that extracts the failing elements into a minimal standalone IFC file using ExtractElements, making it easy to attach a reproduction case when filing a bug report. Generated with the assistance of an AI coding tool.
When a drawing fails to generate (e.g. an annotation with a runaway coordinate that makes project_point_onto_camera return None), surface an actionable error instead of a raw traceback, and make the search for the offending element much faster. drawing/operator.py: - Wrap CreateDrawing.execute so any failure prints the full traceback (still consumed by debug_active_drawing) and reports a clear message pointing users at "Search Active Drawing For Failing Elements". - Add should_generate_underlay/linework/annotation toggles so the generation stages can be run independently. debug/operator.py: - Detect which stage (underlay/linework/annotation) reproduces the failure and bisect with only that stage, skipping the expensive underlay render and OpenCASCADE linework on every iteration. - Add a console spinner (background thread, writes to the real stdout) so long silent waits no longer look frozen. - Include the GlobalId in element labels. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
# Conflicts: # src/bonsai/bonsai/bim/module/drawing/operator.py
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.