Skip to content

FxNodeID ​

This module contains functions for creating and working with NodeID lists.

Load ​

lua
FxNodeID = require "FxNodeID";

Functions ​

FunctionDescription
Count (NodeID)Returns the number of items in a list.
Create (NodeID)Creates a node list.
FilterID (NodeID, Value)Filters nodes.
FilterType (NodeID, NodeType)Filters nodes of given type.
Get (NodeID, Index)Returns the node from a node list at given index.
Merge (NodeID1, NodeID2)Merges two node lists.
Remove (NodeID, RemoveID)Removes a node from a list.
Reverse (NodeID)Reverses a node list.
SortID (NodeID)Sorts a node list by ID.

Count (NodeID) ​

This function returns the number of nodes identified by the specified NodeID.

Parameters ​

  • NodeID: The NodeID to identify the nodes of the list

Returns ​

The number of identified nodes

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND

Since ​

Version 1.0

Example ​

lua
val = FxNodeID.Count("<layer1,layer2,layer3>");
-- returns 3

val = FxNodeID.Count("/s");
-- returns number of selected nodes

Create (NodeID) ​

This function returns a valid NodeID list identified by the given NodeID.

Parameters ​

  • NodeID: The NodeID to identify the nodes of the list

Returns ​

A valid NodeID list without duplicates

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND

Since ​

Version 1.0

Example ​

lua
-- create a list of all nodes
list = FxNodeID.Create("*");

FilterID (NodeID, Value) ​

This function returns the nodes identified by the given NodeID that have the given value in their NodeID.

Parameters ​

  • NodeID: The NodeID to identify the nodes of the list
  • Value: The filter string

Returns ​

A valid NodeID list without duplicates

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND

Since ​

Version 1.0

Example ​

lua
list = FxNodeID.FilterID("<layer1,layer2,group1>", "layer");
-- returns "<layer1,layer2>"

FilterType (NodeID, NodeType) ​

This function returns the nodes identified by the given NodeID that are of the given type.

Parameters ​

  • NodeID: The NodeID to identify the nodes of the list
  • NodeType: The NodeType to filter

Returns ​

A valid NodeID list without duplicates

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_TYPE_INVALID

Since ​

Version 1.0

Example ​

lua
-- get list of voxel layer nodes
list = FxNodeID.FilterType("*", 11);

Get (NodeID, Index) ​

This function returns the node at the given index from a list of nodes identified by the given NodeID. The index of the first item is 0.

Parameters ​

  • NodeID: The NodeID to identify the nodes of the list
  • Index: The list index

Returns ​

A single NodeID

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND, FX_VALUE_INVALID

Since ​

Version 1.0

Example ​

lua
list = FxNodeID.Get("<dear,bear,fox", 2);
-- returns "fox"

Merge (NodeID1, NodeID2) ​

This function merges the two identified NodeID lists and returns the new list.

Parameters ​

  • NodeID1: The NodeID to identify nodes for list 1
  • NodeID2: The NodeID to identify nodes for list 2

Returns ​

A valid NodeID list without duplicates

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND

Since ​

Version 1.0

Example ​

lua
list = FxNodeID.Add("<layer1,layer2>", "layer3");
-- returns "<layer1,layer2,layer3>"

Remove (NodeID, RemoveID) ​

This function takes the nodes identified by the given NodeID, removes all nodes identified by the given RemoveID, and returns the new list.

Parameters ​

  • NodeID: The NodeID to identify the nodes of the list
  • RemoveID: The NodeID to identify one or more nodes to remove from the list

Returns ​

A valid NodeID list without duplicates

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND

Since ​

Version 1.0

Example ​

lua
list = "<bus,train,car>";
list = FxNodeID.Remove(list, "car");
-- returns "<bus,train>"

Reverse (NodeID) ​

This function reverses the order of nodes identified by the given NodeID and returns the new list.

Parameters ​

  • NodeID: The NodeID to identify the nodes of the list

Returns ​

A valid NodeID list without duplicates

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND

Since ​

Version 1.0

Example ​

lua
list = "<one,two,three>";
list = FxNodeID.Reverse(list);
-- returns "<three,two,one>"

SortID (NodeID) ​

This function takes the nodes identified by the given NodeID, sorts them alphabetically, and returns the new list.

Parameters ​

Returns ​

A valid NodeID list without duplicates

Errors ​

Possible errors include FX_REQUIRED_ASSET_UNAVAILABLE, FX_NODE_NOT_FOUND

Since ​

Version 1.0

Example ​

lua
list = "<fish,whale,shark>";
list = FxNodeID.SortID(list);
-- returns "<fish,shark,whale>"