Skip to content

Commit

Permalink
CollectScenes : Check for cancellation while building RootTree
Browse files Browse the repository at this point in the history
  • Loading branch information
johnhaddon committed Jul 3, 2023
1 parent 149cd3f commit 0516164
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Improvements
- MatchPatternPathFilterWidget : Added the name of the property being filtered to the placeholder text.
- OpenImageIOReader : The `availableFrames` plug no longer errors for a missing file sequence - instead it outputs an empty list.
- PathListingWidget : Header data is now computed asynchronously, without locking the UI.
- CollectScenes : Improved cancellation responsiveness for large lists of `rootNames`.

Fixes
-----
Expand Down
6 changes: 4 additions & 2 deletions src/GafferScene/CollectScenes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,14 @@ class RootTree : public IECore::Data

};

RootTree( const IECore::StringVectorData *roots )
RootTree( const IECore::StringVectorData *roots, const IECore::Canceller *canceller )
: m_treeRoot( new Location( 0 ) )
{
ScenePlug::ScenePath path;
for( const auto &root : roots->readable() )
{
IECore::Canceller::check( canceller );

ScenePlug::stringToPath( root, path );
if( path.empty() )
{
Expand Down Expand Up @@ -415,7 +417,7 @@ void CollectScenes::compute( Gaffer::ValuePlug *output, const Gaffer::Context *c
{
ConstStringVectorDataPtr roots = rootNamesPlug()->getValue();
static_cast<ObjectPlug *>( output )->setValue(
new RootTree( roots.get() )
new RootTree( roots.get(), context->canceller() )
);
return;
}
Expand Down

0 comments on commit 0516164

Please sign in to comment.