UE5.3 虚幻引擎 Linux ubuntu插件开发打包

Linux is not my strength so perhaps some of this is obvious to more experienced Linux users, but I couldn't seem to find the answers laid out in a nice easy do this then that so hopefully everyone else can benefit from my last few days of bashing my head against a wall.

So first, you need to do a custom build of UE4 for Ubuntu. I know this sounds scary, but Epic really did a good job laying this one out. Just follow their step-by-step instructions in the documentation:

docs.unrealengine.com

Linux Quick Start

Learn how to download, build, and run UE4 on Linux.

It is big, and it will take a while. I just let it build overnight.

Now if you're just doing Blueprints, then you're good to go, but that's not why you're reading this are you? I pulled my project off of SVN (RabbitVCS is a good Ubuntu equivalent to Tortoise SVN on Windows) so I'm starting with a clean copy of my code and no intermediate files leftover from other platforms (Build, Config, Content, Plugins, Source, and your .uproject file).

Plugins

If you don't use any custom plugins OR any marketplace plugins, you can skip to the Main Project section.

I've had a complicated relationship with plugins. In UE4.26 I put all my custom AND marketplace plugins in a separate project (basically an empty project) in the Plugins subfolder. You're going to need to recompile all of them to match your custom build of UE4. To help with this, I use a bash script (the Linux equivalent of .bat files in Windows) by creating a new file next to my plugin .uproject file that I creatively called BuildLinuxPluginsScript. You can use gedit for a notepad equivalent text editor to modify it:

复制代码
#!/bin/bash

bash /home/user/Documents/UnrealEngine-4.26/Engine/Build/BatchFiles/RunUAT.sh BuildPlugin -Plugin="/home/user/Documents/Unreal Projects/MyPlugins426/Plugins/KantanCharts/KantanCharts.uplugin" -Package="/home/user/Documents/Unreal Projects/MyPlugins426/Package/KantanCharts" -CreateSubFolder -TargetPlatforms=Linux

(Duplicate the last line and update each one for every custom and marketplace plugin you have). Save your file, then at a terminal, use the command chmod +x BuildLinuxPluginsScript. You can now execute your script from the terminal using ./BuildLinuxPluginsScript and if all goes well, you should have a Package subdirector of your project with each plugin in its respective subfolder. Within each plugin subfolder should be at least a Binaries, Intermediate, Resources, and Source folders, and a .uplugin file. If there isn't, you may need to go back to your plugin source file, edit the .uplugin file with a text editor and in the "Modules" section add a WhitelistPlatforms so it looks like this:

复制代码
"Modules": [
		{
			"Name": "MyCustomPlugin",
			"Type": "Runtime",
			"LoadingPhase": "Default",
			"WhitelistPlatforms": [
				"Linux"
			]
		}
	]

If Linux is already in the list, try removing other platforms listed there. Sometimes the tools can be grumpy about that. Run your BuildLinuxPluginsScript again.

Once all your plugins are built, copy the packaged folders into your custom engine build. In my case they all go in /home/user/Documents/UnrealEngine-4.26/Engine/Plugins

Main project

Now your engine is loaded up with any of the plugins you need, now onto the main project. If you're your plugins were C++ or you had marketplace plugins, but the rest is blueprint then you're probably good to go. However, if your main project is also C++ then you'll probably get an error about modules (your main project) being out of date and would you like to rebuild. On windows, you just say yes and it works. On Linux, not so much. Again I make a new bash file which I called LinuxGenerateProjectFiles with the following contents:

复制代码
#!/bin/bash

bash /home/user/Documents/UnrealEngine-4.26/Engine/Build/BatchFiles/Linux/RunMono.sh /home/user/Documents/UnrealEngine-4.26/Engine/Binaries/DotNET/UnrealBuildTool.exe -makefile -project="/home/user/Documents/Unreal Projects/MyProject/MyProject.uproject" -game

And again chmod +x LinuxGenerateProjectFiles. Now it's important that your project is cleaned up before you run this. If you have any plugins that you already built and installed to the engine with the previous step, remove them otherwise they'll be "discovered" as part of this process and added to the make process. As a precaution, I also remove an intermediate and binaries folders. Now you can run this script with ./LinuxGenerateProjectFiles . After a few minutes you should have a whole bunch of new files in your project directory, but the important one here is the make file. One last command from the terminal: make MyProjectEditor (where you replace "MyProject" with your project name eg "YourProjectEditor"). The make file has a whole lot of different things it can do, but this one seems to be the key to opening your project. After that process finishes, you should be able to just double click on your project and it will start loading!

One last note, if you've never loaded a UE4 project on your machine before, or even the first time loading a new project, depending on the size of your project it can take quite a while. I'm working with a fairly large project and the first time it took almost 30 minutes to open so be patient! After the first time, it usually only takes my project a minute or so to load. Good luck!

相关推荐
笑鸿的学习笔记2 天前
虚幻引擎5-Unreal Engine笔记之SET节点的输出引脚获取设置后的最新变量值
笔记·ue5·虚幻
Zhichao_972 天前
【UE5.1 C++】VS2022下载安装
ue5
m0_552200822 天前
《UE5_C++多人TPS完整教程》学习笔记37 ——《P38 变量复制(Variable Replication)》
c++·游戏·ue5
曹勖之2 天前
在 UE5 蓝图中配置Actor类型的Asset以作为位置和旋转设置目标
ue5·机器人
曹勖之2 天前
UE 5 和simulink联合仿真,如果先在UE5这一端结束Play,过一段时间以后**Unreal Engine 5** 中会出现显存不足错误
matlab·ue5·机器人
AgilityBaby2 天前
UE5 2D角色PaperZD插件动画状态机学习笔记
笔记·学习·ue5
AgilityBaby2 天前
UE5 创建2D角色帧动画学习笔记
笔记·学习·ue5
ue星空5 天前
UE音频中间件wwise插件
学习·ue5·音视频
AgilityBaby7 天前
UE5打包项目设置Project Settings(打包widows exe安装包)
c++·3d·ue5·游戏引擎·unreal engine
AgilityBaby8 天前
UE5蓝图暴露变量,在游戏运行时修改变量实时变化、看向目标跟随目标Find Look at Rotation、修改玩家自身弹簧臂
笔记·游戏·ue5·游戏引擎·蓝图