From 181136533b0b1a83ca8805a48f2ebbe8776d80e6 Mon Sep 17 00:00:00 2001 From: Murray Stevenson <50844517+murraystevenson@users.noreply.github.com> Date: Tue, 19 Sep 2023 17:12:45 -0700 Subject: [PATCH] fixup! SetEditor : Add VisibleSet Inclusions and Exclusions columns --- src/GafferSceneUIModule/SetEditorBinding.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/GafferSceneUIModule/SetEditorBinding.cpp b/src/GafferSceneUIModule/SetEditorBinding.cpp index fdcd8c92cbf..c3ae36e103a 100644 --- a/src/GafferSceneUIModule/SetEditorBinding.cpp +++ b/src/GafferSceneUIModule/SetEditorBinding.cpp @@ -550,11 +550,14 @@ class VisibleSetInclusionsColumn : public PathColumn const auto selectedPaths = std::get( 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( 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() ); } } } @@ -757,13 +760,19 @@ class VisibleSetExclusionsColumn : public PathColumn const auto selection = widget.getSelection(); if( std::holds_alternative( 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( 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( selectedSetPath->property( g_setNamePropertyName ) ); + if( selectedSetName && selectedSetName->readable() != setName->readable() ) + { + pathsToExclude.addPaths( setPath->getScene()->set( selectedSetName->readable() )->readable() ); + } } } }