How to copy and paste foliage on the same level?

Hello!
I wanted to know if it is possible to copy and paste the Instanced foliage actor somehow.
I am trying to create a loop in my scene created inside Unreal, for this I need to copy the grass that I have created with the foliage tool and replicate it to create a perfect loop. I have tried to use merge actors to merge it with the ground and copy and paste both, but it copies everything but the foliage.

Could someone help me find a solution for this? Thanks in advance.

Hi MeryCrazy95,

You can alt-drag your selected foliage to create copies - but it can be very hard to work out the correct tiling. Also, you’re probably going to want to mirror it to remove the tiling.

Another way is with something I’ve just added to one of my plugins - but I’m still beta testing it - rdBPtools.

It can now copy your foliage (static mesh instances) from anything, eg a foliage volume or a PCG volume etc - into either a blueprint or as individual actors (not advisable for lots of grass) - if you convert to a blueprint - you can place as many as you want into your level (all aligned correctly to tile) - then convert back to foliage if you wish.

I’ll hopefully have it finished and submitted to Epic with a week…

1 Like

Copy and paste works, it just requires that you first paint the same meshes into it at least once.
After its initialized a paste from selected instances found in a different level should work ok.
It used to in .45 anyway.

An alternative would be to alt drag to create a copy of the instances within the same foliage, and them move them out to wherever they ought to be.

1 Like

Unfortunately alt and drag does not work with instanced foliage actor :frowning:

I am trying to convert my instanced foliage actor to static mesh, and then pass it to blue print. The problem is that, when I try to convert all my grass from Instanced Foliage actor to static mesh, it creates a Static Mesh element but only with one grass, not the whole lawn that I painted.

Would you know how I could convert my entire lawn to static mesh? I attach here some screenshots so you can see better what I mean.

The only thing I can think of I’m afraid is to purchase rdBPtools, then I can send you the beta version I have here where it converts that instanced foliage actor into a Blueprint from where you can convert to one static mesh if you wish.

Someone else may know of a way to do it though - it’s possible I missed some obscure method when I was looking…

Alt drag definitely works.

How else do you think people set up fields/rows of plants?

You have to select the individual instances within the foliage actor, then alt-drag.

Converting foliage to static meshes is usually done from the foliage painting tool, or the options panel - it should have a button somewhere that will do it for all the instance(s).

Otherwise, you have to set up a loop system, and it gets complicated;

First, in blueprint you have a very rigid loop limit, so you need to come up with a way to only batch 100 isntances at a time or so.

This means you need to remove the instance after processing it because the index numbering won’t really help.
So the loop should check what mesh to use, add a mesh, move it at the cottect transform, remove it from the foliage, and step on to the next instance.

I would advice of adding the mesh and instance to a custom HISM, otherwise processing instances will likely grind the engine to a halt (performance wise).

Can you please make some snapshots for this - I can’t find any button as you mention…

The only mention I’ve found on the web is a forum post from 2017 and it suggests right-clicking on the Foliage Actor and export - I couldn’t find that in the later versions - and export option from the filmenu exports the complete level…

Odd, I cant seem to find the button anymore either.
Perhaps its part of ue5 or avaliable in .27

From what I recall you can also select instances individually (in .25 if you click a foliage instance the whole actor gets selected), and right click to convert them to static meshes.

The option could also pop up in persistent/world composition enabled levels somwhere though, didnt have one handy to test without waiting a few hours on shaders.

Chances are, the button I remeber is actually part of some plugin or similar that is currently not installed - and I really cannot remeber which.
Or perhaps, a part of the procedural foliage system, which I tend to use more extensively in projects anyway.

Making your own bluetility script as mentioned above would be the best solution for .25

Regardless,

The copy/pasting and duplication via alt drag definitely works.
Here’s the how to:

1 Like

It definitely works, thanks so much for sharing the tutorial!

The only problem now is that when I create the copies within the same foliage, I can’t move these new copies to the exact spot I need, because the whole grass is moved. And I would need to move these new copies to the exact point so that there are no jumps in the loop.

Would you know if it would be possible to separate these new copies somehow? I’m sorry for asking so many questions, but I’ve only been working with the program for a short time and I’m still missing a lot of things.

Unfortunately the foliage is just a single instance, so there really isn’t a way to keep the copies separated.

You could try to use a persistent level and multiple levels to have multiple foliage actors individualized - via world composition.

If your issue is just to move the duplicated foliage correctly, you can change the movement increments to 100 or so. Top right corner of PIE should have various options.
The bigger the number, the less control ofc, but if you build out the base level in perfect increments it will end up working perfectly.

Yes, that’s why you want to create it as a blueprint, then mirror the placement of the grass.

The solution I’ve been suggesting is really the easiest way for you to do it - rdBPtools - (it can snap to position too) - but I take it you don’t have the funds - so if you want, I can give you a copy - just email me at rd@recourse.nz.

Perfect, I just emailed you :slight_smile:

1 Like