class Node
This class represents an InstantTerra node.
InstantTerra instantTerra = new InstantTerra();
Node myNode = instantTerra.GetProject().GetGraph().GetAllNodes()[0]; // Get the first node
HasParameter
(string parameterName)True if the parameter exists, otherwise False.
bool goodParameter = myNode.HasParameter("offset_x"); // true
bool badParameter = myNode.HasParameter("unknown"); // false
GetParameterList
()List of parameters name.
Returns the list of node parameters name.
string[] parameters = myNode.GetParameterList();
GetParameterValue
(string parameterName)Value of the parameter.
Returns the value of the parameter.
string parameterValue = myNode.GetParameterValue("max_height");
SetParameterValue
(string parameterName, string value)Sets the value of the parameter.
myNode.SetParameterValue("max_height", "100.0");
Console.WriteLine(myNode.GetParameterValue("max_height"));
GetConnectors
()Returns a dictionnary of connectors of the Node and if they are connected.
Dictionary<Connector.ConnectorMode, List<Connector>> connectors = myNode.GetConnectors();
GetName
()Returns the name of the node.
string nodeName = myNode.GetName();
SetName
(string newName)Change the name of the node.
myNode.SetName("new name");
GetComment
()Returns the comment of the node.
string nodeComment = myNode.GetComment();
SetComment
(string newComment)Change the comment of the node.
myNode.SetComment("new comment");
GetNodeType
()Returns the Type of node.
string nodeType = myNode.GetNodeType();
IsEnabled
()True if the node is enabled, False if the node is disabled.
bool nodeIsEnabled = myNode.IsEnabled();
SetIsEnabled
()If enabled is true, enables the node.
If enabled is false, disables the node.
// Disable the node
myNode.SetIsEnabled(false);
GetMaximumValue
()Maximum elevation of the terrain in meters/ maximum value of the
mask between 0 and 1
Calling this method triggers the calculation of the node if not
already done. When the project contains a lot of nodes, this
calculation may last several seconds to several minutes.
If the node contains several output terrains or masks (such as
erosion nodes), the first terrain or first mask is used.
As export nodes do not have any output terrain or mask, the method
has to be called from the previous node.
Error − If the node has no output terrain or mask, the following error will be reported: NoOutputTerrainOrMaskException .
float MaxValue = myNode.GetMaximumValue();
GetMinimumValue
()Minimum elevation of the terrain in meters/ maximum value of the
mask between 0 and 1
Calling this method triggers the calculation of the node if not
already done. When the project contains a lot of nodes, this
calculation may last several seconds to several minutes.
If the node contains several output terrains or masks (such as
erosion nodes), the first terrain or first mask is used.
As export nodes do not have any output terrain or mask, the method
has to be called from the previous node.
Error − If the node has no output terrain or mask, the following error will be reported: NoOutputTerrainOrMaskException .
float MinValue = myNode.GetMinimumValue();
Copyright © 2022 · All Rights Reserved · Wysilab