Skip to content

Search

Documentation

multimesh3d

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 · 9 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
light_layers flags [] The light layers this is lit on: a light3d lights it when their light_layers share one; empty is every layer One of 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32.
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 flags [] The layers this is drawn on: a camera3d draws it when their render_layers share one; empty is every layer One of 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32.
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

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 multimesh3d:

method what it does
instance_color(int) -> Color The colour one instance draws in.
instance_count() -> int How many instances the node holds.
instance_custom_data(int) -> Color One instance's four floats of custom data, as a colour.
instance_transform(int) -> Transform3d One instance's transform.
instances() -> [render::MultimeshInstance] Every instance as the multimesh asset spells it, so assets.save writes a scripted layout into a file.
set_instance_color(int, Color) 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, Color) Four floats a material's shader reads for one instance, as a colour.
set_instance_transform(int, Transform3d) Place one instance. A shear is kept, as the instance's basis.
set_instances([render::MultimeshInstance]) 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.

Are you sure?