diff --git a/.DS_Store b/.DS_Store index 89340f0f..c5b93adb 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/.gitignore b/.gitignore index df0a7a79..6dd3cf30 100644 --- a/.gitignore +++ b/.gitignore @@ -74,4 +74,5 @@ Intermediate/* Plugins/**/Intermediate/* # Cache files for the editor to use -DerivedDataCache/* \ No newline at end of file +DerivedDataCache/* +.DS_Store diff --git a/Plugins/AsyncLoadingScreen/Binaries/Mac/UnrealEditor-AsyncLoadingScreen.dylib b/Plugins/AsyncLoadingScreen/Binaries/Mac/UnrealEditor-AsyncLoadingScreen.dylib index b56d4028..174cbab7 100755 Binary files a/Plugins/AsyncLoadingScreen/Binaries/Mac/UnrealEditor-AsyncLoadingScreen.dylib and b/Plugins/AsyncLoadingScreen/Binaries/Mac/UnrealEditor-AsyncLoadingScreen.dylib differ diff --git a/Plugins/BlueprintJson/Binaries/Mac/UnrealEditor-BlueprintJson.dylib b/Plugins/BlueprintJson/Binaries/Mac/UnrealEditor-BlueprintJson.dylib index 3cb7baad..5b5e744e 100755 Binary files a/Plugins/BlueprintJson/Binaries/Mac/UnrealEditor-BlueprintJson.dylib and b/Plugins/BlueprintJson/Binaries/Mac/UnrealEditor-BlueprintJson.dylib differ diff --git a/Plugins/FileHelperPlugin/Binaries/Mac/UnrealEditor-FileHelper.dylib b/Plugins/FileHelperPlugin/Binaries/Mac/UnrealEditor-FileHelper.dylib index 52d6e46a..916ed7b1 100755 Binary files a/Plugins/FileHelperPlugin/Binaries/Mac/UnrealEditor-FileHelper.dylib and b/Plugins/FileHelperPlugin/Binaries/Mac/UnrealEditor-FileHelper.dylib differ diff --git a/Plugins/LuckyMujoco/Binaries/Mac/UnrealEditor-LuckyMujoco.dylib b/Plugins/LuckyMujoco/Binaries/Mac/UnrealEditor-LuckyMujoco.dylib index 490b0456..06d56e41 100755 Binary files a/Plugins/LuckyMujoco/Binaries/Mac/UnrealEditor-LuckyMujoco.dylib and b/Plugins/LuckyMujoco/Binaries/Mac/UnrealEditor-LuckyMujoco.dylib differ diff --git a/Plugins/LuckyMujoco/Binaries/Mac/UnrealEditor-LuckyMujocoEditor.dylib b/Plugins/LuckyMujoco/Binaries/Mac/UnrealEditor-LuckyMujocoEditor.dylib index 00bdbbed..b1f19ff9 100755 Binary files a/Plugins/LuckyMujoco/Binaries/Mac/UnrealEditor-LuckyMujocoEditor.dylib and b/Plugins/LuckyMujoco/Binaries/Mac/UnrealEditor-LuckyMujocoEditor.dylib differ diff --git a/Plugins/LuckyMujoco/Source/LuckyMujoco/Private/LuckyMujoco.cpp b/Plugins/LuckyMujoco/Source/LuckyMujoco/Private/LuckyMujoco.cpp index 259d5423..d1d9c1ac 100644 --- a/Plugins/LuckyMujoco/Source/LuckyMujoco/Private/LuckyMujoco.cpp +++ b/Plugins/LuckyMujoco/Source/LuckyMujoco/Private/LuckyMujoco.cpp @@ -11,36 +11,17 @@ DEFINE_LOG_CATEGORY(LogMujoco); void FLuckyMujocoModule::StartupModule() { - FString BaseDir = IPluginManager::Get().FindPlugin(TEXT("LuckyMujoco"))->GetBaseDir(); - FString LibraryPath; -#if WITH_EDITOR - LibraryPath = FPaths::Combine( - *BaseDir, TEXT("Source/ThirdParty/Mujoco/bin/mujoco.dll")); - #endif - FString Library; #if PLATFORM_WINDOWS Library = "mujoco.dll"; -#elif PLATFORM_MAC - Library = "mujoco.dylib"; -#elif PLATFORM_LINUX - Library = "libmujoco.so"; -#endif - - if (WITH_EDITOR) - { - MujocoHandle = !LibraryPath.IsEmpty() ? FPlatformProcess::GetDllHandle(*LibraryPath) : nullptr; - } - else - { - MujocoHandle = !Library.IsEmpty() ? FPlatformProcess::GetDllHandle(*Library) : nullptr; - } - + MujocoHandle = !Library.IsEmpty() ? FPlatformProcess::GetDllHandle(*Library) : nullptr; + if (MujocoHandle == nullptr) { FMessageDialog::Open(EAppMsgType::Ok, LOCTEXT("MujocoLibraryError", "Failed to load Mujoco library. Please make sure that Mujoco is installed and the library is in the correct path.")); } +#endif } void FLuckyMujocoModule::ShutdownModule() diff --git a/Plugins/LuckyMujoco/Source/ThirdParty/Mujoco/Mujoco.Build.cs b/Plugins/LuckyMujoco/Source/ThirdParty/Mujoco/Mujoco.Build.cs index 80f717bd..0321d7a7 100644 --- a/Plugins/LuckyMujoco/Source/ThirdParty/Mujoco/Mujoco.Build.cs +++ b/Plugins/LuckyMujoco/Source/ThirdParty/Mujoco/Mujoco.Build.cs @@ -1,5 +1,6 @@ using System.IO; using UnrealBuildTool; +using System; public class Mujoco : ModuleRules { @@ -16,16 +17,33 @@ public class Mujoco : ModuleRules } else if (Target.Platform == UnrealTargetPlatform.Mac) { - PublicDelayLoadDLLs.Add("mujoco.dylib"); - PublicAdditionalLibraries.Add(Path.Combine(ModuleDirectory, "lib", "mujoco.dylib")); - RuntimeDependencies.Add(Path.Combine("$(TargetOutputDir)", "mujoco.dylib"), Path.Combine(ModuleDirectory, "lib", "mujoco.dylib")); + string DllPath = Path.Combine(ModuleDirectory, "lib", "mujoco.dylib"); + string BinaryOutputDir = Path.Combine("$(BinaryOutputDir)", "lib"); + string TargetOutputDir = Path.Combine("$(TargetOutputDir)", "lib"); + + PublicDelayLoadDLLs.Add(DllPath); + PublicAdditionalLibraries.Add(DllPath); + + RuntimeDependencies.Add(Path.Combine("$(TargetOutputDir)", "mujoco.dylib"), DllPath); + RuntimeDependencies.Add(Path.Combine("$(TargetOutputDir)", "libmujoco.3.2.7.dylib"), DllPath); + // RuntimeDependencies.Add(Path.Combine("$(TargetOutputDir)", "../../../../", "MacOS/libmujoco.3.2.7.dylib"), DllPath); + // RuntimeDependencies.Add("$(BinaryOutputDir)/UnrealEditor.app/Contents/MacOS/libmujoco.3.2.7.dylib", DllPath); + // Console.WriteLine("$BinaryOutputDir:"+ BinaryOutputDir); + // Console.WriteLine("$TargetOutputDir:" + TargetOutputDir); + // Console.WriteLine("$Target.Name:"+ Target.Name); + + + RuntimeDependencies.Add($"$(BinaryOutputDir)/libmujoco.3.2.7.dylib", DllPath); + // throw new Exception("test"); + } else if (Target.Platform == UnrealTargetPlatform.Linux) - { - PublicAdditionalLibraries.Add(Path.Combine(ModuleDirectory, "lib", "libmujoco.so")); - PublicDelayLoadDLLs.Add("libmujoco.so"); - RuntimeDependencies.Add(Path.Combine("$(TargetOutputDir)", "libmujoco.so"), Path.Combine(ModuleDirectory, "lib", "libmujoco.so")); - RuntimeDependencies.Add(Path.Combine("$(TargetOutputDir)", "libmujoco.so.3.2.7"), Path.Combine(ModuleDirectory, "lib", "libmujoco.so")); + { + string DllPath = Path.Combine(ModuleDirectory, "lib", "libmujoco.so"); + PublicAdditionalLibraries.Add(DllPath); + PublicDelayLoadDLLs.Add(DllPath); + RuntimeDependencies.Add(Path.Combine("$(TargetOutputDir)", "libmujoco.so"), DllPath); + RuntimeDependencies.Add(Path.Combine("$(TargetOutputDir)", "libmujoco.so.3.2.7"), DllPath); } } } diff --git a/Plugins/VaRestPlugin/Binaries/Mac/UnrealEditor-VaRest.dylib b/Plugins/VaRestPlugin/Binaries/Mac/UnrealEditor-VaRest.dylib index a3e57d0d..2b919568 100755 Binary files a/Plugins/VaRestPlugin/Binaries/Mac/UnrealEditor-VaRest.dylib and b/Plugins/VaRestPlugin/Binaries/Mac/UnrealEditor-VaRest.dylib differ diff --git a/Plugins/VaRestPlugin/Binaries/Mac/UnrealEditor-VaRestEditor.dylib b/Plugins/VaRestPlugin/Binaries/Mac/UnrealEditor-VaRestEditor.dylib index 67c96794..c40a54f8 100755 Binary files a/Plugins/VaRestPlugin/Binaries/Mac/UnrealEditor-VaRestEditor.dylib and b/Plugins/VaRestPlugin/Binaries/Mac/UnrealEditor-VaRestEditor.dylib differ diff --git a/mac_build.sh b/mac_build.sh new file mode 100644 index 00000000..a8f16483 --- /dev/null +++ b/mac_build.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +# Get the user's home directory +USER_HOME="$HOME" + +# Set up Unreal Engine paths +UE_ROOT="/Users/Shared/Epic Games/UE_5.5" +UE_EDITOR="$UE_ROOT/Engine/Binaries/Mac/UnrealEditor.app/Contents/MacOS/UnrealEditor" +UE_UAT="$UE_ROOT/Engine/Build/BatchFiles/RunUAT.command" + +# Set up project paths +PROJECT_ROOT="$(pwd)" +PROJECT_FILE="$PROJECT_ROOT/Luckyrobots.uproject" +ARCHIVE_DIR="$PROJECT_ROOT/Builds" + +# Run the build command +"$UE_UAT" -ScriptsForProject="$PROJECT_FILE" Turnkey \ + -command=VerifySdk \ + -platform=Mac \ + -UpdateIfNeeded \ + -EditorIO \ + -EditorIOPort=59484 \ + -project="$PROJECT_FILE" \ + BuildCookRun \ + -nop4 \ + -utf8output \ + -cook \ + -project="$PROJECT_FILE" \ + -target=Luckyrobots \ + -unrealexe="$UE_EDITOR" \ + -platform=Mac \ + -installed \ + -stage \ + -archive \ + -package \ + -build \ + -iterativecooking \ + -pak \ + -iostore \ + -compressed \ + -prereqs \ + -archivedirectory="$ARCHIVE_DIR" \ + -CrashReporter \ + -clientconfig=Shipping \ + # -nocompile \ + # -nocompileuat \ + # -nocompileeditor \ + # -skipbuildeditor \ + + # enable these if you want to test build without pak and iostore (you're just testing the build) + # -skipiostore \ + # -skippak \ (disable -pak and -iostore) \ No newline at end of file diff --git a/test.txt b/test.txt deleted file mode 100644 index 9daeafb9..00000000 --- a/test.txt +++ /dev/null @@ -1 +0,0 @@ -test