Skip to content

Commit

Permalink
FIX : Whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldresser-ie committed May 16, 2024
1 parent 5540449 commit a35e001
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 17 deletions.
2 changes: 1 addition & 1 deletion include/GafferScene/ShaderTweakProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down
2 changes: 1 addition & 1 deletion python/GafferSceneTest/ShaderTweakProxyTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
4 changes: 2 additions & 2 deletions src/GafferScene/Shader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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" )
)
{
Expand Down
4 changes: 2 additions & 2 deletions src/GafferScene/ShaderPlug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
);

}
Expand Down
19 changes: 9 additions & 10 deletions src/GafferScene/ShaderTweakProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 );
}


Expand Down Expand Up @@ -128,8 +128,8 @@ void ShaderTweakProxy::loadShader( const std::string &shaderName, bool keepExist
loaderNode = match->second();
}
else
{
std::vector<std::string> possibilityList;
{
std::vector<std::string> possibilityList;
for( const auto &i : creatorMap )
{
possibilityList.push_back( "\"" + i.first + "\"" );
Expand All @@ -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 )
Expand Down
1 change: 0 additions & 1 deletion src/GafferSceneModule/TweaksBinding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,5 @@ void GafferSceneModule::bindTweaks()

DependencyNodeClass<ShaderTweakProxy>()
.def( "setupAutoProxy", &ShaderTweakProxy::setupAutoProxy )

;
}

0 comments on commit a35e001

Please sign in to comment.