unreal.InterchangeBaseNodeContainer

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

Bases: Object

Interchange UInterchangeBaseNode graph is a format used to feed asset/scene import/reimport/export factories/writer. This container hold a flat list of all nodes that have been translated from the source data.

Translators are filling this container and the Import/Export managers are reading it to execute the import/export process

C++ Source:

  • Module: InterchangeCore

  • File: InterchangeBaseNodeContainer.h

Editor Properties: (see get_editor_property/set_editor_property)

  • nodes (Map[str, InterchangeBaseNode]): [Read-Only] Nodes: Flat List of the nodes. Since the nodes are variable size, we store a pointer.

add_node(node) str

Add a node in the container, the node will be add into a TMap. return:: return the node unique ID of the added item. If the node already exist it will return the existing ID. Return InvalidNodeUid if the node cannot be added.

Parameters:

node (InterchangeBaseNode) – a pointer on the node you want to add

Return type:

str

compute_children_cache() None

Fill the children uids cache to optimize the GetNodeChildrenUids call.

get_factory_node(node_unique_id) InterchangeFactoryBaseNode

Get a factory node pointer

Parameters:

node_unique_id (str) –

Return type:

InterchangeFactoryBaseNode

get_node(node_unique_id) InterchangeBaseNode

Get a node pointer. Once added to the container, nodes are considered const

Parameters:

node_unique_id (str) –

Return type:

InterchangeBaseNode

get_node_children(node_unique_id, child_index) InterchangeBaseNode

Get the node nth const children

Parameters:
  • node_unique_id (str) –

  • child_index (int32) –

Return type:

InterchangeBaseNode

get_node_children_count(node_unique_id) int32

Get the node children count

Parameters:

node_unique_id (str) –

Return type:

int32

get_node_children_uids(node_unique_id) Array[str]

Get all children Uid

Parameters:

node_unique_id (str) –

Return type:

Array[str]

get_nodes(class_node) Array[str]

Return all nodes that are of the ClassNode type

Parameters:

class_node (type(Class)) –

Returns:

out_nodes (Array[str]):

Return type:

Array[str]

get_roots() Array[str]

Return all nodes that do not have any parent

Returns:

root_nodes (Array[str]):

Return type:

Array[str]

is_node_uid_valid(node_unique_id) bool

Return true if the node unique ID exist in the container

Parameters:

node_unique_id (str) –

Return type:

bool

load_from_file(filename) None

Serialize the node container from the specified file.

Parameters:

filename (str) –

reset_children_cache() None

Reset the children uids cache.

save_to_file(filename) None

Serialize the node container into the specified file.

Parameters:

filename (str) –

set_node_parent_uid(node_unique_id, new_parent_node_uid) bool

Set node ParentUid

Parameters:
  • node_unique_id (str) –

  • new_parent_node_uid (str) –

Return type:

bool