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!

相关推荐
远离UE410 小时前
UE 材质 变体 概念
ue5·材质
吴梓穆2 天前
UE5 重新编译插件版本
ue5
HECUgauss2 天前
UE5 使用过程遇到的问题
ue5
小白学过的代码2 天前
ue5.4和webul通信
开发语言·javascript·ue5
m0_552200822 天前
《UE5_C++多人TPS完整教程》学习笔记40 ——《P41 装备(武器)姿势(Equipped Pose)》
c++·游戏·ue5
漫游者Nova3 天前
虚幻引擎Unreal Engine5恐怖游戏设计制作教程,从入门到精通从零开始完整项目开发实战详细讲解中英字幕
ue5·游戏引擎·虚幻·游戏开发完整教程·恐怖游戏开发
ue星空5 天前
UE5音频技术
ue5
帅_shuai_15 天前
UE5 游戏模板 —— FirstShootGame
游戏·ue5
吴梓穆16 天前
UE5 手动停止Delay定时器
ue5
AgilityBaby17 天前
UE5蓝图按键输入绑定学习笔记
笔记·学习·ue5·蓝图