x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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.

Product Version: UE 4.12
Tags:
more ▼

asked Jul 27 '16 at 06:56 PM in Blueprint Scripting

avatar image

ryandlf
81 19 20 21

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hey there,

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!

Best regards,

Damir H.

more ▼

answered Jul 27 '16 at 08:18 PM

avatar image

DamirH
589 22 24 41

avatar image ryandlf Jul 28 '16 at 01:29 AM

Is there a way to create a function that a blueprint can use to run the c++ and get a returned object such as the mesh to then continue using in blueprint?

avatar image ryandlf Jul 28 '16 at 01:31 AM

Also have you seen this plugin? https://forums.unrealengine.com/showthread.php?3851-(39)-Rama-s-Extra-Blueprint-Nodes-for-You-as-a-Plugin-No-C-Required!&p=167829&viewfull=1#post167829 Would that possibly work? Sorry not new to programming, but pretty new to Unreal and never used c++.

avatar image DamirH Jul 28 '16 at 01:40 AM

That node from Rama's plugin would work but you'd still have to generate the paths manually and it'd all happen synchronously. But there is nothing stopping you from exposing the functionality to Blueprint.

For now, since you're new, use Rama's plugin node. Once you get more comfortable with the engine switch over to the C++ solution.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question