From 34c094aa05ac89f204ffbd21cae3ecba63d7af26 Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Tue, 8 Aug 2023 11:50:28 -0400 Subject: [PATCH] fixup! ParameterInspector : Light `OptionalValuePlug` --- src/GafferSceneUI/ParameterInspector.cpp | 31 ++---------------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/src/GafferSceneUI/ParameterInspector.cpp b/src/GafferSceneUI/ParameterInspector.cpp index f7eadfab7fb..c2f613977a9 100644 --- a/src/GafferSceneUI/ParameterInspector.cpp +++ b/src/GafferSceneUI/ParameterInspector.cpp @@ -172,35 +172,8 @@ Inspector::EditFunctionOrFailure ParameterInspector::editFunction( Gaffer::EditS { auto attributeHistory = static_cast( history ); - /// \todo This duplicates the logic from `::parameterValue` in `EditScopeAlgo`. Should that - /// be exposed publicly in some way? - - auto shaderNetwork = runTimeCast( 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() ); }