diff --git a/Changes.md b/Changes.md index fbc3e0e39c6..2424d73bab2 100644 --- a/Changes.md +++ b/Changes.md @@ -6,6 +6,7 @@ Breaking Changes - Dispatcher : Removed `createMatching()` method. - Process : Removed non-const variant of the `handleException()` method. +- StringPlug : Remove deprecated `precomputedHash` argument from `getValue()` method. 1.3.x.x (relative to 1.3.3.0) ======= diff --git a/include/Gaffer/StringPlug.h b/include/Gaffer/StringPlug.h index 3a9eb61b958..2240a3593b5 100644 --- a/include/Gaffer/StringPlug.h +++ b/include/Gaffer/StringPlug.h @@ -118,10 +118,8 @@ class GAFFER_API StringPlug : public ValuePlug /// > (which would be `\` on Windows). /// \undoable void setValue( const std::filesystem::path &value ); - /// Returns the value. The `precomputedHash` argument is deprecated, and - /// will be removed in a future release. - /// \todo Remove `precomputedHash` argument. - std::string getValue( const IECore::MurmurHash *precomputedHash = nullptr ) const; + /// Returns the value. + std::string getValue() const; void setFrom( const ValuePlug *other ) override; diff --git a/python/GafferTest/StringPlugTest.py b/python/GafferTest/StringPlugTest.py index a546733f1e0..f34edd9e708 100644 --- a/python/GafferTest/StringPlugTest.py +++ b/python/GafferTest/StringPlugTest.py @@ -304,13 +304,11 @@ def testSubstitutionsFromExpressionInput( self ) : self.assertEqual( s["substitionsOn"]["out"].getValue(), "test.1.exr" ) substitutionsOnHash1 = s["substitionsOn"]["out"].hash() - self.assertEqual( s["substitionsOn"]["out"].getValue( _precomputedHash = substitutionsOnHash1 ), "test.1.exr" ) # We should get sequences out of the non-substituting node. self.assertEqual( s["substitionsOff"]["out"].getValue(), "test.#.exr" ) substitutionsOffHash1 = s["substitionsOff"]["out"].hash() - self.assertEqual( s["substitionsOff"]["out"].getValue( _precomputedHash = substitutionsOffHash1 ), "test.#.exr" ) self.assertNotEqual( substitutionsOnHash1, substitutionsOffHash1 ) # We shouldn't get frame numbers out of the third node, because the @@ -320,7 +318,6 @@ def testSubstitutionsFromExpressionInput( self ) : self.assertEqual( s["substitionsOnIndirectly"]["out"].getValue(), "test.#.exr" ) substitionsOnIndirectlyHash1 = s["substitionsOnIndirectly"]["out"].hash() - self.assertEqual( s["substitionsOnIndirectly"]["out"].getValue( _precomputedHash = substitionsOnIndirectlyHash1 ), "test.#.exr" ) # Frame 2 ######### @@ -339,7 +336,6 @@ def testSubstitutionsFromExpressionInput( self ) : self.assertEqual( s["substitionsOn"]["out"].getValue(), "test.2.exr" ) substitutionsOnHash2 = s["substitionsOn"]["out"].hash() - self.assertEqual( s["substitionsOn"]["out"].getValue( _precomputedHash = substitutionsOnHash2 ), "test.2.exr" ) self.assertNotEqual( substitutionsOnHash2, substitutionsOnHash1 ) # We should still get sequences out of the non-substituting node, @@ -347,7 +343,6 @@ def testSubstitutionsFromExpressionInput( self ) : self.assertEqual( s["substitionsOff"]["out"].getValue(), "test.#.exr" ) substitutionsOffHash2 = s["substitionsOff"]["out"].hash() - self.assertEqual( s["substitionsOff"]["out"].getValue( _precomputedHash = substitutionsOffHash2 ), "test.#.exr" ) self.assertEqual( substitutionsOffHash1, substitutionsOffHash2 ) self.assertNotEqual( substitutionsOnHash2, substitutionsOffHash2 ) @@ -355,7 +350,6 @@ def testSubstitutionsFromExpressionInput( self ) : self.assertEqual( s["substitionsOnIndirectly"]["out"].getValue(), "test.#.exr" ) substitionsOnIndirectlyHash2 = s["substitionsOnIndirectly"]["out"].hash() - self.assertEqual( s["substitionsOnIndirectly"]["out"].getValue( _precomputedHash = substitionsOnIndirectlyHash2 ), "test.#.exr" ) self.assertEqual( substitionsOnIndirectlyHash2, substitionsOnIndirectlyHash1 ) def testHashUsesValue( self ) : diff --git a/src/Gaffer/StringPlug.cpp b/src/Gaffer/StringPlug.cpp index 7dc947cda3b..f03a8b22268 100644 --- a/src/Gaffer/StringPlug.cpp +++ b/src/Gaffer/StringPlug.cpp @@ -106,9 +106,9 @@ void StringPlug::setValue( const std::filesystem::path &value ) setValue( value.generic_string() ); } -std::string StringPlug::getValue( const IECore::MurmurHash *precomputedHash ) const +std::string StringPlug::getValue() const { - ConstStringDataPtr s = getObjectValue( precomputedHash ); + ConstStringDataPtr s = getObjectValue(); const bool performSubstitutions = m_substitutions && diff --git a/src/GafferModule/StringPlugBinding.cpp b/src/GafferModule/StringPlugBinding.cpp index 2f8d70ba46f..f07570843df 100644 --- a/src/GafferModule/StringPlugBinding.cpp +++ b/src/GafferModule/StringPlugBinding.cpp @@ -63,12 +63,12 @@ void setPathValue( StringPlug *plug, const std::filesystem::path &value ) plug->setValue( value ); } -std::string getValue( const StringPlug *plug, const IECore::MurmurHash *precomputedHash ) +std::string getValue( const StringPlug *plug ) { // Must release GIL in case computation spawns threads which need // to reenter Python. IECorePython::ScopedGILRelease r; - return plug->getValue( precomputedHash ); + return plug->getValue(); } std::string substitutionsRepr( unsigned substitutions ) @@ -161,7 +161,7 @@ void GafferModule::bindStringPlug() // Must be registered before string-based `setValue()`, to give it weaker overloading precedence. .def( "setValue", &setPathValue ) .def( "setValue", &setValue ) - .def( "getValue", &getValue, ( boost::python::arg( "_precomputedHash" ) = object() ) ) + .def( "getValue", &getValue ) ; s.attr( "ValueType" ) = boost::python::object( boost::python::handle<>( boost::python::borrowed( &PyUnicode_Type ) ) );