unreal.InterchangeBaseNode

class unreal.InterchangeBaseNode(outer: Object | None = None, name: Name | str = 'None')

Bases: Object

This struct is used to store and retrieve key-value attributes. The attributes are stored in a generic FAttributeStorage that serializes the values in a TArray64<uint8>. See UE::Interchange::EAttributeTypes to know the supported template types. This is an abstract class. This is the base class of the interchange node graph format; all classes in this format should derive from this class.

C++ Source:

  • Module: InterchangeCore

  • File: InterchangeBaseNode.h

add_boolean_attribute(node_attribute_key, value) bool

Add a Boolean attribute to this node. Returns false if the attribute does not exist or if it cannot be added.

Parameters:
  • node_attribute_key (str)

  • value (bool)

Return type:

bool

add_double_attribute(node_attribute_key, value) bool

Add a double attribute to this node. Returns false if the attribute does not exist or if it cannot be added.

Parameters:
  • node_attribute_key (str)

  • value (double)

Return type:

bool

add_float_attribute(node_attribute_key, value) bool

Add a float attribute to this node. Returns false if the attribute does not exist or if it cannot be added.

Parameters:
  • node_attribute_key (str)

  • value (float)

Return type:

bool

add_guid_attribute(node_attribute_key, value) bool

Add a GUID attribute to this node. Returns false if the attribute does not exist or if it cannot be added.

Parameters:
  • node_attribute_key (str)

  • value (Guid)

Return type:

bool

add_int32_attribute(node_attribute_key, value) bool

Add a int32 attribute to this node. Returns false if the attribute does not exist or if it cannot be added.

Parameters:
  • node_attribute_key (str)

  • value (int32)

Return type:

bool

add_linear_color_attribute(node_attribute_key, value) bool

Add an FLinearColor attribute to this node. Returns false if the attribute does not exist or if it cannot be added.

Parameters:
Return type:

bool

add_string_attribute(node_attribute_key, value) bool

Add a string attribute to this node. Returns false if the attribute does not exist or if it cannot be added.

Parameters:
  • node_attribute_key (str)

  • value (str)

Return type:

bool

add_target_node_uid(asset_uid) bool

Add an asset node UID relating to this object.

Parameters:

asset_uid (str)

Return type:

bool

add_vector2_attribute(node_attribute_key, value) bool

Add a Vector2 attribute to this node. Returns false if the attribute does not exist or if it cannot be added.

Parameters:
Return type:

bool

get_asset_name() str

Optional. Any node that can import or export an asset should set the desired name for the asset. If the attribute was never set, returns GetDisplayLabel().

Return type:

str

get_boolean_attribute(node_attribute_key) bool or None

Get a Boolean attribute from this node. Returns false if the attribute does not exist.

Parameters:

node_attribute_key (str)

Returns:

out_value (bool):

Return type:

bool or None

get_desired_child_index() int32

Return the desired child index. If the attribute do not exist it will return INDEX_NONE. The interchange node container will use this to re-order children if attribute are specified.

Use UInterchangeBaseNodeContainer::SetNodeDesiredChildIndex function to set this node child index. This will ensure the container cache is always in sync

Return type:

int32

get_display_label() str

Return the display label.

Return type:

str

get_double_attribute(node_attribute_key) double or None

Get a double attribute from this node. Returns false if the attribute does not exist.

Parameters:

node_attribute_key (str)

Returns:

out_value (double):

Return type:

double or None

get_float_attribute(node_attribute_key) float or None

Get a float attribute from this node. Returns false if the attribute does not exist.

Parameters:

node_attribute_key (str)

Returns:

out_value (float):

Return type:

float or None

get_guid_attribute(node_attribute_key) Guid or None

Get a GUID attribute from this node. Returns false if the attribute does not exist.

Parameters:

node_attribute_key (str)

Returns:

out_value (Guid):

Return type:

Guid or None

get_icon_name() Name

Icon name, used to retrieve the brush when we display the node in any UI.

Return type:

Name

get_int32_attribute(node_attribute_key) int32 or None

Get a int32 attribute from this node. Returns false if the attribute does not exist.

Parameters:

node_attribute_key (str)

Returns:

out_value (int32):

Return type:

int32 or None

get_linear_color_attribute(node_attribute_key) LinearColor or None

Get an FLinearColor attribute from this node. Returns false if the attribute does not exist.

Parameters:

node_attribute_key (str)

Returns:

out_value (LinearColor):

Return type:

LinearColor or None

get_namespace() str or None

Namespace is a prefix added when calling GetUniqueId(). If the attribute exist it will fill Namespace and return true. If the attribute do not exist, it will not touch OutNamespace and return false.

Returns:

namespace (str):

Return type:

str or None

get_node_container_type() InterchangeNodeContainerType

Return the node container type that defines the purpose of the node (factory node, translated scene node, or translated asset node).

Return type:

InterchangeNodeContainerType

get_parent_uid() str

Return the parent unique ID. If the attribute does not exist, returns InvalidNodeUid().

Use UInterchangeBaseNodeContainer::SetNodeParentUid function to create a parent hierarchy. This will ensure the container cache is always in sync It’s suggested to use SetupNode (that will Iintialize, Add to container and setup the Parent hierarchy as well).

Return type:

str

get_string_attribute(node_attribute_key) str or None

Get a string attribute from this node. Returns false if the attribute does not exist.

Parameters:

node_attribute_key (str)

Returns:

out_value (str):

Return type:

str or None

get_target_node_count() int32

Get the number of target assets relating to this object.

Return type:

int32

get_target_node_uids() Array[str]

Get the target assets relating to this object.

Returns:

out_target_assets (Array[str]):

Return type:

Array[str]

get_type_name() str

Return the node type name of the class. This is used when reporting errors.

Return type:

str

get_unique_id() str

Return the unique ID passed in the constructor.

Return type:

str

get_vector2_attribute(node_attribute_key) Vector2f or None

Get a Vector2 attribute from this node. Returns false if the attribute does not exist.

Parameters:

node_attribute_key (str)

Returns:

out_value (Vector2f):

Return type:

Vector2f or None

initialize_node(unique_id, display_label, node_container_type) None

Initialize the base data of the node.

Parameters:
  • unique_id (str) – The unique ID for this node.

  • display_label (str) – The name of the node. If the Node to initialize also will get a Parent, then the UInterchangeBaseNodeContainer’s SetupNode is better suited.

  • node_container_type (InterchangeNodeContainerType)

is_enabled() bool

If true, the node is imported or exported. If false, it is discarded. Returns false if the node was disabled. Returns true if the attribute is not there or if it was enabled.

Return type:

bool

remove_attribute(node_attribute_key) bool

Remove the specified attribute from this node. Returns false if it could not be removed. If the attribute does not exist, returns true.

Parameters:

node_attribute_key (str)

Return type:

bool

remove_target_node_uid(asset_uid) bool

Remove an asset node UID relating to this object.

Parameters:

asset_uid (str)

Return type:

bool

set_asset_name(asset_name) bool

Set the name for the imported asset this node represents. The asset factory will call GetAssetName().

Parameters:

asset_name (str)

Return type:

bool

set_display_label(display_label) bool

Change the display label.

Parameters:

display_label (str) – Desired display label text. Sanitized to “Null” if empty or if equals “None”.

Return type:

bool

set_enabled(is_enabled) bool

Determine whether this node should be part of the import or export process.

Parameters:

is_enabled (bool) – If true, this node is imported or exported. If false, it is discarded.

Returns:

true if the attribute was set, or false otherwise.

Return type:

bool