Animated wave of growing static mesh actors

Hi

I am trying to create a re-usable BP system where I can import a tonne of static mesh actors (thousands!!) into my level via Datasmith, and have them all animate to zero scale in 1 seconds and back to 100% scale again in 1 seconds. Ideally with a Bezier (soft) start and finish to the motion, or a bounce.

What complicates matters is that they can’t all start at the same time.

I have another actor in the level (grow point).
The closest static mesh to “grow point” will start growing first, the furthest mesh will start last. This will create a wave of growth starting from the “grow point”

I know I can do this if I convert every static mesh actor into its own blueprint and put logic with a timeline within, but I would rather not have to do this if I don’t need to.

So far I have the nice wave motion from the grow point but everything just appears/disappears

Adding in another timeline to control the rate of scaling obviously wont work, as we are already operating with a timeline.

Is there any creative way to do this?
Many thanks!

If you want to do it this way, you’ll need an array floats which represents the scale of each actor. Each float occupies the same index as the actors do in you main array.

You can use a lerp to go from the current size, to the target size.

It’s still going to run like a dog with a wooden leg though.

What would work a lot better, is to do this in the material using world position offset. The material instance is set to adjust the ‘fade point’ depending on distance from the origin ( or a fixed point ).

Much faster.

PS: Tell me if you need help with that.

Thank you ClockworkOcean!!

All these static meshes will have many different materials (easily hundreds of Datasmith interpreted materials) Would your idea involve going into each material and amending manually?

As far as lerping from current to target size, what would you use to control the lerp’s alpha pin?

My understanding is that whilst my sweeping timeline+Grow point helps sweep through the meshes in the level triggering each to appear (0 to 1 scale), this must happen instantly for each mesh. As the timeline wont wait for each to appear over time.

If meshes appear over time (via a controlled lerp) then each object would have to appear fully before the next could start (Single thread BP execution??). I would have to keep pausing the sweep timeline for each object, correct?

To have a nice wave motion there needs be lots of time overlap (Many meshes at different stages of growth).
Am I asking too much!! :innocent:

One way or another, you’ll need to manage your total lack of framerate when you try and do this.

Have you tried importing thousands of meshes with different materials? I think even that is going to drop you to a limp.

The classic ways to get around this problem are ( among others )

  1. Do it in the material ( don’t actually scale things )

  2. Use the same material for everything

You can use one material that looks very different for each mesh, depending on params etc.

You use the timeline output to drive the lerp. I’m gonna read this again and come back.

Yes, I realise this situation is about as far as one can get from an ideal game optimised solution.
I am creating for a non-game walkthrough experience where the platform for playing the package is a controlled environment (always the same rig). A low frame rate is also not such an issue either.

I regularly import massive scenes to unreal with hundreds of furniture pieces and thousands of props. All with their own materials and get laughable frame rates around 10-30fps which is still workable for what I need.

I would be very interested if there is a way to drive the lerp with a timeline, whilst that lerp is itself used for all these meshes and starting at a variable time (based on distance to growpoint).

The standard way to set a lerp with a timeline is

Here’s a particle system I made, all scaling is done in the material, tell me if you want more info:

cubes

10k cubes.

cubesclose

If performance doesn’t matter, then why not use BPs?

2 Likes

I will try to integrate the Timeline+lerp into my example BP above and get back to you with specific questions.

Thank you for the example.
I am not sure how easy this will be to implement on all the imported materials.
Last medium size project I worked on had 238 different materials for furniture and 486 for props
I would likely have to script some python to process all this every time I import/re-import

Yes, performance does not really matter. Production speed is key! :sweat:
I thought the BP root involved converting each static mesh into a BP + adding the logic + placing BP in scene to replace original static mesh.

This is quite labor intensive. I have already done this on a small test scene and it worked very well but I only had a couple of different objects.

Is there an automatic way to convert level static mesh actors, into BPs?

For example: An interior with

  1. 100 work desks (instanced)
  2. 100 work chairs (instanced)
  3. 10 sofas (instanced)
  4. 20 arm chairs (instanced)
  5. 10 coffee tables (instanced)
  6. 20 storage units (instanced)

All this is setup and instanced in 3dsMax and imported to UE4 via Datasmith.

Could I select all these 260 objects and auto convert to 6 unique BPs which replaces the all level actors? I could then copy paste the BP logic 6 times which should be fast(ish).

You have to make a blueprint for the desk, and the put 100 copies in the level, and so on. Once you’ve made the BP, it’s just a matter of selecting all the meshes and right clicking ( replace ).

So you only need to make 6 blueprints.

EDIT: In fact, one BP will do the trick, as long as you understand about inheritance. Because the BP is always doing the same thing and just contains a mesh, you can completely generalize it.

Sorry for the very delayed reply. Got pulled onto other projects and this tab got buried in my browser!

Thank you for the confirmation.
I suspect I might be able to script this with some python. Just expose the mesh parameter and replace static mesh reference for each in level instance. Sounds easy, in theory!! ;p

Now I just need to find the time to get back to this!

1 Like