Skip to content

Commit

Permalink
fixup! SetEditor : Add VisibleSet Inclusions and Exclusions columns
Browse files Browse the repository at this point in the history
  • Loading branch information
murraystevenson committed Sep 20, 2023
1 parent e873517 commit 1811365
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/GafferSceneUIModule/SetEditorBinding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -550,11 +550,14 @@ class VisibleSetInclusionsColumn : public PathColumn
const auto selectedPaths = std::get<IECore::PathMatcher>( selection );
if( selectedPaths.match( setPath->names() ) & IECore::PathMatcher::Result::ExactMatch )
{
auto selectedSetPath = setPath->copy();
for( IECore::PathMatcher::Iterator it = selectedPaths.begin(), eIt = selectedPaths.end(); it != eIt; ++it )
{
if( it->back() != setName->readable() )
selectedSetPath->setFromString( ScenePlug::pathToString( *it ) );
const auto selectedSetName = runTimeCast<const IECore::StringData>( selectedSetPath->property( g_setNamePropertyName ) );
if( selectedSetName && selectedSetName->readable() != setName->readable() )
{
pathsToInclude.addPaths( setPath->getScene()->set( it->back() )->readable() );
pathsToInclude.addPaths( setPath->getScene()->set( selectedSetName->readable() )->readable() );
}
}
}
Expand Down Expand Up @@ -757,13 +760,19 @@ class VisibleSetExclusionsColumn : public PathColumn
const auto selection = widget.getSelection();
if( std::holds_alternative<IECore::PathMatcher>( selection ) )
{
// Permit bulk editing of a selection of paths when clicking on one of the selected paths
// Permit bulk editing of a selection of set names when clicking on one of the selected set names
const auto selectedPaths = std::get<IECore::PathMatcher>( selection );
if( selectedPaths.match( setPath->names() ) & IECore::PathMatcher::Result::ExactMatch )
{
auto selectedSetPath = setPath->copy();
for( IECore::PathMatcher::Iterator it = selectedPaths.begin(), eIt = selectedPaths.end(); it != eIt; ++it )
{
pathsToExclude.addPaths( setPath->getScene()->set( it->back() )->readable() );
selectedSetPath->setFromString( ScenePlug::pathToString( *it ) );
const auto selectedSetName = runTimeCast<const IECore::StringData>( selectedSetPath->property( g_setNamePropertyName ) );
if( selectedSetName && selectedSetName->readable() != setName->readable() )
{
pathsToExclude.addPaths( setPath->getScene()->set( selectedSetName->readable() )->readable() );
}
}
}
}
Expand Down

0 comments on commit 1811365

Please sign in to comment.