Navigation
API > API/Plugins > API/Plugins/InterchangeImport > API/Plugins/InterchangeImport/FMaterialXSurfaceShaderAbstract
Description
Add an FLinearColor attribute to a shader node only if its value taken from the input is not equal to its default value. Return false if the attribute does not exist or if we cannot add it.
| Name | AddLinearColorAttribute |
| Type | function |
| Header File | /Engine/Plugins/Interchange/Runtime/Source/Import/Public/MaterialX/MaterialXUtils/MaterialXSurfaceShaderAbstract.h |
| Include Path | #include "MaterialX/MaterialXUtils/MaterialXSurfaceShaderAbstract.h" |
| Source | /Engine/Plugins/Interchange/Runtime/Source/Import/Private/MaterialX/MaterialXUtils/MaterialXSurfaceShaderAbstract.cpp |
bool AddLinearColorAttribute
(
MaterialX::InputPtr Input,
const FString & InputChannelName,
UInterchangeShaderNode * ShaderNode,
const FLinearColor & DefaultValue,
int32 OutputIndex
)
true if the attribute was successfully added.
Parameters
| Name | Remarks |
|---|---|
| Input | The MaterialX input to retrieve and add the value from. Must be of type color. |
| InputChannelName | The name of the shader node's input to add the attribute. |
| ShaderNode | The shader node to which we want to add the attribute. |
| DefaultValue | the default value to test the input against. |