Can you save a procedural mesh to world outline

Is it possible to save a procedural mesh to the world outline?

I’m looking at writing an importer and my main questions are:

  1. Can I automatically place the imported items into the right locations and orientations in the world?
  2. Can I split the import into multiple assets rather than one big, bound asset?

Rather than being a runtime thing, this would be assets that appear in the content browser, but in the case of large imports manually putting everything into the scene seems arduous. Just merging them into one object with multiple materials isn’t really a good solution either, as this lacks post-import flexibility.

Anyone know?

In terms of placing things into the editor, UUnrealEdEngine (an instance of which is stored in the GEditor global variable) has an ‘AddActor’ function that saves the given actor into the scene outline, and the level can then be saved with this inside it.

It will, however, be quite slow for lots of actors - you can subclass this and use your own without modifying the engine source, and write a faster way using the same guts as the above function. Might not be worth it unless you’re placing a lot of actors at once, though.

That sounds like what I’m after, thank you!

With the procedural meshes, can they be saved as content browser assets, or is that a different path altogether?

Not sure! Sounds like karltheawesome was working on something related, as was kamrann:

Looks like you might have to get dirty :wink:

Interesting! I’m going to have a crack at using the SpeedTree importer as an example I guess, since the source is available.

Alright, new question.

From the speedtree importer I see that you use a factory and UE sends through a pointer to a buffer and a buffer size, abstracting the whole process from the file aspect. Nice.

My question is, what happens if you load up a really, really big file? Something 30+ gigs in size? Do you run out of memory, does it segment it or what?

If I recall properly, its a buffered read, its still reading from the file, but it buffers a certain amount of data, so a 30GB file will not make you run out of memory unless of course you try to read the whole thing into your own container, but otherwise it should work fine. I never tried to import a file that big before, 3/4gb was about the biggest I had to deal with.

Gotcha, thanks!

Just out of curiosity, is there a way of getting the asset file path rather than the buffer? And if so, is it possible to disable the initial buffer read so the asset file isn’t read more than once?

Not that I am aware of, what i did for one of my files was use a text file wrapper. Which just contained paths to the big files, and used the text reading part of the importer to read in the text wrapper, and then use the FArchive Buffer Reader to read each of the big files in.