Accessing node data

What is a graph "node"?

A node represents an operation in InstantTerra, i.e. the generation of a terrain using a noise or even an erosion simulation.

These nodes and their parameters are accessible directly via the API.

// Create an instance of InstantTerra
InstantTerra instantTerra = new InstantTerra();

// Get the current graph and the list of nodes
Graph graph = instantTerra.GetProject().GetGraph();
List<Node> listOfNodes = graph.GetAllNodes();

// Get the first node of the graph
Node myNode = listOfNodes[0];

Changing a node name

myNode.SetName("New name");

To change or retrieve a node name, use the methods SetName(name) and GetName.

Changing a node comment

myNode.SetComment("New comment");

To change or retrieve a node comment, use the methods SetComment(comment) and GetComment.

Retrieving the node type


To retrieve the node type, use the method GetNodeType.

Retrieving the parameters' list

// Returns the list of node parameters
string[] parameterList = myNode.GetParameterList();

The method GetParameterList() returns the list of node parameters.

Determining if a parameter exists

// Returns true if the parameter exists

See HasParameter(parameterName) in the documentation.

Retrieving or setting a parameter value

// Get the value of the parameter

// Set the value of the parameter
myNode.SetParameterValue("offset_x", "1.0");

See GetParameterValue(parameterName) and SetParameterValue(parameterName, value).


If the parameter name does not exist or if the set value is not valid, C# returns an error message with the description of the problem.

Copyright © 2022 · All Rights Reserved · Wysilab