Download

Make foliage persistent on level

Hi, I am using C++ code to generate instanced meshes on my level, problem is these are instantiated at runtime (gameplay) only and disappear from the level once the game is stopped in editor. I don’t want to use the procedural foliage tool as it is too limited.

What I want to do is generate the mesh instances on the level then save them as part of the level, I don’t want to generate them everytime the game runs. How can I do that? I guess I can make an Editor plugin, but that looks like a complicated solution, I would prefer to just do it in the game once then save the level as it has been generated.

Answering my own question after some research: it looks like the right way is to make an editor plugin and use features from the FoliageEdit module. Problem is that most classes from this module are not exported! So the only way for now is to build the engine from source exporting the appropriate classes, the plugin will then be able to use them.