Place Static Meshes with from Data Table

You can do it like this:

Do note that you can also reference static meshes directly in the DT, simplifying the whole process even further!

edit: Here’s what I mean:

This way you do not need additional storage array/map for the static meshes, you fetch them directly instead. This can be quickly set up in a *.cvs file outside of the editor - assuming you organised the files nicely.

Hi.

I have a data table like this

Index, PosX, PosY, PosZ, RotX, RotY, RotZ, RotW, modelname

1, 534, 244, 15, 0, 0, 0, -1, house1

2, 343, 238, 14.8, 0, 0, 0, 0, house2

3, …

The Pos’s and Rot’s are stored as float and modelname as string

And i have a folder with the models (StaticMesh) inside:
house1, house2, …

All i want to do is to read the table index by index and load by the modelname the model from the models folder and place it with the Position and Rotation from the table into the opened scene in UE4 editor. Is this possible to do? How i do this? With blueprints ot C++?
I need this not inGame, but only in UE4 editor. Like an additional function. I need this to create my Level.

I dont wont to manually place the models because there are hundrets of models in the folder to place into the Level (scene)

But how i place from blueprint (or c++ ) a static Mesh into the scene? I want like this: a window in which you select the data table und the models folder or multiple model folders and then automatically all models with Pos and Rots will be placed into the scene.
How can it be done?

I have multiple Data tables for each section of my map. North, west, east… and i have multiple folders with models.
I cannot reference the static Meshes directly because i have created my map in an external programm. It can only export all models as *.fbx file used in the map into a folder and creates also *.csv files (for ech section from the map) with positions and rotations for each model. These file looks like my data table. (My data table is just the *.csv file imported from this programm) the fbx models i have imported already into a folder in my game project.

to do this in blueprint you need to create an actor which will be the spawner and make a script like in the picture below. create a custom event then with it selected go to the details panel and check the box call in editor, this will allow you to run the script from the main level editor window ( drag the actor into the level, select it and in the details panel there will be a button for the event). the next part is as shown by Everynone, get data table names, for each loop, get datatable row, then just a spawn actor from class.

if you have multiple datatables then you may also want to promote the table pin to a public variable to make things easier for yourself and make this one actor reusable.

you will need to be careful to only press the event button once as you could end up spawning many of the same things and not realize it. also once youve spawned the actors like you want you can just delete the actor you created.

Also for those who are wondering on how to get the file directory and type of file do this :

255023-copyreference.jpg

Right mouse click on the object, then go to ‘Copy Reference’. This will copy, as in this picture the following :
Blueprint’/Game/Assets/Blueprints/BP_Utilities/AI_Locator.AI_Locator’.

If you add a Class type of a blueprint, you change it to BlueprintGeneratedClass. You want to add a _C at the end like so :
BlueprintGeneratedClass ‘/Game/Assets/Blueprints/BP_Utilities/AI_Locator.AI_Locator_C’

At least this is how I do it, don’t know if this is the right way to do this though. But it works :slight_smile: