Painting trees

Hello everyone!

I come here today with a question for which I’m not sure there’s an answer at the moment. I want to paint trees on a terrain, some samples that I brought in from SpeedTree. These samples will replace a previous model that I have for the trees, which was a low poly model of a whole area.

The main problem here is that the low poly model that I have has different sizes for the individual trees. Here’s a picture of what it looks like:

And I would like to paint my SpeedTree model and have the same position and scale as in the image above. As of right now, I can do that - using the tree trunks of my low poly model as the surface in which to paint. The problem is that the size for the new trees is the default one, and I can only change the scale of them manually. Would there be any way in which the new models would occupy the volume of the previous ones I had?

Thanks for your time!

If you already have actors in the correct positions, with the correct scale - why not simply swap them for your high-res versions?

Select your low poly trees in the World outliner, and change the ‘static mesh’ to point to your new asset.

EDIT: oh, I see - your trees are combined into one single mesh. Ignore my post above.

It’s possible (in a blueprint) to get the boundingbox information from an actor, iterate through each instance of a particular class in the level (in this case ‘static meshes’), and it looks like it’s also possible to update the mesh in a static mesh actor in a blueprint as well.

If you split your low-res tree mesh into individual objects, you should be able to bulk import the entire thing into Unreal using fbx, with each tree as a separate actor.

It should then be possible to iterate through each static mesh, get it’s bounding box, and swap in your high-res mesh at the correct size. I’m not slick enough with blueprint to put anything like that together quickly, but it looks like it’s worth some digging.

Thanks Scribbler for your answer! I had considered doing something like that, but then the Engine would have to deal with multiple - thousands - of actors. I believe it’s much more efficient to use the foliage system, where given one mesh it can be instanced as many times as you want throughout the scene. Optimising this process as much as I can is vital, since I want to work on a huge area.

But! If I understand you correctly, do you think I could replace ALL those low poly separate actors with just high poly static mesh that would have the scale of each individual low poly asset? If that were the case, it might be worth doing that since the engine would only have to calculate one.

I’m not an expert on the tech side of the engine, so if anyone more versed on optimising the scenes and how the engine actually works knows of a better way, it would be great to know! Thanks again a lot for you comment Scribbler, I will give it a go.

highlight the mesh you want them replaced with in the content browser
then in the game screen select everything you wish to replace
right click and hit the Replace selected actors with button

That’s what I initially thought, but when I read the description of the problem again, all of the trees are currently merged into one mesh in another DCC - there isn’t a list of actors to replace.

I’m not an expert either - but as I understand it, the foliage system is simply an efficient way of creating hierarchical instanced static meshes. You can create these with a blueprint, so theoretically all your trees replaced with a small number of instanced meshes would be just as efficient as if you used the foliage tool.

The foliage tool doesn’t allow you to create ‘as many trees as you want’ - give it something with enough polys or opacity overdraw, and it’ll grind the engine to a halt with only a few dozen…