OrigamiDev-Pete / MeshBatcher

A Godot plugin for batching MeshInstance nodes into a single MultiMeshInstance to improve performance.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clarifying MeshBatcher Usage

MiqueiasDevGames opened this issue · comments

Could you give me a better explanation? what I understood was that when placing meshinstances as children of MeshBatcher at runtime they become a multimeshinstance which is good for performance, but I can't understand the inspector properties, how to use it:

Collision Ref
Scene Name
multimesh

Could you give me a more detailed explanation.

Thanks!!

Hi there,

Thanks for your interest in the plugin! The reason these inspector properties are visible is largely vestigial but can be useful to verify that the plugin is working correctly. All three fields should be automatically populated when batching and cleared when unbatching depending on if you use collisions and/or scenes as children of the MeshBatcher node.

The Collision Ref keeps a reference to a node that's created during batching that holds the staticBody and collisionShape nodes from the unbatched meshes.
image

The Scene Name is only used if you are using a scene as a child of MeshBatcher so that it can regenerate the original scenes when unbatching.
image

And the Multimesh field is a product of using the MultiMesh node as a base node for the MeshBatcher node so we just inherit that one.

You're not required to use collisions or scenes when using MeshBatcher but if you do then node relationships need to be exactly as the pictures above, and everything should just work™.

I hope that helps!

I got it, thanks!!