'Merge Static Mesh Actors' block ignores materials?

Hello. I’m writing some custom dataprep blocks to merge static meshes by hierarchy (very useful for importing from Vectorworks architectural models, which are a massive splurge of primitives), using blueprints. I’m merging the meshes using the ‘Merge Static Mesh Actors’ block, and it works fine, but the materials on the resultant merges are completely gone. The merged objects have the correct material slots, but there’s too many objects and too many reimports to consider assigning these materials by hand, and I can’t use some sort of editor script as there is no information attached to the material slots that could link them to the correct material.

I’ve combed the guides on the options for this block as there is a lot of options. But I can’t find any way to make the materials carry over. ‘Merge materials’ isn’t what I’m looking for as it has a steep decrease in quality, and also… merges the materials which isn’t what I’m after.

My hallcinatory friend chatgpt says lots of forum post suggest this is just a known issue and keeps trying to suggest made up workarounds. Is this true? Am I just missing a setting? I’m an excellent programmer so if there’s a code-based workaround not exposed in blueprints, I’d love some pointers. Thanks in advance :slight_smile:

The Merge Static Mesh Actors function is from the Static Mesh Editor Subsystem, it is made to work on actors in the current level.

Dataprep uses a temporary, transient, context to run operations and then the commit will transfer actors and assets tot the actual level. If you use the Merge Static Mesh Actors on Dataprep transient objects you will end up in an inconsistent state.

Dataprep has a merge function you see in the UI that would work better but for some reason that is not exposed to the blueprint and you cannot use it in a custom dataprep operation. There is a ticket for that but it is very low priority and it is basically stale for now.

You could check how other function like setMesh or SetLodGroup are both in UI and in Blueprint.

Else you do it as a post operation once dataprep is done.

1 Like

Thanks for the information, I’ll try find a workaround. Post operation was my first thought as well but the merged objects have nothing but unnamed material slots - no way to figure out what material each slot had originally. I’ll look into writing new meshes and copying over materials if I can’t figure anything else though.

Very odd and frustrating there’s no built in way to perform procedural merge operations in dataprep. Seems to me like one of the first things anyone would want to do when importing large cad files is reduce the insane object count. I don’t see how dataprep can frame itself as a game changer when you can only operate on one group at a time.