diff --git a/src/GafferUSD/USDShader.cpp b/src/GafferUSD/USDShader.cpp index 2aa455ae32e..c32764c8357 100644 --- a/src/GafferUSD/USDShader.cpp +++ b/src/GafferUSD/USDShader.cpp @@ -292,6 +292,9 @@ void USDShader::loadShader( const std::string &shaderName, bool keepExistingValu throw Exception( fmt::format( "Shader \"{}\" not found in SdrRegistry", shaderName ) ); } + namePlug()->setValue( shaderName ); + typePlug()->setValue( "surface" ); + Plug *parametersPlug = this->parametersPlug()->source(); if( !keepExistingValues ) @@ -331,9 +334,6 @@ void USDShader::loadShader( const std::string &shaderName, bool keepExistingValu outPlug->removeChild( child ); } } - - namePlug()->setValue( shaderName ); - typePlug()->setValue( "surface" ); } IECore::ConstCompoundObjectPtr USDShader::attributes( const Gaffer::Plug *output ) const