VoxelInstanceLibraryMultiMeshItem¶
Inherits: VoxelInstanceLibraryItem
Instancer model using MultiMesh to render.
Description:¶
This model is suited for rendering very large amounts of simple instances, such as grass and rocks.
Properties:¶
| Type | Name | Default |
|---|---|---|
| PackedFloat32Array | _mesh_lod_distance_ratios | PackedFloat32Array(0.2, 0.35, 0.6, 1) |
| ShadowCastingSetting | cast_shadow | 1 |
| float | collision_distance | -1.0 |
| int | collision_layer | 1 |
| int | collision_mask | 1 |
| Array | collision_shapes | [] |
| GIMode | gi_mode | 1 |
| bool | hide_beyond_max_lod | false |
| Material | material_override | |
| Mesh | mesh | |
| float | mesh_lod0_distance_ratio | 0.2 |
| Mesh | mesh_lod1 | |
| float | mesh_lod1_distance_ratio | 0.35 |
| Mesh | mesh_lod2 | |
| float | mesh_lod2_distance_ratio | 0.6 |
| Mesh | mesh_lod3 | |
| float | mesh_lod3_distance_ratio | 1.0 |
| RemovalBehavior | removal_behavior | REMOVAL_BEHAVIOR_NONE (0) |
| PackedScene | removal_scene | |
| int | render_layer | 1 |
| PackedScene | scene |
Methods:¶
| Return | Signature |
|---|---|
| void | _on_instance_removed ( VoxelInstancer instancer, Transform3D transform ) virtual |
| StringName[] | get_collider_group_names ( ) const |
| Mesh | get_mesh ( int mesh_lod_index ) const |
| void | set_collider_group_names ( StringName[] names ) |
| void | set_mesh ( Mesh mesh, int mesh_lod_index ) |
| void | setup_from_template ( Node node ) |
Enumerations:¶
enum RemovalBehavior:
- REMOVAL_BEHAVIOR_NONE = 0 --- No extra logic will run when instances are removed.
- REMOVAL_BEHAVIOR_INSTANTIATE = 1 --- Instantiates the removal_scene for each instance getting removed. The scene must have a root derived from Node3D, and will be given the same transform as the instance before being added to the scene tree. It will be added under the VoxelInstancer node.
- REMOVAL_BEHAVIOR_CALLBACK = 2 --- Calls _on_instance_removed when an instance gets removed. You should attach a script to the item in order to implement this. Note: every resource can have a Object.script. But in the editor, Godot currently doesn't show you that property if the resource appears in a sub-inspector. To workaround that, right-click the property in which the resource is, and choose "Edit". That will open the item in a full inspector. An alternative is to save your item as a file, and then edit it from the file browser.
Constants:¶
- MAX_MESH_LODS = 4
Property Descriptions¶
PackedFloat32Array _mesh_lod_distance_ratios = PackedFloat32Array(0.2, 0.35, 0.6, 1)¶
(This property has no documentation)
ShadowCastingSetting cast_shadow = 1¶
(This property has no documentation)
float collision_distance = -1.0¶
When greater than 0 and colliders are configured, hints the distance below which colliders may be created. This allows to reduce the amount of colliders while keeping a high view distance for visuals.
When negative, colliders will be created at all distances.
Note: the instancer creates/removes colliders on a per-chunk basis, so this distance is compared against the distance to chunks, and not individual instances.
int collision_layer = 1¶
(This property has no documentation)
int collision_mask = 1¶
(This property has no documentation)
Array collision_shapes = []¶
Alternating list of CollisionShape and Transform3D. Shape comes first, followed by its local transform relative to the instance. Setting up collision shapes in the editor may require using a scene instead.
GIMode gi_mode = 1¶
(This property has no documentation)
bool hide_beyond_max_lod = false¶
(This property has no documentation)
Material material_override¶
(This property has no documentation)
Mesh mesh¶
(This property has no documentation)
float mesh_lod0_distance_ratio = 0.2¶
(This property has no documentation)
Mesh mesh_lod1¶
(This property has no documentation)
float mesh_lod1_distance_ratio = 0.35¶
(This property has no documentation)
Mesh mesh_lod2¶
(This property has no documentation)
float mesh_lod2_distance_ratio = 0.6¶
(This property has no documentation)
Mesh mesh_lod3¶
(This property has no documentation)
float mesh_lod3_distance_ratio = 1.0¶
(This property has no documentation)
RemovalBehavior removal_behavior = REMOVAL_BEHAVIOR_NONE (0)¶
Specifies what should happen when instances get removed. This is useful if they should turn into more complex objects with animation or logic in them.
PackedScene removal_scene¶
Scene that will be used if removal_behavior is set to REMOVAL_BEHAVIOR_INSTANTIATE.
int render_layer = 1¶
(This property has no documentation)
PackedScene scene¶
Scene that will be used as configuration instead of manual properties. It should have a specific node structure to be supported. See https://voxel-tools.readthedocs.io/en/latest/instancing/#setting-up-a-multimesh-item-from-a-scene
Method Descriptions¶
void _on_instance_removed( VoxelInstancer instancer, Transform3D transform )¶
This method will be called if you set removal_behavior to REMOVAL_BEHAVIOR_CALLBACK.
Note: this method can be called from within the removal of a node that is child of VoxelInstancer. In this context, Godot will prevent you from adding new child nodes. You can workaround that by using Object.call_deferred. See also VoxelInstancerRigidBody.queue_free_and_notify_instancer.
StringName[] get_collider_group_names( )¶
Gets the list of group names that are added to collider nodes.
Mesh get_mesh( int mesh_lod_index )¶
(This method has no documentation)
void set_collider_group_names( StringName[] names )¶
Sets the list of group names that will be added to collider nodes generated for each instance.
void set_mesh( Mesh mesh, int mesh_lod_index )¶
(This method has no documentation)
void setup_from_template( Node node )¶
(This method has no documentation)
Generated on Jan 26, 2026