ProceduralRequest
Everything a run of a procedural graph can be given.
Description
Section titled “Description”Used with Procedural.execute() when a run needs more than a seed and bounds: values for the graph’s parameters, data for its ProceduralNodeInput nodes, one thread only, no cache, or what every node made (for tools).
Properties
Section titled “Properties”| Type | Name | Default |
|---|---|---|
| AABB | bounds | AABB(0, 0, 0, 0, 0, 0) |
| ProceduralGraph | graph | |
| bool | is_2d | true |
| bool | keep_node_outputs | false |
| int | parallel_threshold | 2048 |
| int | seed | 0 |
| int | threads | 0 |
| bool | use_cache | true |
Methods
Section titled “Methods”| Returns | Method |
|---|---|
| void | add_input(name, data) |
| void | clear_inputs() |
| Rect2 | get_bounds_2d() |
| Dictionary | get_parameters() |
| void | set_bounds_2d(bounds) |
| void | set_parameter(name, value) |
Property descriptions
Section titled “Property descriptions”bounds
Section titled “bounds”AABB bounds = AABB(0, 0, 0, 0, 0, 0)
Setter/getter: set_bounds(), get_bounds()
Where it generates. Setting it makes the run 3D.
ProceduralGraph graph
Setter/getter: set_graph(), get_graph()
The graph to run.
bool is_2d = true
Setter/getter: set_is_2d(), get_is_2d()
Whether the run is 2D (x, y; z is the layer) or 3D (x, z; y is up).
keep_node_outputs
Section titled “keep_node_outputs”bool keep_node_outputs = false
Setter/getter: set_keep_node_outputs(), get_keep_node_outputs()
Whether the result keeps what every node made (ProceduralResult.get_node_output()).
parallel_threshold
Section titled “parallel_threshold”int parallel_threshold = 2048
Setter/getter: set_parallel_threshold(), get_parallel_threshold()
Below this many points a node works on one thread.
int seed = 0
Setter/getter: set_seed(), get_seed()
The seed: another seed gives other points.
threads
Section titled “threads”int threads = 0
Setter/getter: set_threads(), get_threads()
1 runs on this thread only; 0 uses every worker thread. The result is the same.
use_cache
Section titled “use_cache”bool use_cache = true
Setter/getter: set_use_cache(), get_use_cache()
Whether nodes reuse what they made before for the same input.
Method descriptions
Section titled “Method descriptions”add_input
Section titled “add_input”void add_input(name: StringName, data: ProceduralData)
Data the ProceduralNodeInput node named name gives (a polygon of the level, points from code…).
clear_inputs
Section titled “clear_inputs”void clear_inputs()
Removes the data given with add_input().
get_bounds_2d
Section titled “get_bounds_2d”Rect2 get_bounds_2d() const
The bounds as a rectangle.
get_parameters
Section titled “get_parameters”Dictionary get_parameters() const
The parameter values of this run.
set_bounds_2d
Section titled “set_bounds_2d”void set_bounds_2d(bounds: Rect2)
Sets 2D bounds and makes the run 2D.
set_parameter
Section titled “set_parameter”void set_parameter(name: StringName, value: Variant)
The value the parameter name has in this run (see ProceduralGraph.bind_parameter()).