How to open an FBX file from my UE4 project's interface

谁说胖子不能爱 提交于 2019-12-13 04:56:54

问题


I've created an interface for my UE4 project that has an import button. What I want it to do is to access FBX files in the user's desktop and opens the one the user selects.

I've written a c++ code that searches for FBX files in the desktop and returns their names, if found.

I'm kind of confused/stuck at this moment, and don't know exactly how to continue. My question is:

  1. Shall I open the FBX file using c++ or blueprints? It would be much appreciated if you could elaborate more on the approach you suggest.

Thank you


回答1:


What I want it to do is to access FBX files in the user's desktop and opens the one the user selects.

"Opening something" does not actually tell us what you want to do.

Open the file with The default application for the file type?

Load the mesh somewhere into RAM?

Spawn objects in UE4 with the mesh?

Who knows what opening means. Opening the file in maya will be quite different from opening it with a hex editor.

Specify what your programm should do.

Shall I open the FBX file using c++ or blueprints?

Appart from what you can add to what I said above this questions answer will be purely subjective if BP is actually capable of doing what you want. IF you are doing good in c++ I suggest to stick with it for file operations.


Here Epics documentation on asset references, this should fit for people finding this thread and probably for you.

https://docs.unrealengine.com/latest/INT/Programming/Assets/ReferencingAssets/index.html

Just use UStaticMesh instead of the filetype used in the examples.

Here a UE4 wiki example implementation of what you could mean:

https://wiki.unrealengine.com/Dynamic_Load_Object




回答2:


Shall I open the FBX file using c++ or blueprints? It would be much appreciated if you could elaborate more on the approach you suggest.

Yes, you can use the thirdparty libray to import the FBX, such as assimp
https://github.com/assimp/assimp

In the mean time, instead of use static mesh, you could use precedure mesh instead.



来源:https://stackoverflow.com/questions/35351285/how-to-open-an-fbx-file-from-my-ue4-projects-interface

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!