Skip to content

Search

Documentation

multimesh3d component

Godot's MultiMeshInstance3D: the multimesh asset in source, its mesh drawn once per instance in one call, each instance's color tinted over the node's.…

On this page

3d · render · 17 properties · 3D

Godot's MultiMeshInstance3D: the multimesh asset in source, its mesh drawn once per instance in one call, each instance's color tinted over the node's. The node keeps its own copy of the instances, so a script's edits stay on it; children draw once.

In a scene, multimesh3d is the node key that applies it. A script reaches each property below as a field on node.multimesh3d: reading one asks the running component, and assigning one leaves the rest alone. The whole table is node.multimesh3d.get() and node.multimesh3d.set(table).

Properties

property type default description
cast_shadow bool true Whether the instances cast a shadow from the lights that cast
color color [1,1,1,1] Tint under every instance's own colour, as channel floats or #rrggbb / #rrggbbaa
depth_test bool true Let the scene hide it; off draws it over everything drawn before it and leaves the depth as it was
dot_color color [0,0,0,0] The vertex dots' colour; an alpha of zero takes the node's own. Not drawn on a skinned mesh, which Balaur poses in its own vertex stage
dot_size float 0 Size of a dot drawn on every vertex; zero draws none. Not drawn on a skinned mesh, which Balaur poses in its own vertex stage. Not on WebGL2 At least 0.
dot_sizing enum world What dot_size counts: world is pixels at one world unit from the camera, thinning with distance, screen is pixels One of world, screen.
draw_surface bool true Whether the surface draws; off leaves the wireframe and the dots alone
light_layers int -1 Light-layer bitmask; a light3d lights this when their masks share a bit. -1 is every layer
material asset · material — The material every instance draws with; empty draws with the built-in one
receive_shadows bool true Whether shadows land on it; off lights it as if nothing stood between it and every light
render_layers int -1 Layer bitmask; a camera3d draws this when their render_layers share a bit. -1 is every layer
segmentation_id int 0 The id render.snap_aov("segmentation") colours this node by; nodes sharing one share a colour. Zero takes one of its own, from 1 up At least 0.
source asset · multimesh — The multimesh asset: the mesh and the instances it is drawn at
texture asset · texture — Image file, project-relative, or a texture asset; empty draws the colour alone
wireframe_color color [0,0,0,0] The wireframe's colour; an alpha of zero takes the node's own. Not drawn on a skinned mesh, which Balaur poses in its own vertex stage
wireframe_sizing enum world What wireframe_width counts: world is pixels at one world unit from the camera, thinning with distance, screen is pixels One of world, screen.
wireframe_width float 0 Width of a line drawn along every triangle edge; zero draws none. Not drawn on a skinned mesh, which Balaur poses in its own vertex stage. Not on WebGL2 At least 0.

Asset types this component references: material, multimesh, texture.

Script functions

Methods of node.multimesh3d, the handle a node carrying this component exposes. Every handle also has get(), set(table), patch(table), has() and remove().

From render:

method what it does
buffer() -> any 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(int) -> any The colour one instance draws in.
instance_count() -> int How many instances the node holds.
instance_custom_data(int) -> any One instance's four floats of custom data, as a colour.
instance_transform(int) -> any One instance's transform: a Transform3d, or a Transform2d on a 2D node.
instances() -> any Every instance as the multimesh asset spells it, so assets.save writes a scripted layout into a file.
populate(any) -> any 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(any) 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(int, any) The colour one instance draws in.
set_instance_count(int) 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(int, any) Four floats a material's shader reads for one instance, as a colour or a list.
set_instance_transform(int, any) Place one instance with a Transform3d, or a Transform2d on a 2D node. A shear is kept, as the instance's basis.
set_instances(any) Replace every instance with a list in the multimesh asset's shape.
set_visible_instance_count(int) How many instances draw, from the first; -1 draws them all.
visible_instance_count() -> int How many instances draw; -1 is all of them.