irajsb / UE4_Assimp

Assimp mesh importer for Unreal Engine
MIT License
135 stars 29 forks source link

Android Build #13

Open NounKim opened 2 years ago

NounKim commented 2 years ago

I just trying to package unreal project with this plugin, but error begins:

/AssimpHolder/Plugins/UE4_Assimp/Source/UE_Assimp/Public/AIScene.h(7,10): fatal error: 'assimp/scene.h' file not found UATHelper: Packaging(Android (ASTC)): #include "assimp/scene.h"

https://github.com/irajsb/UE4_Assimp/wiki/How-To-Build

I followed this document faithfully, and it completed.

this error seems to be a dependency error. where have i fix it

irajsb commented 2 years ago

Assimp currently is built and tested for windows . to build for android you've to handle a lot of things ! Start by https://github.com/assimp/assimp

irajsb commented 2 years ago
cmake -DCMAKE_TOOLCHAIN_FILE=C:/Users/Administrator/AppData/Local/Android/Sdk/ndk/21.4.7075529/build/cmake/android.toolchain.cmake -DANDROID_NDK=C:/Users/Administrator/AppData/Local/Android/Sdk/ndk/21.4.7075529 -DCMAKE_BUILD_TYPE=Release -DANDROID_ABI="armeabi-v7a with NEON"

Cmake generate sample

NounKim commented 2 years ago
cmake -DCMAKE_TOOLCHAIN_FILE=C:/Users/Administrator/AppData/Local/Android/Sdk/ndk/21.4.7075529/build/cmake/android.toolchain.cmake -DANDROID_NDK=C:/Users/Administrator/AppData/Local/Android/Sdk/ndk/21.4.7075529 -DCMAKE_BUILD_TYPE=Release -DANDROID_ABI="armeabi-v7a with NEON"

Cmake generate sample

sorry sir It seems that gen.cpp is not finding the Assimp library. Same problem with Windows package. Something problem in Module.UE_Assimp.cpp...


------error message---- The file 'AssimpHolder\Plugins\UE4_Assimp\Binaries\Win64\assimp.dll' cannot be accessed by a process because it is being used by another process. (Seems like UE_AssimpLibrary.Build.cs => CopyFile(AssimpDll,BinPath); is Failed, I think this Doc is related this error http://www.valentinkraft.de/including-the-point-cloud-library-into-unreal-tutorial/)

[1/3] Module.UE_Assimp.cpp C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winnt.h(611): warning C4005: 'TEXT': ��ũ�� ������ C:\UnrealEngine\Engine\Source\Runtime\Core\Public\HAL/Platform.h(1085): note: 'TEXT'�� ���� ���Ǹ� �����Ͻʽÿ�. C:/Users/P5820-510/Documents/Unreal Projects/AssimpProj/Plugins/UE4_Assimp/Source/UE_Assimp/Private/UE_Assimp.cpp(10): fatal error C1083: ���� ������ �� �� �����ϴ�. 'Interfaces/IPluginManager.h': No such file or directory


PS: The broken text is an encoding problem with the Korean version of Unreal. This issue is not being fixed. Broken Text may be mean redefine TEXT macro

irajsb commented 2 years ago

I pushed an update . there is still an error only for android where its in https://github.com/assimp/assimp/blob/master/contrib/poly2tri/poly2tri/common/shapes.h you have to get rid of throw std::runtime_error(std::string("repeat points")); line 142. after that you'll get another error which is caused by missing assimp binary files for android which you need to manually build it using cmake like what we did for windows .

Zi1mann commented 1 year ago

I assume rebuilding assmip will also be the solution when I want to build a dedicated server for Linux? Currently, when packaging my game for that target, I get compiler errors regarding the assimp plugin.

irajsb commented 1 year ago

do you need the assimp to be included in a dedicated server ? ( depends on your project but probably not) . you can disable it in dedicated server target file otherwise yes you've to build it and add the binaries .

Zi1mann commented 1 year ago

About inlcuding it in the server build - this actually is a good point. I just tried to rebuild my project for Windows and could not launch either the dedicated server, nor the client build without adding RuntimeDependencies.Add("$(TargetOutputDir)/assimp.dll", System.IO.Path.Combine("$(ProjectDir)/Plugins/UE4_Assimp", "Source/ThirdParty/UE_AssimpLibrary/assimp/bin/Release/assimp.dll") to my projects build.cs-file. The loading is done locally and then the Meshes are placed through a server rpc but the server does not need to know the meshes since the client will provide the Mesh object.

Building for Linux seemed reasonable since the physical server to run the dedicated server is running on Linux. Regardless, maybe putting a link to the corresponding documentation about including third party libraries into the packaged game would be great for anybody interested in this plugin?

irajsb commented 1 year ago

I recommend looking at other plugins which are already in unreal engine and have third party code.

yuengil commented 1 year ago

ok so this is what I have figured out so far I have built android library for assimp using script inside assimp github https://github.com/assimp/assimp/tree/master/scripts/android_crosscompile you can run the batch file from the link provided above, but you need to build the entire project with cmake first when you first download and unzip. Then you can copy the .so file to binary folder inside the assimp plugin folder This will compile for android, package and launch to android device.

However, I have not yet figured out how to use the features with assimp in android device

irajsb commented 1 year ago

Download the sample project . only thing you need to change is open file dialogue. That is windows specific so you have to replace it with some kind of android file import function .

irajsb commented 1 year ago

https://github.com/irajsb/UE4_Assimp/releases/tag/MajorBugFix