unreal.InterchangeShaderPortsAPI

class unreal.InterchangeShaderPortsAPI(outer: Optional[Object] = None, name: Union[Name, str] = 'None')

Bases: Object

The Shader Ports API manages a set of inputs and outputs attributes. This API can be used over any InterchangeBaseNode that wants to support shader ports as attributes.

C++ Source:

  • Plugin: Interchange

  • Module: InterchangeNodes

  • File: InterchangeShaderGraphNode.h

classmethod connect_default_ouput_to_input(interchange_node, input_name, expression_uid) bool

Adds an input connection attribute.

Parameters:
  • interchange_node (InterchangeBaseNode) – The Node to create the input on.

  • input_name (str) – The name to give to the input.

  • expression_uid (str) – The unique id of the node to connect to the input.

Returns:

true if the input connection was successfully added to the node.

Return type:

bool

classmethod connect_ouput_to_input(interchange_node, input_name, expression_uid, output_name) bool

Adds an input connection attribute.

Parameters:
  • interchange_node (InterchangeBaseNode) – The Node to create the input on.

  • input_name (str) – The name to give to the input.

  • expression_uid (str) – The unique id of the node to connect to the input.

  • output_name (str) – The name of the ouput from ExpressionUid to connect to the input.

Returns:

true if the input connection was succesfully added to the node.

Return type:

bool

classmethod gather_inputs(interchange_node) Array[str]

Retrieves the names of all the inputs for a given node.

Parameters:

interchange_node (InterchangeBaseNode) –

Returns:

out_input_names (Array[str]):

Return type:

Array[str]

classmethod get_input_connection(interchange_node, input_name) (out_expression_uid=str, output_name=str) or None

Retrieves the node unique id and the ouputname connected to a given input, if any.

Parameters:
Returns:

out_expression_uid (str):

output_name (str):

Return type:

tuple or None

classmethod has_input(interchange_node, input_name) bool

Checks if a particular input exists on a given node.

Parameters:
Return type:

bool

classmethod is_an_input(attribute_key) bool

Returns true if the attribute key is associated with an input (starts with “Inputs:”).

Parameters:

attribute_key (str) –

Return type:

bool

classmethod make_input_connection_key(input_name) Name

Makes an attribute key to represent a node being connected to an input (ie: Inputs:InputName:Connect).

Parameters:

input_name (str) –

Return type:

Name

classmethod make_input_name(input_key) str

From an attribute key associated with an input (ie: Inputs:InputName:Value), retrieves the input name from it.

Parameters:

input_key (str) –

Return type:

str

classmethod make_input_value_key(input_name) Name

Makes an attribute key to represent a value being given to an input (ie: Inputs:InputName:Value).

Parameters:

input_name (str) –

Return type:

Name