[WIP] DYN-10601 Fix Background 3D Preview export crash on large graphs#17160
Closed
johnpierson wants to merge 5 commits into
Closed
[WIP] DYN-10601 Fix Background 3D Preview export crash on large graphs#17160johnpierson wants to merge 5 commits into
johnpierson wants to merge 5 commits into
Conversation
Replace the redundant double-bitmap export path with a single RenderBitmap capture, cap export resolution, and handle failures gracefully instead of crashing Dynamo. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-10601
Measure workspace export bounds before creating the RenderTargetBitmap so oversized graphs are rejected without allocating an unsafe bitmap. Restore the workspace transform after rendering and add a UI regression test that verifies oversized workspace exports are refused without writing a file.
Keep Background 3D Preview export failures quiet while preserving failure state and logging. The oversized workspace export warning remains limited to workspace image export.
Route explicit Background 3D Preview image exports directly to the save flow so large workspace bounds do not trigger the nodes-too-far-apart warning. Keep workspace validation in place for workspace image exports.
Capture the current 3D preview before applying the export size cap so Helix does not render from a just-resized, empty back buffer on large graph exports. Add a regression test that forces scaled background preview export and verifies the PNG contains varied image data instead of only checking that a file was written.
|
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.



Purpose
DYN-10601: Fix Dynamo crashing when exporting the Background 3D Preview as an image on complex graphs (e.g. Manekin-0.50). Related to DYN-10596.
The export path introduced during the Helix upgrade allocated two full-resolution bitmaps per export:
RenderBitmap()(discarded after reading dimensions) plus a secondRenderTargetBitmap.Render()pass. On large graphs and high-DPI displays this could exhaust memory and crash Dynamo/Revit.Key changes:
Watch3DImageExporterto capture the viewport via a singleRenderBitmap()call and save directly to PNGOutOfMemoryExceptionand other failures and show a toast instead of crashingBackgroundPreviewExportTestsDeclarations
Release Notes
Fixed a crash when exporting the Background 3D Preview as an image on graphs with large amounts of geometry.
Reviewers
(FILL ME IN)
FYIs
Manual validation with the Manekin-0.50 graph from DYN-10601 is recommended before merge.
Test plan
dotnet test test/VisualizationTests/WpfVisualizationTests.csproj --filter Name~BackgroundPreviewExport