Skip to content

Commit

Permalink
BUG: Fix GetStorableNodesModifiedSinceRead for short text nodes
Browse files Browse the repository at this point in the history
If a vtkMRMLTextNode contains short text then it does not use a storage node to store that to avoid creating many small text nodes.
However, the vtkMRMLScene::GetStorableNodesModifiedSinceRead method detected a storable node that does not have a storage node as a node that has storable content modified.
Therefore it always returned "true" if a text node with short text was present in the scene, triggering unnecessary warning popups on scene close or exit.

Fixed the logic in vtkMRMLScene::GetStorableNodesModifiedSinceRead to correctly handle storable nodes that do not need storage nodes.
  • Loading branch information
lassoan committed Oct 19, 2024
1 parent 625238a commit e6fad7e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Libs/MRML/Core/vtkMRMLScene.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -3744,6 +3744,12 @@ ::GetStorableNodesModifiedSinceRead(vtkCollection* modifiedStorableNodes)
if (!storableNode->GetHideFromEditors() &&
storableNode->GetModifiedSinceRead())
{
if (!storableNode->GetStorageNode() && storableNode->GetDefaultStorageNodeClassName().empty())
{
// The storable node does not have a storage node, but it does not need one (because content is stored in the scene
// (for example vtkMRMLTextNode containing short text).
continue;
}
found = true;
if (modifiedStorableNodes)
{
Expand Down

0 comments on commit e6fad7e

Please sign in to comment.