Dynamically Loading Large Groups of Static Mesh in Blueprint
I've got an FBX from blender that contains approximately 2000 individual meshes. I need to import that into Unreal as individual meshes (which i've done already by using import and unchecking combine), but I need each static mesh to be part of it's own blueprint which will actually be a child of a master blueprint.
The reason for this is because I need to dynamically load these assets as well as be able to store variables that coincide with the mesh, having functions like highlighting etc. In the end i'll have a single master blueprint, that when created spawns all those 2000 pieces, but I need to be able to reference the meshes so that I can loop through them.
I'm thinking if I could somehow in my parent blueprint tell it to grab every static mesh from a specific folder in the content browser, then create an instance of my child blueprint for each, then set the static mesh to that instance. The static meshes are all named the same with incrementing numbers so maybe a loop and get the mesh by name by using a static string and then just adding the number to the end in a loop instead of the folder idea?
Right now the only option I can find is to do this manually. The thought of having to sit there and create 2000 blueprints and drag and position a mesh in each one is depressing.
asked Jul 27 '16 at 06:56 PM in Blueprint Scripting
Your first idea was spot on, although you might have to dive into C++ to do it. Take a look at this:https://docs.unrealengine.com/latest/INT/Programming/Assets/AsyncLoading/
More importantly, take a look at the first code sample regarding the Object Library. It generates the library from a folder path and you can then dynamically (and asynchronously) load all the objects. Then your master BP could just create your child blueprint class and assign the proper mesh as you wrote.
The reason I'm not sure it works in Blueprint is because I don't think this sort of dynamic Object Library creation (or even any Object Library functionality) is exposed to Blueprint, although you CAN create OL assets in the Content Browser and manually assign objects to them. Hope that helps!
answered Jul 27 '16 at 08:18 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here