当前位置:网站首页>When opening the system window under UE4 shipping, the problem of crash is attached with the plug-in download address
When opening the system window under UE4 shipping, the problem of crash is attached with the plug-in download address
2022-07-07 15:42:00 【WhiteTian】
Original article , Reprint please indicate the source .
Shipping Next, open the system window and crash
Plug in download link
SelectDialog Plug in download link
Preface
If you encounter normal development (Debug/Develope) It's no problem to call the interface to open the system window , and Shipping If you break down directly , Let's see if it's the same problem .
Description of collapse phenomenon : call FDesktopPlatformModule::Get()->OpenFileDialog To open the interface under different systems , For example, you need to import the model at run time , Import pictures, videos, audio and other functions , You will use this function .
Here's the picture , I want to choose a computer in the program fbx Import the format model . stay dubug Under the normal , The bag that came out collapsed .
How to solve ? What's the reason ?
The code you call should be similar to the following (FDesktopPlatformModuleEx It's one of my packages shipping Plug in for next use .FDesktopPlatformModuleEx::Get())
/* Open the system folder path Parameters 1: File absolute path Parameters 2: file type TEXT("*.*")= All Record : TEXT("FBX,JPG,BMP,PNG files|*.fbx;*.jpg;*.png;*.bmp"); TEXT("FBX Files|*.fbx"); TEXT("JPG,BMP,PNG files|*.jpg;*.png;*.bmp"); TEXT("(Image Files)|*.BMP;*.JPG;*.PNG;*.JPEG;)") */
UFUNCTION(BlueprintCallable, Category = "OpenWindowsFile")
static TArray<FString> OpenWindowsFiles(const FString& sTitle, const FString& sYourFullPath, const FString& sExtensionStr = TEXT("*.*"));
TArray<FString> URegionRiskReadLibrary::OpenWindowsFiles(const FString& sTitle, const FString& sYourFullPath, const FString& sExtensionStr)
{
// List of files selected by the user
TArray<FString> OpenFileNames;
IDesktopPlatform* DesktopPlatform = FDesktopPlatformModuleEx::Get();
if (DesktopPlatform)
{
void* ParentWindowHandle = GEngine->GameViewport->GetWindow()->GetNativeWindow()->GetOSWindowHandle();
DesktopPlatform->OpenFileDialog(ParentWindowHandle, sTitle, sYourFullPath, TEXT(""), *sExtensionStr, EFileDialogFlags::Multiple, OpenFileNames);
}
return OpenFileNames;
}
The reason for the breakdown
Actually, we are shipping The following cannot be quoted Engine in Developer Contents of any module in the folder , This can only be Debug and Develope Next use .
PS:Engine in Developer It refers to the following figure Developer All modules in the folder .
All modules in this folder cannot be in shipping Under the use of , If used , Phenomenon is shipping Downfall , The corresponding supporting documents are not in the bag at all .
You should know what happened here , In fact, it is because you call to open the system window API It belongs to DesktopPlatform modular , Happen to happen DesktopPlatform This module is again Developer Within the scope of .
Solution
Actually, it's simple , That's the top Developer In the folder DesktopPlatform Module and what it uses Related modules ( stay Developer Range ) Copy out , Modify the class name and module name .
See here , I believe you will know how to solve similar problems if you encounter them again .
So I made a plug-in , Tested for 4.25 Each version and 4.26 Each version . Other versions have not been tested .
How does the plug-in work
1> Unzip it and put it into your project Plugins In the folder ;
2> In your build.cs There will be DesktopPlatform Module reference , Replace with DesktopPlatformEx Just name the module ;
3> Get rid of DesktopPlatform The header file contains ;
4> Remember when calling FDesktopPlatformModuleEx::Get(); Put... In your code FDesktopPlatformModule Replace with FDesktopPlatformModuleEx;
/* Open the system folder path Parameters 1: File absolute path Parameters 2: file type TEXT("*.*")= All Record : TEXT("FBX,JPG,BMP,PNG files|*.fbx;*.jpg;*.png;*.bmp"); TEXT("FBX Files|*.fbx"); TEXT("JPG,BMP,PNG files|*.jpg;*.png;*.bmp"); TEXT("(Image Files)|*.BMP;*.JPG;*.PNG;*.JPEG;)") */
UFUNCTION(BlueprintCallable, Category = "OpenWindowsFile")
static TArray<FString> OpenWindowsFiles(const FString& sTitle, const FString& sYourFullPath, const FString& sExtensionStr = TEXT("*.*"));
TArray<FString> URegionRiskReadLibrary::OpenWindowsFiles(const FString& sTitle, const FString& sYourFullPath, const FString& sExtensionStr)
{
// List of files selected by the user
TArray<FString> OpenFileNames;
IDesktopPlatform* DesktopPlatform = FDesktopPlatformModuleEx::Get();
if (DesktopPlatform)
{
void* ParentWindowHandle = GEngine->GameViewport->GetWindow()->GetNativeWindow()->GetOSWindowHandle();
DesktopPlatform->OpenFileDialog(ParentWindowHandle, sTitle, sYourFullPath, TEXT(""), *sExtensionStr, EFileDialogFlags::Multiple, OpenFileNames);
}
return OpenFileNames;
}
thank you , It's not easy to create , Great Xia, please stay … Move your lovely hands , To a Focus on Go bai
ღ( ´・ᴗ・` ) finger heart <( ̄︶ ̄)>
边栏推荐
- With 8 modules and 40 thinking models, you can break the shackles of thinking and meet the thinking needs of different stages and scenes of your work. Collect it quickly and learn it slowly
- 摘抄的只言片语
- [quick start of Digital IC Verification] 29. Ahb-sramc (9) (ahb-sramc svtb overview) of SystemVerilog project practice
- [quick start of Digital IC Verification] 24. AHB sramc of SystemVerilog project practice (4) (AHB continues to deepen)
- Getting started with webgl (4)
- 避坑:Sql中 in 和not in中有null值的情况说明
- Actually changed from 408 to self proposition! 211 North China Electric Power University (Beijing)
- leetcode 241. Different ways to add parentheses design priority for operational expressions (medium)
- Jacobo code coverage
- A need to review all the knowledge, H5 form is blocked by the keyboard, event agent, event delegation
猜你喜欢

Keil5 does not support online simulation of STM32 F0 series

Use cpolar to build a business website (2)

Getting started with webgl (2)

知否|两大风控最重要指标与客群好坏的关系分析

Unity之ASE实现卡通火焰

Ctfshow, information collection: web13

【数据挖掘】视觉模式挖掘:Hog特征+余弦相似度/k-means聚类

Gd32 F3 pin mapping problem SW interface cannot be burned

Unity's ASE achieves full screen sand blowing effect
![[quickstart to Digital IC Validation] 20. Basic syntax for system verilog Learning 7 (Coverage Driven... Including practical exercises)](/img/d3/cab8a1cba3c8d8107ce4a95f328d36.png)
[quickstart to Digital IC Validation] 20. Basic syntax for system verilog Learning 7 (Coverage Driven... Including practical exercises)
随机推荐
Nacos一致性协议 CP/AP/JRaft/Distro协议
The significance of XOR in embedded C language
Getting started with webgl (2)
Yunxiaoduo software internal test distribution test platform description document
最安全的证券交易app都有哪些
Streaming end, server end, player end
Implementation of crawling web pages and saving them to MySQL using the scrapy framework
Unity's ASE achieves full screen sand blowing effect
Mathematical modeling -- what is mathematical modeling
【数据挖掘】视觉模式挖掘:Hog特征+余弦相似度/k-means聚类
[Lanzhou University] information sharing of postgraduate entrance examination and re examination
Steps to create P8 certificate and warehousing account
使用Scrapy框架爬取网页并保存到Mysql的实现
Cocos creator collision and collision callback do not take effect
2. 堆排序『较难理解的排序』
The download button and debug button in keil are grayed out
[quick start for Digital IC Validation] 26. Ahb - sramc (6) for system verilog project practice (Basic Points of APB Protocol)
[target detection] yolov5 Runtong voc2007 data set
【Markdown语法高级】让你的博客更精彩(四:设置字体样式以及颜色对照表)
[server data recovery] a case of RAID data recovery of a brand StorageWorks server