VRM4U
VRM4U copied to clipboard
Failed to create libassimp.a in MacOS
I was following the installation guide to install VRM4U on my M1 Mac, however, when I am trying to build the libassimp.a
file using make
as mentioned, there is an error:
Seems the deprecation of vsprintf
leads to the problem. Would you mind please help? Thank you very much.
UnrealEngine Version: UE_5.3 OS: MacOS 13.4
Hi @Johnastc2002 . You can use the following flag to resolve this issue and create your libassimp.a
file.
-DCMAKE_CXX_FLAGS="-Wno-deprecated-declarations"
However, I'm facing crashes in the engine on dragging and dropping the vrm
file into content browser after pasting the libassimp.a
file according to the instructions. I've also tried the same in 5.3
as well. Kindly let me know if you get successful in importing vrm
into m1 mac
Hi @Johnastc2002, did you manage to import vrm
files into unreal successfully?
Hi @ApoorvHesta , thank you for your advice, I do can create the libassimp.a
file based on your method, but the .a
file seems corrupted and crashed after putting it to the /Plugins
folder inside the project. Therefore I did not send you the update here.
Hi @Johnastc2002 . You need to place it inside a specified directory as below:
/Plugins/VRM4U/ThirdParty/assimp/lib/Mac
Yea I did this as you mentioned, but still facing crash when running the project. As I am new to UE, maybe it is easier to trace the problem by showing you my steps for the whole procedure:
-
I clone the
assimp
bygit clone https://github.com/ruyo/assimp
and save it to desktop -
Then I use CMake (downloaded from here) to open the
assimp
project. According to the Mac tutorial from ruyo (source), I set thesource code
as the project root directory, andbuild the binaries
path asbuild2
like what ruyo did in the tutorial: -
I keep the output as
Unix Makefiles
format in order to runmake
command later, and keep usingnative compilers
. -
I applied the settings according to the ruyo's tutorial and change the following:
-
MACOSX_DEPLOYMENT_TARGET
to13.4
<-- In the tutorial as mentioned, it recommends for10.14
but in my knowledge it seems does not matter for the deployment target, therefore I use my current computer OS version, which is13.4
. I tried10.14
and13.4
, both of them showing the same error. -
BUILD_SHARED_LIBS
turn off
Also, in ruyo's tutorial, he mentioned:
If you're on an M1 Mac, you'll need to explicitly build it as x86_64. In the example above, we start the terminal and cmake-gui using Rosetta and follow the steps.
Because I am using a M1 Mac, I additionally updated the CMAKE_OSX_ARCHITECTURES
as x86_64
, which I don't know whether it is correct or not.
-
Due to the problem why I open this issue, I implemented @ApoorvHesta solution in
CMakeLists.txt
, by adding this line of code in line342
:SET(CMAKE_CXX_FLAGS "-Wno-deprecated-declarations")
-
Back to CMake and press the
Generate
button -
cd
tobuild2
folder in termainal, runmake
command and generatedlibassimp.a
file inbuild2/lib
. -
As I am using UE 5.3, I downloaded
VRM4U_5_3_20230922.zip
file in this link, unzip it and drag and drop the generatedlibassimp.a
file toPlugins/VRM4U/ThirdParty/assimp/lib/Mac
-
I drag and drop the whole
Plugins
folder to the current UE project root directory (which meansMyProject/Plugins/VRM4U........
) -
I run the UE, open the project, and import the plugin as follows, then press
Restart Now
-
After restart, a dialog shown, I pressed
Yes
for rebuild the plugin like in the tutorial -
Then another dialog shown and said
MyProject could not be compiled
Because I am new to UE and almost no knowledge in CMake, some of my steps may be wrong. Would you mind please check if you can reproduce the problem? Thank you so much for your patience and help.
Hi @Johnastc2002 . Open xcode workspace and build from there. If crash occurs, you'll get a log, attach that.
Here is the log after building MyProject (Mac).xcworkspace
:
Running Xcodebuild MyProject macosx Development /Users/timmy/Documents/unreal_projects/MyProject/MyProject.uproject Setting up bundled DotNet SDK /Users/timmy/unreal_engines/UE_5.3/Engine/Build/BatchFiles/Mac/../../../Binaries/ThirdParty/DotNet/6.0.302/mac-arm64 Processing build for Target=MyProject Platform=Mac Configuration=Development -architecture=arm64 /Users/timmy/Documents/unreal_projects/MyProject/MyProject.uproject Running dotnet Engine/Binaries/DotNET/UnrealBuildTool/UnrealBuildTool.dll MyProject Mac Development /Users/timmy/Documents/unreal_projects/MyProject/MyProject.uproject -architecture=arm64 Log file: /Users/timmy/Library/Application Support/Epic/UnrealBuildTool/Log.txt Creating makefile for MyProject (no existing makefile) Choosing MODERN XCODE based on .ini settings Total execution time: 1.15 seconds Could not find definition for module 'VRM4U', (referenced via MyProject.uproject -> VRM4U.uplugin) Command ExternalBuildToolExecution failed with a nonzero exit code
Seems like you haven't downloaded the source. The repo for source is a different one. Kindly go through this thread.
[https://github.com/ruyo/VRM4U/issues/130]
Hi @ApoorvHesta , I have added the Source
folder, with same date to the binaries, at the same level as Plugins/VRM4U/ThirdParty
folder, but even I created a new project MyProject2
as a C++ project with the plugin, the error still shows up. And according to the thread you mentioned, there is a tutorial. (link) In the section Make it to a C++ Project
, the link is not valid anymore. Therefore, I am not sure whether I have to create a MyProject2.sln
file, or even in mac, do I need to go through this step.
I try to log the error just like the previous comment, but Xcode does not showing the error log anymore. There are no responses when clicking the error
Try to generate solutions files first. Open terminal and
your_engine_batch_path your_uproject_path -game
Okay seems I figure out how to install the plugin in M1 Mac. But as mentioned, I am new to UE and CMake, I am not sure whether it is truly work or not when using the plugin. (How can I know the plugin that even I cannot get it installed!) Hope this article can help someone struggling to the installation.
Here is my procedure:
My computer:
M1 Macbook pro
OS version: 13.4.1
UE version: 5.3
You need to deal with three things:
- The Binaries
- Create the
libassimp.a
file - The Source folder
The Binaries
- Download the binaries in this link. As I am using UE 5.3, I downloaded the file
VRM4U_5_3_20230922.zip
, which the number20230922
means the date of the binary (will be used later) - Unzip it and place it somewhere. In this example, I keep it in the desktop (
~/Desktop
)
Create the libassimp.a
file (tutorial from ruyo: link)
-
open terminal,
cd
to Desktop, clone the assimp repository bygit clone https://github.com/ruyo/assimp
(remember this is ruyo's fork of assimp, NOT the onehttps://github.com/assimp/assimp
) -
Then I use CMake (downloaded from here) to open the assimp project. According to the ruyo's tutorial above, I set the source code as the project root directory, and
build the binaries
path asbuild2
: -
Press
Configure
, keep the settings default like the thumbnail: -
Add the value on the keys below:
-
MACOSX_DEPLOYMENT_TARGET
to10.14
-
BUILD_SHARED_LIBS
turn off
-
Open the text file
CMakeLists.txt
inassimp
folder, Add the line of codeSET(CMAKE_CXX_FLAGS "-Wno-deprecated-declarations")
in line342
, to prevent deprecations error suggested by @ApoorvHesta here (I am not sure my implementation is correct or not tho) -
back to CMake, press
Generate
button -
A bunch of files will be shown in the folder
build2
, open terminal,cd
tobuild2
, run the commandmake
. After running the command, you should see alibassimp.a
file inbuild2/lib
folder -
drag the
libassimp.a
file to the binary folderPlugins/VRM4U/ThirdParty/assimp/lib/Mac
. There should be a dummy.txt file inside, FYI.
The Source folder
-
Link your github account to the epic games installer. (Tutorial can be found here, note that
CONNECTED ACCOUNTS
is already renamed toAPPS AND ACCOUNTS
.) -
You should received an email of invitation from Epic games, ask you to join
EpicGames
organisation. Accept it. If you cannot receive the invitation, check here -
After joining the organisation, you can go the the package repository here, You will get 404 error if you not yet joined the organisation.
-
Switch the branch by tags that matches the date of the binary you downloaded (mine is
20230922
, which I mentioned in part 1) -
Unzip it, put the
Source
folder to the binary folderPlugins/VRM4U
, the folder should be same level asThirdParty
folder
Then you create a new project, drag the whole Plugins
folder to the root project folder
Open the project in UE, choose Plugins
, check VRM4U and restart the project
After restart the project, in Content Drawer
, choose Show Plugin Content
Then at least you can see a Vroid girl in Mac.
Really appreciate @ApoorvHesta for help and suggestions! 🙏🏿
You're welcome @Johnastc2002 . Now try dragging and dropping a new .vrm
into the content browser if you are able to do so, kindly update here with the screenshots of the imported .vrm
character with it's assets in content browser. If not, screenshots of the crash log would be really helpful.
Hi @ApoorvHesta I finally get what you mean. Here are the logs:
Caught signal
ULoaderBPFunctionLibrary::GetVRMMeta(FString) Address = 0x3172ad9d4 [/Users/timmy/Documents/unreal_projects/MyProject/Plugins/VRM4U/Source/VRM4ULoader/Private/LoaderBPFunctionLibrary.cpp, line 448] [in UnrealEditor-VRM4ULoader.dylib] UVRM4UImporterFactory::FactoryCreateBinary(UClass*, UObject*, FName, EObjectFlags, UObject*, char16_t const*, unsigned char const*&, unsigned char const*, FFeedbackContext*, bool&) Address = 0x30ac8f958 (filename not found) [in UnrealEditor-VRM4UImporter.dylib] UFactory::FactoryCreateFile(UClass*, UObject*, FName, EObjectFlags, FString const&, char16_t const*, FFeedbackContext*, bool&) Address = 0x113fcd150 (filename not found) [in UnrealEditor-UnrealEd.dylib] UFactory::ImportObject(UClass*, UObject*, FName, EObjectFlags, FString const&, char16_t const*, bool&) Address = 0x113fcdc74 (filename not found) [in UnrealEditor-UnrealEd.dylib] UAssetToolsImpl::ImportAssetsInternal(TArray<FString, TSizedDefaultAllocator<32>> const&, FString const&, TArray<TTuple<FString, FString>, TSizedDefaultAllocator<32>>, FAssetImportParams const&) const Address = 0x12ec2d330 (filename not found) [in UnrealEditor-AssetTools.dylib] UAssetToolsImpl::ImportAssets(TArray<FString, TSizedDefaultAllocator<32>> const&, FString const&, UFactory, bool, TArray<TTuple<FString, FString>, TSizedDefaultAllocator<32>>, bool, bool) const Address = 0x12ec37e28 (filename not found) [in UnrealEditor-AssetTools.dylib] FImportFilesByPath::Run() Address = 0x114b64484 (filename not found) [in UnrealEditor-UnrealEd.dylib] UImportSubsystem::HandleNextTick() Address = 0x114b1e508 (filename not found) [in UnrealEditor-UnrealEd.dylib] FTimerUnifiedDelegate::Execute() Address = 0x11b344f68 (filename not found) [in UnrealEditor-Engine.dylib] FTimerManager::Tick(float) Address = 0x11b343cfc (filename not found) [in UnrealEditor-Engine.dylib] UEditorEngine::Tick(float, bool) Address = 0x113da9cac (filename not found) [in UnrealEditor-UnrealEd.dylib] UUnrealEdEngine::Tick(float, bool) Address = 0x114c56748 (filename not found) [in UnrealEditor-UnrealEd.dylib] FEngineLoop::Tick() Address = 0x104796064 (filename not found) [in UnrealEditor] GuardedMain(char16_t const) Address = 0x1047a3394 (filename not found) [in UnrealEditor] -[UEAppDelegate runGameThread:] Address = 0x1047beafc (filename not found) [in UnrealEditor] -[FCocoaGameThread main] Address = 0x1082c20ec (filename not found) [in UnrealEditor-Core.dylib] Unknown() Address = 0x1851d354c (filename not found) [in Foundation] Unknown() Address = 0x184183fa8 (filename not found) [in libsystem_pthread.dylib] Unknown() Address = 0x18417eda0 (filename not found) [in libsystem_pthread.dylib]
Did it happen as soon as you dropped the .vrm
file?
Yes, right after dropping the .vrm
file, the crash is shown.
Now you are right where I am. I'm also looking for a solution for it including many others working on M1 Mac. If you get somewhere, do let me know. @ruyo Any updates on this issue as there are more threads like these.
Hi @Johnastc2002 You can take the follow up from here. Seems it has been resolved.
[https://github.com/ruyo/VRM4U/issues/321]
Thanks @ApoorvHesta for reminding! Let me check it out soon 🙏
Hi. The latest version fixes a runtime error on Mac. If you would like to try it out, please refer to the new documentation to set it up. https://ruyo-github-io.translate.goog/VRM4U/03_mac/?_x_tr_sl=ja&_x_tr_tl=en&_x_tr_hl=ja Thanks