Skip to content
Download
API reference

ProceduralRequest

Inherits: Shared < Object

Everything a run of a procedural graph can be given.

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).

TypeNameDefault
AABBboundsAABB(0, 0, 0, 0, 0, 0)
ProceduralGraphgraph
boolis_2dtrue
boolkeep_node_outputsfalse
intparallel_threshold2048
intseed0
intthreads0
booluse_cachetrue
ReturnsMethod
voidadd_input(name, data)
voidclear_inputs()
Rect2get_bounds_2d()
Dictionaryget_parameters()
voidset_bounds_2d(bounds)
voidset_parameter(name, value)

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).

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()).

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.

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.

bool use_cache = true

Setter/getter: set_use_cache(), get_use_cache()

Whether nodes reuse what they made before for the same input.

void add_input(name: StringName, data: ProceduralData)

Data the ProceduralNodeInput node named name gives (a polygon of the level, points from code…).

void clear_inputs()

Removes the data given with add_input().

Rect2 get_bounds_2d() const

The bounds as a rectangle.

Dictionary get_parameters() const

The parameter values of this run.

void set_bounds_2d(bounds: Rect2)

Sets 2D bounds and makes the run 2D.

void set_parameter(name: StringName, value: Variant)

The value the parameter name has in this run (see ProceduralGraph.bind_parameter()).