Skip to content

Commit

Permalink
Inspector : Use "edit scope" in noneditable reasons
Browse files Browse the repository at this point in the history
As EditScope nodes are often named "EditScope#", we now refer to an "edit scope" to prevent sentences full of "EditScope". Preferring "The target edit scope EditScope..." to "The target EditScope (EditScope)...".
  • Loading branch information
murraystevenson committed Sep 18, 2024
1 parent ab1f7c3 commit c4ddc45
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
10 changes: 5 additions & 5 deletions python/GafferSceneUITest/AttributeInspectorTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def testSourceAndEdits( self ) :
source = s["light"]["visualiserAttributes"]["scale"],
sourceType = SourceType.Other,
editable=False,
nonEditableReason = "The target EditScope (editScope1) is not in the scene history."
nonEditableReason = "The target edit scope editScope1 is not in the scene history."
)

# If it is in the history though, and we're told to use it, then we will.
Expand Down Expand Up @@ -369,7 +369,7 @@ def testSourceAndEdits( self ) :
source = independentAttributeTweakPlug,
sourceType = SourceType.Downstream,
editable = False,
nonEditableReason = "The target EditScope (editScope2) is disabled."
nonEditableReason = "The target edit scope editScope2 is disabled."
)

s["editScope2"]["enabled"].setValue( True )
Expand Down Expand Up @@ -455,7 +455,7 @@ def testEditScopeNotInHistory( self ) :
source = light["visualiserAttributes"]["scale"],
sourceType = SourceType.Other,
editable = False,
nonEditableReason = "The target EditScope (EditScope) is not in the scene history."
nonEditableReason = "The target edit scope EditScope is not in the scene history."
)

self.__assertExpectedResult(
Expand All @@ -471,7 +471,7 @@ def testEditScopeNotInHistory( self ) :
source = attributeTweaks["tweaks"][0],
sourceType = SourceType.Other,
editable = False,
nonEditableReason = "The target EditScope (EditScope) is not in the scene history."
nonEditableReason = "The target edit scope EditScope is not in the scene history."
)

def testDisabledTweaks( self ) :
Expand Down Expand Up @@ -893,7 +893,7 @@ def testDisableEdit( self ) :

inspection = self.__inspect( s["editScope1"]["out"], "/group/light", "gl:visualiser:scale", s["editScope2"] )
self.assertFalse( inspection.canDisableEdit() )
self.assertEqual( inspection.nonDisableableReason(), "The target EditScope (editScope2) is not in the scene history." )
self.assertEqual( inspection.nonDisableableReason(), "The target edit scope editScope2 is not in the scene history." )

inspection = self.__inspect( s["editScope2"]["out"], "/group/light", "gl:visualiser:scale", s["editScope2"] )
self.assertFalse( inspection.canDisableEdit() )
Expand Down
10 changes: 5 additions & 5 deletions python/GafferSceneUITest/OptionInspectorTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def testSourceAndEdits( self ) :
source = s["standardOptions"]["options"]["renderCamera"],
sourceType = SourceType.Other,
editable = False,
nonEditableReason = "The target EditScope (editScope1) is not in the scene history."
nonEditableReason = "The target edit scope editScope1 is not in the scene history."
)

# If it is in the history though, and we're told to use it, then we will.
Expand Down Expand Up @@ -285,7 +285,7 @@ def testSourceAndEdits( self ) :
source = s["independentOptions"]["options"]["renderCamera"],
sourceType = SourceType.Downstream,
editable = False,
nonEditableReason = "The target EditScope (editScope2) is disabled."
nonEditableReason = "The target edit scope editScope2 is disabled."
)

s["editScope2"]["enabled"].setValue( True )
Expand Down Expand Up @@ -561,7 +561,7 @@ def testRenderPassSourceAndEdits( self ) :
source = s["standardOptions"]["options"]["renderCamera"],
sourceType = SourceType.Other,
editable = False,
nonEditableReason = "The target EditScope (editScope1) is not in the scene history."
nonEditableReason = "The target edit scope editScope1 is not in the scene history."
)

# If it is in the history though, and we're told to use it, then we will.
Expand Down Expand Up @@ -684,7 +684,7 @@ def testRenderPassSourceAndEdits( self ) :
source = s["independentOptions"]["options"]["renderCamera"],
sourceType = SourceType.Downstream,
editable = False,
nonEditableReason = "The target EditScope (editScope2) is disabled."
nonEditableReason = "The target edit scope editScope2 is disabled."
)

s["editScope2"]["enabled"].setValue( True )
Expand Down Expand Up @@ -967,7 +967,7 @@ def testDisableEdit( self ) :

inspection = self.__inspect( s["editScope1"]["out"], "render:camera", s["editScope2"] )
self.assertFalse( inspection.canDisableEdit() )
self.assertEqual( inspection.nonDisableableReason(), "The target EditScope (editScope2) is not in the scene history." )
self.assertEqual( inspection.nonDisableableReason(), "The target edit scope editScope2 is not in the scene history." )

inspection = self.__inspect( s["editScope2"]["out"], "render:camera", s["editScope2"] )
self.assertFalse( inspection.canDisableEdit() )
Expand Down
10 changes: 5 additions & 5 deletions python/GafferSceneUITest/ParameterInspectorTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def testSourceAndEdits( self ) :
self.__assertExpectedResult(
self.__inspect( s["group"]["out"], "/group/light", "intensity", s["editScope1"] ),
source = s["light"]["parameters"]["intensity"], sourceType = SourceType.Other,
editable = False, nonEditableReason = "The target EditScope (editScope1) is not in the scene history."
editable = False, nonEditableReason = "The target edit scope editScope1 is not in the scene history."
)

# If it is in the history though, and we're told to use it, then we will.
Expand Down Expand Up @@ -302,7 +302,7 @@ def testSourceAndEdits( self ) :
self.__assertExpectedResult(
self.__inspect( s["independentLightTweak"]["out"], "/group/light", "intensity", s["editScope2"] ),
source = independentLightTweakPlug, sourceType = SourceType.Downstream,
editable = False, nonEditableReason = "The target EditScope (editScope2) is disabled."
editable = False, nonEditableReason = "The target edit scope editScope2 is disabled."
)

s["editScope2"]["enabled"].setValue( True )
Expand Down Expand Up @@ -378,7 +378,7 @@ def testEditScopeNotInHistory( self ) :
self.__assertExpectedResult(
self.__inspect( light["out"], "/light", "exposure", editScope ),
source = light["parameters"]["exposure"], sourceType = SourceType.Other,
editable = False, nonEditableReason = "The target EditScope (EditScope) is not in the scene history."
editable = False, nonEditableReason = "The target edit scope EditScope is not in the scene history."
)

self.__assertExpectedResult(
Expand All @@ -390,7 +390,7 @@ def testEditScopeNotInHistory( self ) :
self.__assertExpectedResult(
self.__inspect( shaderTweaks["out"], "/light", "exposure", editScope ),
source = shaderTweaks["tweaks"][0], sourceType = SourceType.Other,
editable = False, nonEditableReason = "The target EditScope (EditScope) is not in the scene history."
editable = False, nonEditableReason = "The target edit scope EditScope is not in the scene history."
)

def testAcquireEditCreateIfNecessary( self ) :
Expand Down Expand Up @@ -467,7 +467,7 @@ def testDisableEdit( self ) :

inspection = self.__inspect( s["editScope"]["out"], "/light", "exposure", s["editScope2"] )
self.assertFalse( inspection.canDisableEdit() )
self.assertEqual( inspection.nonDisableableReason(), "The target EditScope (editScope2) is not in the scene history." )
self.assertEqual( inspection.nonDisableableReason(), "The target edit scope editScope2 is not in the scene history." )

inspection = self.__inspect( s["editScope2"]["out"], "/light", "exposure", s["editScope2"] )
self.assertFalse( inspection.canDisableEdit() )
Expand Down
4 changes: 2 additions & 2 deletions python/GafferSceneUITest/SetMembershipInspectorTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def testSourceAndEdits( self ) :
source = s["plane"]["sets"],
sourceType = SourceType.Other,
editable = False,
nonEditableReason = "The target EditScope (editScope1) is not in the scene history."
nonEditableReason = "The target edit scope editScope1 is not in the scene history."
)

# If it is in the history though, and we're told to use it, then we will.
Expand Down Expand Up @@ -329,7 +329,7 @@ def testSourceAndEdits( self ) :
source = s["independentSet"]["name"],
sourceType = SourceType.Downstream,
editable = False,
nonEditableReason = "The target EditScope (editScope2) is disabled."
nonEditableReason = "The target edit scope editScope2 is disabled."
)

s["editScope2"]["enabled"].setValue( True )
Expand Down
4 changes: 2 additions & 2 deletions src/GafferSceneUI/Inspector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ Inspector::ResultPtr Inspector::inspect() const
if( result->editScope() && !result->m_editScopeInHistory )
{
const std::string nonEditableReason = fmt::format(
"The target EditScope ({}) is not in the scene history.",
"The target edit scope {} is not in the scene history.",
result->editScope()->relativeName( result->editScope()->scriptNode() )
);
result->m_editFunction = nonEditableReason;
Expand Down Expand Up @@ -357,7 +357,7 @@ void Inspector::inspectHistoryWalk( const GafferScene::SceneAlgo::History *histo
else
{
result->m_editFunction = fmt::format(
"The target EditScope ({}) is disabled.",
"The target edit scope {} is disabled.",
editScope->relativeName( editScope->scriptNode() )
);
}
Expand Down

0 comments on commit c4ddc45

Please sign in to comment.