graph.
Graph
This class represents an InstantTerra graph.
>>> from wysilab import InstantTerra
>>> it = InstantTerra()
>>> graph = it.project.graph # Get the graph
graph.
NodeLocation
This enum represents the location of a node relative to another node.
Top
TopRight
Right
BottomRight
Bottom
BottomLeft
Left
TopLeft
Graph.
get_node_count
() Number of nodes in the graph.
int
Returns the number of nodes in the graph.
>>> graph.get_node_count()
3
Graph.
get_all_nodes
() List of nodes.
list (of Nodes)
Returns the list of nodes in the graph.
>>> graph.get_all_nodes()
[Perlin noise, Apply curve, Export terrain]
Graph.
get_node_models
() List of node models.
list (of NodeModels)
Returns the list of node models.
>>> node_models = graph.get_node_models()
Graph.
get_node_links
(node)
Returns the list of node links.
>>> graph.get_node_links(perlin_noise)
[Link: [ Perlin noise ]-------- LinkType.Terrain ------->[ Apply curve ]]
Graph.
add_node
(api_node_type, (x,
y)) api_node_type (ApiNodeType)
tuple of location (Tuple)
The created node.
Creates and returns the node on the graph.
>>> node = graph.add_node(ApiNodeType.PERLIN_NOISE, (10,10))
>>> node
Perlin noise
Graph.
add_node_from_model
(node_model, (x,
y)) node_model (NodeModel)
tuple of location (Tuple)
The created node.
Creates and returns the node on the graph.
>>> node = graph.add_node_from_model(perlin_node_model, (10,10))
>>> node
Perlin noise
Graph.
add_node_next_to
(api_node_type, node_location,
previous_node) api_node_type (ApiNodeType)
node_location (NodeLocation)
previous_node (Node)
The created node.
Creates and returns the node on the graph next to the specified node.
>>> node = graph.add_node_next_to(ApiNodeType.PERLIN_NOISE, NodeLocation.Right, previous_node)
>>> node
Perlin noise
Graph.
add_node_from_model_next_to
(node_model, node_location,
previous_node) node_model (NodeModel)
node_location (NodeLocation)
previous_node (Node)
The created node.
Creates and returns the node on the graph next to the specified node.
>>> node = graph.add_node_from_model_next_to(perlin_node_model, NodeLocation.Right, previous_node)
>>> node
Perlin noise
Graph.
remove_node
(node_to_remove) node_to_remove (Node)
Removes the node from the graph.
>>> graph.remove_node(node_to_remove)
Graph.
add_link
(start_node, start_connector,
end_node, end_connector) The created link.
Adds a link between nodes
>>> graph.add_link(start_node, start_connector, end_node, end_connector)
Graph.
add_link_using_name
(start_node,
start_connector_name, end_node,
end_connector_name)
The created link.
Adds a link between nodes, using the connector name
>>> graph.add_link_using_name(start_node, start_connector_name, end_node, end_connector_name)
Graph.
get_node_links
(Node)
node (Node)
Links.
Gets all links connected to the node
>>> graph.get_node_links(perlin_noise)
Graph.
remove_link
(Link)
node (Node)
Remove a link
>>> graph.remove_link(perlin_link)
Copyright © 2022 · All Rights Reserved · Wysilab