Skip to content

Search

Dokumentacja

multimesh3d

Thousands of copies of one mesh in one draw, each with its own transform, colour and custom data, through node.multimesh3d.

Na tej stronie

Thousands of copies of one mesh in one draw, each with its own transform, colour and custom data, through node.multimesh3d.

15 functions, 0 constants. Scripts reach it as multimesh3d::.

Acts on multimesh3d: those functions are also methods on the component's handle, without the node argument.

Functions

Argument kinds are the script values a call passes: node is a node handle, any a table or value of any kind, fn a callback.

function acts on what it does
buffer(Node) -> [float] multimesh3d Every instance as one flat list of floats in Godot's MultiMesh.buffer layout: 12 of transform in 3D or 8 in 2D, then 4 of colour and 4 of custom data.
instance_color(Node, int) -> Color multimesh3d The colour one instance draws in.
instance_count(Node) -> int multimesh3d How many instances the node holds.
instance_custom_data(Node, int) -> Color multimesh3d One instance's four floats of custom data, as a colour.
instance_transform(Node, int) -> Transform3d multimesh3d One instance's transform.
instances(Node) -> [render::MultimeshInstance] multimesh3d Every instance as the multimesh asset spells it, so assets.save writes a scripted layout into a file.
populate(Node, render::PopulateOptions) -> [render::MultimeshInstance] multimesh3d Godot's Populate Surface, and a row, a ring or a grid: the instances a layout would write, worked out from seed, returned in the multimesh asset's shape rather than set. kind is render.POPULATE_SURFACE with a surface node, POPULATE_ROW (count, step), POPULATE_RING (count, radius) or POPULATE_GRID (counts, step); rotation, tilt and random_scale vary each instance, as fractions, around scale.
set_buffer(Node, [float]) multimesh3d Replace every instance from one flat list in the layout buffer answers in, for a Godot port that sets buffer. Building the list in a script costs more than one set_instance_transform per instance.
set_instance_color(Node, int, Color) multimesh3d The colour one instance draws in.
set_instance_count(Node, int) multimesh3d How many instances the node holds. Those below the count keep where they were; new ones are plain, at the node.
set_instance_custom_data(Node, int, Color) multimesh3d Four floats a material's shader reads for one instance, as a colour.
set_instance_transform(Node, int, Transform3d) multimesh3d Place one instance. A shear is kept, as the instance's basis.
set_instances(Node, [render::MultimeshInstance]) multimesh3d Replace every instance with a list in the multimesh asset's shape.
set_visible_instance_count(Node, int) multimesh3d How many instances draw, from the first; -1 draws them all.
visible_instance_count(Node) -> int multimesh3d How many instances draw; -1 is all of them.

Na pewno?