Skip to content

Commit

Permalink
fixup! ParameterInspector : Light OptionalValuePlug
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmehl committed Aug 8, 2023
1 parent 403ed5d commit 34c094a
Showing 1 changed file with 2 additions and 29 deletions.
31 changes: 2 additions & 29 deletions src/GafferSceneUI/ParameterInspector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,35 +172,8 @@ Inspector::EditFunctionOrFailure ParameterInspector::editFunction( Gaffer::EditS
{
auto attributeHistory = static_cast<const SceneAlgo::AttributeHistory *>( history );

/// \todo This duplicates the logic from `::parameterValue` in `EditScopeAlgo`. Should that
/// be exposed publicly in some way?

auto shaderNetwork = runTimeCast<const ShaderNetwork>( attributeHistory->attributeValue );
if( !shaderNetwork )
{
return fmt::format( "Attribute \"{}\" is not a shader.", attributeHistory->attributeName.string() );
}

const IECoreScene::Shader *shader;
if( m_parameter.shader.string().size() )
{
shader = shaderNetwork->getShader( m_parameter.shader );
if( !shader )
{
return fmt::format( "Shader \"{}\" does not exist.", m_parameter.shader.string() );
}
}
else
{
shader = shaderNetwork->outputShader();
if( !shader )
{
return "Output shader does not exist.";
}
}

const Data *result = shader->parametersData()->member( m_parameter.name );
if( !result )
ConstObjectPtr v = value( history );
if( !v )
{
return fmt::format( "Parameter \"{}\" does not exist.", m_parameter.name.string() );
}
Expand Down

0 comments on commit 34c094a

Please sign in to comment.