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"

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?

Product Version: UE 4.12
more ▼

asked Jul 11 '17 at 03:54 PM in Everything Else

avatar image

6 1 1 1

avatar image SebaSopp Aug 15 '17 at 10:59 AM

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: https://wiki.unrealengine.com/Procedural_Mesh_Component_in_C%2B%2B:Getting_Started

Also take a look at this Video for a BP-way: https://www.youtube.com/watch?v=KdhzYJ7wdq8

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

avatar image MrDrNose769 Aug 16 '17 at 11:24 AM

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

How it shound be https://answers.unrealengine.com/storage/temp/193683-01.png

In game: https://answers.unrealengine.com/storage/temp/193684-02.png

03.png (243.5 kB)
01.png (264.2 kB)
02.png (644.2 kB)
avatar image SebaSopp Aug 16 '17 at 01:44 PM

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: https://answers.unrealengine.com/questions/430019/problems-with-procedural-mesh-and-materials.html

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: https://www.unrealengine.com/marketplace/runtime-mesh-component

avatar image MrDrNose769 Aug 16 '17 at 02:05 PM

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.

avatar image SebaSopp Aug 17 '17 at 04:12 PM

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: https://answers.unrealengine.com/questions/277734/understanding-uv-coordinates-in-procedural-mesh-co.html

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?

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

1 answer: sort voted first

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

more ▼

answered Aug 23 '17 at 06:00 AM

avatar image

13 1 3 6

avatar image SebaSopp Aug 23 '17 at 07:53 AM

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: https://answers.unrealengine.com/questions/149502/ingame-ue4-os-file-browser-file.html

(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