Import .obj mesh from file path at runtime.

It possible in UE4 to import .obj files from file path.

If yes, how it can be on c++, or exist BP plugin for it?

Same Problem here. As far as i researched, there is only the possibility to use the Procedural Mesh Component to generate the Mesh at Runtime: A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums

Also take a look at this Video for a BP-way:

If anybody knows a better way, i would be glad to know it…

I have also some problems with the UVs. In my case, I try to parse a .obj file to create Meshes. I’ve found some interesting facts to this problem here:

So if I import a plane with 2 triangles, the Vertices and UVs Arrays got the same size, and the Texture looks fine. But if I import a Box, there are less Vertices then UVs Indices and no texture visible.I think its a Problem caused by Vertices Sharing… So i am searching for a solution for this…

Maybe you’ve got the same Problem? The Source Code of this plugin maybe serves also as a good way to analyze examples: Runtime Mesh Lite in Code Plugins - UE Marketplace

SebaSopp, thanks for answer, vertices and triangles are works, but UVs not correctly.

How it shound be

In game:

I think need to use in “f 2/1/1” second number like “triangles” for UVs, but i don’t know how to use it.

Hi MrDrNose769, so i had to go back to the Vertices Import, because of some Orientation Problems… Right now I use only the first number of the f-triplet to fill the Triangles Array. But i change the Rotation-Order and decrement all values by 1 .
So a .obj with only 1 triangle got “f 1/1/1 2/2/2 3/3/3” → 1,2,3 → Rotation Change → 3,2,1 → decremented → 1,2,0 Thats what i add to the Triangles Array…

The Vertex Array is filled at the parsing from top to bottom. Same with the UV Array.

I Export the obj from Maya and get Problems caused by the different Orientations in Maya und UE4. Right know i rotate the UE4 Procedural Mesh Actor by -90 around the x-axis and set the x scale to -1… So the Model looks like in Maya but the UVs make problems again…

The UVs are connected to the vertices. With Vertices Sharing one Vertex can have several UV positions, depending on the triangle we currently work on. But I don’t know how to get this Sharing Information into the Arrays for the ‘Create Mesh Section’ Node… Is there even a way? Iam starting to believe not:

So in Maya i can select all vertices and use ‘Detach’ to get rid of Shared Vertices, that works but i got still some uv problems.

tricky stuff… Did you come to a Solution for the UVs?

I have a same problem with you.In addition, I would like to know how to generate a dialog for importing files.If you know, hope you can tell me. thank you

Hey, so did you tried the ‘detach’ Part? For now i had to stop to work with the .obj Import. Soon I will switch over to FBX, the Problem with the UVs won’t be solved by this switch, but thats the specification i got freshly for the Project.
If you want to have a OS Filedialog at Runtime, well that’s a Problem. Unreal does not give you the possibility to use the Dialog from the Editor. Thats really disappointing… But for more details take a look at my last comment here: Ingame UE4, OS File browser file - Rendering - Unreal Engine Forums