Skip to content

DYN-10416: Cleanup frozen geometry when the parent node is deleted#17069

Merged
zeusongit merged 1 commit into
DynamoDS:masterfrom
zeusongit:10416
Apr 22, 2026
Merged

DYN-10416: Cleanup frozen geometry when the parent node is deleted#17069
zeusongit merged 1 commit into
DynamoDS:masterfrom
zeusongit:10416

Conversation

@zeusongit

@zeusongit zeusongit commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

Purpose

Cause:

The guard was added in 2015 for a re-evaluation scenario: when a frozen node's graph re-runs, RemoveGeometryForUpdatedPackages calls DeleteGeometryForIdentifier to pre-clear geometry before writing new render packages — the frozen guard correctly prevents wiping cached geometry that won't be regenerated. But the same DeleteGeometries is called by DeleteGeometryForNode when the node is actually removed from the workspace, which is a completely different scenario where geometry must always be cleaned up.

Added a forceDelete parameter to DeleteGeometries so frozen GeometryModel3D instances are skipped during normal re-evaluation but can be removed when a node is permanently deleted.
Update DeleteGeometryForNode to call DeleteGeometries with forceDelete:true.

Added a test WhenFrozenNodeIsDeletedThenItsGeometryIsCleared to ensure deleting a frozen node clears its geometry from the background preview.

This preserves frozen visuals during routine updates while ensuring cleanup on node removal.

Declarations

Check these if you believe they are true

Release Notes

Cleanup frozen geometry when the parent node is deleted

Add a forceDelete parameter to DeleteGeometries so frozen GeometryModel3D instances are skipped during normal re-evaluation but can be removed when a node is permanently deleted. Update DeleteGeometryForNode to call DeleteGeometries with forceDelete:true. Add a test WhenFrozenNodeIsDeletedThenItsGeometryIsCleared to ensure deleting a frozen node clears its geometry from the background preview. This preserves frozen visuals during routine updates while ensuring cleanup on node removal.
@zeusongit zeusongit requested review from a team and Copilot April 21, 2026 19:05

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-10416

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Ensures background preview geometry for frozen nodes is still cleaned up when the node is permanently deleted, while preserving the existing behavior of keeping frozen visuals during normal re-evaluation.

Changes:

  • Added a forceDelete option to the internal geometry deletion routine so frozen geometry can be removed on node deletion.
  • Updated DeleteGeometryForNode to force-delete geometries for the removed node.
  • Added a visualization test to validate frozen-node deletion clears background preview meshes.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
test/VisualizationTests/HelixWatch3DViewModelTests.cs Adds regression test asserting frozen node deletion clears preview geometry.
src/DynamoCoreWpf/ViewModels/Watch3D/HelixWatch3DViewModel.cs Introduces forceDelete path so frozen geometry isn’t skipped during node removal.

@sonarqubecloud

Copy link
Copy Markdown

Comment thread src/DynamoCoreWpf/ViewModels/Watch3D/HelixWatch3DViewModel.cs
@zeusongit zeusongit merged commit a7ceb82 into DynamoDS:master Apr 22, 2026
34 of 36 checks passed
{
var geometryModels = FindAllGeometryModel3DsForNode(node);
DeleteGeometries(geometryModels, requestUpdate);
DeleteGeometries(geometryModels, requestUpdate, forceDelete: true);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Who else is calling DeleteGeometries? If nobody else, then we can just have the new default argument equal true.

var nodeToDelete = Model.CurrentWorkspace.Nodes
.First(x => x.Name.Contains("ByGeometryColor"));
nodeToDelete.IsFrozen = true;
DispatcherUtil.DoEvents();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be good to validate here that the number of meshes is still greater than zero at this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants