diff --git a/include/GafferScene/ShaderTweakProxy.h b/include/GafferScene/ShaderTweakProxy.h index fef3adc7d3e..a31ec88b6ac 100644 --- a/include/GafferScene/ShaderTweakProxy.h +++ b/include/GafferScene/ShaderTweakProxy.h @@ -86,7 +86,7 @@ class GAFFERSCENE_API ShaderTweakProxy : public Shader using ShaderLoaderCreatorMap = std::map< std::string, ShaderTweakProxy::ShaderLoaderCreator >; static ShaderLoaderCreatorMap &shaderLoaderCreators(); - static void registerShaderLoader( const std::string &typePrefix, ShaderLoaderCreator creator ); + static void registerShaderLoader( const std::string &typePrefix, ShaderLoaderCreator creator ); static size_t g_firstPlugIndex; }; diff --git a/python/GafferSceneTest/ShaderTweakProxyTest.py b/python/GafferSceneTest/ShaderTweakProxyTest.py index 60470cdc9bd..6b9283e0612 100644 --- a/python/GafferSceneTest/ShaderTweakProxyTest.py +++ b/python/GafferSceneTest/ShaderTweakProxyTest.py @@ -121,7 +121,7 @@ def test( self ) : specificProxy.loadShader( "test:testShader" ) specificProxy["parameters"]["targetShader"].setValue( "texture2" ) - + tweakShader["parameters"]["c"].setInput( specificProxy["out"]["out"] ) tweakedNetwork = tweaks["out"].attributes( "/plane" )["surface"] diff --git a/src/GafferScene/Shader.cpp b/src/GafferScene/Shader.cpp index 7d7b1f60ee7..13c9ebd50bf 100644 --- a/src/GafferScene/Shader.cpp +++ b/src/GafferScene/Shader.cpp @@ -366,8 +366,8 @@ class Shader::NetworkBuilder IECoreScene::ShaderPtr shader = new IECoreScene::Shader( shaderNode->namePlug()->getValue(), shaderNode->typePlug()->getValue() ); - if( - !ShaderTweakProxy::isProxy( shader.get() ) && + if( + !ShaderTweakProxy::isProxy( shader.get() ) && shaderNode != m_output->node() && !boost::ends_with( shader->getType(), "shader" ) ) { diff --git a/src/GafferScene/ShaderPlug.cpp b/src/GafferScene/ShaderPlug.cpp index 011ca7f9601..83698851f46 100644 --- a/src/GafferScene/ShaderPlug.cpp +++ b/src/GafferScene/ShaderPlug.cpp @@ -245,7 +245,7 @@ IECore::ConstCompoundObjectPtr ShaderPlug::attributes() const outputParameter = p->relativeName( s->outPlug() ); scope.set( Shader::g_outputParameterContextName, &outputParameter ); } - + IECore::ConstCompoundObjectPtr result = s->outAttributesPlug()->getValue(); // Check for outputs from ShaderTweakProxy, which should only be used with ShaderTweaks nodes @@ -258,7 +258,7 @@ IECore::ConstCompoundObjectPtr ShaderPlug::attributes() const if( hasProxyNodes->readable() ) { throw IECore::Exception( - "ShaderTweakProxy only works with ShaderTweaks - it doesn't make sense to connect one here" + "ShaderTweakProxy only works with ShaderTweaks - it doesn't make sense to connect one here" ); } diff --git a/src/GafferScene/ShaderTweakProxy.cpp b/src/GafferScene/ShaderTweakProxy.cpp index a01e8c73d8d..96a8d8e82d9 100644 --- a/src/GafferScene/ShaderTweakProxy.cpp +++ b/src/GafferScene/ShaderTweakProxy.cpp @@ -71,11 +71,11 @@ ShaderTweakProxy::~ShaderTweakProxy() ShaderTweakProxy::ShaderLoaderCreatorMap &ShaderTweakProxy::shaderLoaderCreators() { - // Deliberately "leaking" list, as it may contain Python functors which - // cannot be destroyed during program exit (because Python will have been - // shut down first). - static auto g_creators = new ShaderLoaderCreatorMap; - return *g_creators; + // Deliberately "leaking" list, as it may contain Python functors which + // cannot be destroyed during program exit (because Python will have been + // shut down first). + static auto g_creators = new ShaderLoaderCreatorMap; + return *g_creators; } void ShaderTweakProxy::typePrefixAndSourceShaderName( std::string &typePrefix, std::string &sourceShaderName ) const @@ -96,8 +96,8 @@ void ShaderTweakProxy::typePrefixAndSourceShaderName( std::string &typePrefix, s ) ); } - typePrefix = shaderName.substr(0, sep ); - sourceShaderName = shaderName.substr( sep + 1 ); + typePrefix = shaderName.substr(0, sep ); + sourceShaderName = shaderName.substr( sep + 1 ); } @@ -128,8 +128,8 @@ void ShaderTweakProxy::loadShader( const std::string &shaderName, bool keepExist loaderNode = match->second(); } else - { - std::vector possibilityList; + { + std::vector possibilityList; for( const auto &i : creatorMap ) { possibilityList.push_back( "\"" + i.first + "\"" ); @@ -153,7 +153,6 @@ void ShaderTweakProxy::loadShader( const std::string &shaderName, bool keepExist outPlug()->addChild( child->createCounterpart( child->getName(), Plug::Direction::Out ) ); } } - } void ShaderTweakProxy::setupAutoProxy( const Plug* referencePlug ) diff --git a/src/GafferSceneModule/TweaksBinding.cpp b/src/GafferSceneModule/TweaksBinding.cpp index 8b6e361de5f..3ac1cf1871c 100644 --- a/src/GafferSceneModule/TweaksBinding.cpp +++ b/src/GafferSceneModule/TweaksBinding.cpp @@ -64,6 +64,5 @@ void GafferSceneModule::bindTweaks() DependencyNodeClass() .def( "setupAutoProxy", &ShaderTweakProxy::setupAutoProxy ) - ; }