Skip to content

Commit

Permalink
fixup! USDShader : Add new node for loading shaders from `pxr::SdrReg…
Browse files Browse the repository at this point in the history
…istry`

Set `name` plug before loading parameters, so that the nodule metadata can be computed as the GraphEditor starts querying it (which is immediately after each plug is added to the pasted node).
  • Loading branch information
johnhaddon committed Jul 14, 2023
1 parent a57a820 commit 5f07f95
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/GafferUSD/USDShader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5f07f95

Please sign in to comment.