Foliage to SM

Hello guys,

Is there a way to transform instancedFoliageActor to a static mesh or BP?
Or either way, is there a way to foliage my landscape with StaticMesh/BP directly instead of InstancedFoliageActor?

I have a grass blueprint ( I need it to be a blueprint because I’m interacting with it).

So, as I can’t paint my landscape with blueprint directly ( is there a way to do that ? ) i’m painting foliage with the static mesh of my blueprint, resulting of lots of instancedFoliageActors on my map.
As I need it to be a blueprint, when i’m near one of my FoliageinstanceActor, I’m trying to delete this specific foliage element and spawing the BP at the same place allowing me to interact with it, but I really don’t find a way to interact with one specific foliage element.
My line trace return InstancedFoliageActor but can’t find a way to interact with it. If i remove this actor, it’s all the foliage that disappear

Can someone explain me a bit how I am supposed to do please i’m a bit lost, i must have the wrong approach here to do what i want.

Thank’s a lot !

UE used to support actor foliage, so you could paint your blueprint all over the place with the foliage tool. But, not recommended, especially if you’ve got a lot of grass.

The way most people approach this, is to use instanced foliage ( possibly scattered using your own tool, easy to do ), and when you do the trace, you swap out the mesh instance for your blueprint, so you can interact with it.

I’m pretty sure, this

is the instance counter.

Thank you for your time !

It actually does not work this way, i’ve tried it too.
The Hit item return just a number, the number of the foliage instance.
Look, here i’m printing the Hit item and the Hit component :

how do you cast to one instancefoliageactor ? Can’t find out…

i’m loosing it i’ve made a bp that spawn at the begining my grassblueprint all over the map, but there are BP so it gonna be so heavy… :frowning:

I just tested it. It works fine :slight_smile:

Hit item gives me the instance

instance

1 Like

Thank you for taking time for this !

yes as in my capture, it give you the number of this instance yes. But how to you manipulate THIS specific instance ? Like removing it and getting its transform ? That’s my issue

1 Like

If i try to cast to the foliage it says “Foliage Type Instances Static Mesh” does not inherit from 'Primitive Component" cast would always fail

it drives me crazy

In my case, I have one instanced mesh, 3 instances of it. This works

If you have more than one instanced mesh of course, you can’t use item zero of the components.

1 Like

Ohhh i think you did what i’ve been looking for, for days !!

I’m not yet comfortable with instanced stuff, it’s still a bit abstract to me for now

I think i understand a bit better how it works now.
There is a main actor : the foliage, and this one contains multiple instances of meshes.

Thank you so much for you help and time, you made me progress a lot :smiley:

Nearly :slight_smile:

You have one actor = foliage.

It contains instances of instanced meshes.

Let’s say I make some foliage using 3 meshes. A cube, a pyramid and a sphere. There is still only one foliage actor ( always ), and it has 3 components ( the meshes ), and there are instances of those meshes.

There might be 200 cubes, 2 pyramids and one sphere.

The foliage actor sets up a cube ready for instancing, and creates 200 instances of it, same for the other shapes. You never see the instanced meshes, just the instances of them.

1 Like

If you want more control over the process at some point, you might write your own mesh instancing process. Much easier than it sounds. Then you know what’s going on, and can have access to all the mesh locations and transforms up front, because you put them there… :smiley:

1 Like

I though I got it but the coordinates are really strange… if i compare to the coordinate of my tree fr example. The Z coordinate is… certainly not correct :

Did i missunderstood something in here if I can ask you ?

image

1 Like

Oh you’re really good it was that ! Thank you again !

How does it behave when this option is not checked ? What is this option doing ?

I think it’s relative location then. Relative to the foliage actor. Could be wrong.

1 Like

Oh I see !

Thank you

1 Like