In this example, we will create a node using an input terrain that exposes a parameter named "Strength" and edit its graph. The output is a terrain with values that are the result of the input terrain's values plus the Strength value.
The nodes are invalid because there is no input terrain linked to the custom node.
#
#------------------------------------------------
# Example: Applies an offset on a terrain
# - Needs an input terrain node named 'Input'
# - Needs a parameter node named 'Strength'
# - Needs an output terrain node named 'Output'
# - Handles the progress bar
#
set_task_progress(0)
for y in range(Input.height):
set_task_progress(y/Input.width*100)
for x in range(Input.width):
input_value
= Input.get(x, y)
Output.set(x,
y, input_value + Strength)
Copyright © 2022 · All Rights Reserved · Wysilab