赞
踩
问题描述:项目一开始使用UE4.23,后来升级到UE4.24,出现修改蓝图组件属性,甚至UE4原生组件,比如灯光的Light的Channel都会导致UE4崩溃。
解决办法:
1.使用Reload,蓝图修改第一次不会崩溃,第二次依然会崩溃。
2.设置Projecting里的EditorStartMap为空,重新打开UE4 Editor,目的是保证我们要修改的蓝图,没有场景对象实例依赖或引用目标蓝图,修改蓝图属性正常。
3.比对UE4.25源码,发现是UE4的bug,并且已经在4.25修复,下面是diff文件,通过git合并到4.24源码中。
- Engine/Source/Runtime/CoreUObject/Private/UObject/LinkerLoad.cpp | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
- diff --git a/Engine/Source/Runtime/CoreUObject/Private/UObject/LinkerLoad.cpp b/Engine/Source/Runtime/CoreUObject/Private/UObject/LinkerLoad.cpp
- index ad31ca8b3be..4808717dc92 100644
- --- a/Engine/Source/Runtime/CoreUObject/Private/UObject/LinkerLoad.cpp
- +++ b/Engine/Source/Runtime/CoreUObject/Private/UObject/LinkerLoad.cpp
- @@ -549,7 +549,7 @@ void FLinkerLoad::PRIVATE_PatchNewObjectIntoExport(UObject* OldObject, UObject*
-
- // Detach the old object to make room for the new
- const EObjectFlags OldObjectFlags = OldObject->GetFlags();
- - OldObject->ClearFlags(RF_NeedLoad|RF_NeedPostLoad);
- + OldObject->ClearFlags(RF_NeedLoad|RF_NeedPostLoad| RF_NeedPostLoadSubobjects);
- OldObject->SetLinker(nullptr, INDEX_NONE, true);
-
- // Copy flags from the old CDO.
- @@ -4489,7 +4489,7 @@ UObject* FLinkerLoad::CreateExport( int32 Index )
- {
- // For classes that are about to be regenerated, make sure we register them with the linker, so future references to this linker index will be valid
- const EObjectFlags OldFlags = Export.Object->GetFlags();
- - Export.Object->ClearFlags(RF_NeedLoad|RF_NeedPostLoad);
- + Export.Object->ClearFlags(RF_NeedLoad|RF_NeedPostLoad | RF_NeedPostLoadSubobjects);
- Export.Object->SetLinker( this, Index, false );
- Export.Object->SetFlags(OldFlags);
- }
其实就2行代码修改:
- //LinkerLoad::PRIVATE_PatchNewObjectIntoExport
- OldObject->ClearFlags(RF_NeedLoad|RF_NeedPostLoad);
- 修改为OldObject->ClearFlags(RF_NeedLoad|RF_NeedPostLoad| RF_NeedPostLoadSubobjects);
-
- //UObject* FLinkerLoad::CreateExport( int32 Index )
- Export.Object->ClearFlags(RF_NeedLoad|RF_NeedPostLoad);
- 修改为Export.Object->ClearFlags(RF_NeedLoad|RF_NeedPostLoad | RF_NeedPostLoadSubobjects);
最后将生成的UE4Editor-CoreUObject.pdb和UE4Editor-CoreUObject.dll替换目标引擎的Engine/Binaries/Win64目录下即可。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。