Assemble a blueprint with mesh components during import

Forgive me if this has been asked or addressed in the docs, but I can’t seem to find an answer…

Is it possible to automate the process of creating a Blueprint asset, assembling static and skeletal mesh components while building the game, not when spawned in the level or at runtime? Ideally using Blutility would be nice, but if not, what about through C++?

Thanks for any insight!

What exactly do you mean by assemble a blueprint? Like attach weapon meshes to a monsters hand and what not?

Yeah, that’s sort of what I’m thinking. In this particular case we have some hard surface machinery with lots of distinct parts that need to be “grouped” together into several large BP assets - some are static meshes, and some are skeletal. Rather than going through and assembling hundreds of these parts manually, I’d love to be able to automate the process.

I know we can do this at runtime or when spawning the Blueprint, but can it be done in the Editor through Blutility or C++?

Well you kinda have to do it manually, sorta, I mean if you thought about it im sure you could design some kind of automated system, but even then there will be things that you have to do manually. Now if you just want to set up all these parts in the blueprint before its ever spawned into the world you can. When you add a mesh component to a blueprint, just make sure its under the mesh you want it to be attached to then in its Details: Sockets: Parent Socket: that box there, you type the name of what socket you want it to be attached to or click the magnifying glass icon next to the box and it will give you a list of all available sockets for the mesh that it has as its parent. This is how i attach weapons to monsters in my current project before run time. makes it easier to see what its going to look like ahead of time as well, though you can also preview what something will look like in the skeleton viewer by attaching things there as preview only.

Right… that’s sort of how I’m going about it now for assembling these things. But this project isn’t really like adding weapons to creatures - more like adding all the individual parts to a fully detailed car. It’s just a tremendously tedious and painstaking process to do everything manually since there are so many parts.

I’m really looking for a way to do this through code by reading in some sort of manifest file. I’ve written a general purpose output script in MEL that exports all the individual parts from Maya and writes a text file outlining what joint each object belongs to. I’d really like to parse this file in UE4 and use it to add each static mesh component to the appropriate parent joint or socket automatically. I just don’t know how to add static mesh components to specific skeletal mesh joints via C++ or Blutility outside of a spawn or level event.

Yea this problem seems like it is going to take some leg work either way, sorry I cant be of more assistance.

Nah, I’m glad you’ve taken the time to discuss it with me and give feedback on the approach, so thanks!

I know it’ll be some work to do it either way - I just want to automate what is essentially a very repeatable process as much as possible.

You need a system to attach everything together, starting from one, or various “base” meshes/components. You basically add it as a mesh component, as a children of the root (collision or base mesh), then update the collision. You can have the program do it automatically by looping through attachment rules and arrays, or do it manually with huge if statement (bad practise). Then at the end, update the stats based on added components.

Thanks Zarkopafilis. I understand generally what you’re suggesting, but I guess my question is really more about how to trigger such a system to run in the Editor: basically edit-time instead of at run-time.

I get what your saying about adding mesh components and then looping through an array to populate the Actor. Right now the only way I can automate any changes to the Actor are if I make an instance of it in the level (i.e. “run-time”). I really need to add components to the Actor in the Content Browser (i.e. “edit-time”) so that I can use the final assembly in multiple levels.

Does this make sense?

Do let me know if you find the answer to this. I’m trying to do the same thing. Looking to assemble an actor blueprint via C++ that contains a collection of static meshes as a “prefab” equivalent.

You may want to look into ue4’s Blutility feature.