Download

Merging static mesh components ? / Need help with instanced static meshes

Hey,

So I have a blueprint with a bunch of static mesh components in my bp. The static mesh components are used to asseble themselves to objects like wall or bridges. However, once the assembly is done I would like to have the static mesh** components** merged to reduce drawcalls. I am now trying to use instance static meshes with the default 1x1 cube and just replacing the static mesh components with the instance static meshes using the transforms i saved in an array:

It seems to work however I always have this big 1x1 block spawned which is not what I want. I tried scaling the component down to like 0.1 and multiply the scale of the added instances by 10 but this would result in just the box spawning and not the instances. I tried making a very small static mesh and then use it as the static mesh in the component but for some reason this doesnt work as well as in this case, nothing is being spawned :frowning:

Can anyone help me out how I could effectively merge or replace my static mesh components to reduce drawcalls?

Additional pictures:

Thanks in advance

edit: just in case anyone misreads, I am not looking to merge static mesh actors but static mesh components inside a blueprint :slight_smile:

I have stumbled upon this but for some reason I cannot find the node

First things first. Are you considering making thousands and thousands of these? Otherwise it isn’t worth the bother. Just checking.

no but maybe alot of structures, I am considering making a building system based on this so the amount of static meshes could scale really badly.

I made this:

](filedata/fetch?id=1815059&d=1600974575)

It does work, and replaces 3 static mesh components, with instanced equivilents. I’m already thinking you’re running an earlier version of the engine.

I don’t know much about working with instances in BP, but I do know that info is very thin on the ground…

EDIT: Have the feeling that code doesn’t make sense… but it seems to work. If I add once ISM and make instances of it, that doesn’t work.

well, the problem I currently face is that my instanced SM does not work correctly (wrong scale and allignment) when I try to scale it down and put one in position. Currently theres this big 1x1m block generated when i add instances to my static mesh. How can I deform and adjust (transform) the SM in the instanced static mesh and still have my other instances scale correctly? For instance if i scale my instanced static mesh component, what happens is that the specified SM is default scale while everything else adjusted nicely.

The code I pasted copys all components and replaces them with ISMs with the correct transform.

tried to reconstruct it but for some reason it will not delete and replace the meshes. I did this in another blueprint, then call it when I need to by casting it. What am I doing wrong?

edit: had forgotten to select 1M cube, but the issue persists… When replacing one actor will be a fat cube like shown in the screens above. I cant figure out how i can get rid of the standard size cube. If I scale the Instance static mesh components, the children adopt that scale and multiplying the children by a number to compensate for the downscaling does not work :frowning:

Screen capture - 5069fb9b330df696750887a11fcf342b - Gyazo here is the problem again, one instance,I am guessing the parents will always be the default size…

Just curious, why the need to use and merge static mesh components in blueprint?

to crunch down on drawcalls in my case.