ue4烘焙失败
以下内容转自http://blog.csdn.net/XIAOZHI0999/article/details/53389020?locationNum=3&fps=1作者:--小智--ue4中经常会遇到烘焙失败的问题,有的显而易见,有的则不那么容易被发现。这里记录一下工作中遇到的烘焙失败问题,希望在以后遇到类似的问题能作为参考。首先看下ue4官方文档对烘焙的解释
内容烘焙
虚幻引擎将内容资源存储为在其内部应用的特殊格式,比如贴图数据存储为PNG格式, 或者音频存储为WAV格式。但是,针对不同平台,这些内容需要转换成各种格式, 这是因为该平台使用专有的格式,不支持虚幻引擎使用的存储资源的格式, 或者是因为存在一种更加节约内存或提高性能的格式。将内容从内部格式转换为针对特定平台的格式 的过程,称为烘焙 。 一般解决烘焙问题的思路如下,先确定是哪个地图烘焙失败,在DefaultEditor.ini中包含所有地图列表,可以通过增删地图列表来逐步定位出问题的地图。然后列表中可以只放出问题的地图,这样可以加快烘焙速度,也可以缩小可能导致烘焙失败的范围。最后要解决烘焙失败原因,就是通过分析烘焙log,以下是一次烘焙失败ue4 editor Output Log窗口输出的日志(由于日志较长,这里只截取了部分输出)MainFrameActions: Cooking (Windows): UE4Editor-Cmd: LogLinker:Warning: Can't find file '/Game/GunWorks/GW_Guns/AAR/upper_receivers/upper_receiver_01/AAR_Upper_Receiver'
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: LogUObjectGlobals:Warning: Failed to load '/Game/GunWorks/GW_Guns/AAR/upper_receivers/upper_receiver_01/AAR_Upper_Receiver': Can't find file '/Game/GunWorks/GW_Guns/AAR/upper_receivers/upper_receiver_01/AAR_Upper_Receiver'
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: LogLinker:Warning: Can't find file '/Game/GunWorks/GW_Guns/AAR/upper_receivers/upper_receiver_01/AAR_Upper_Receiver'
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: LogUObjectGlobals:Warning: Failed to load '/Game/GunWorks/GW_Guns/AAR/upper_receivers/upper_receiver_01/AAR_Upper_Receiver': Can't find file '/Game/GunWorks/GW_Guns/AAR/upper_receivers/upper_receiver_01/AAR_Upper_Receiver'
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: LogUObjectGlobals:Warning: Failed to find object 'Object /Game/GunWorks/GW_Guns/AAR/upper_receivers/upper_receiver_01/AAR_Upper_Receiver.AAR_Upper_Receiver'
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: LogRedirectors:Warning: String Asset Reference '/Game/GunWorks/GW_Guns/AAR/upper_receivers/upper_receiver_01/AAR_Upper_Receiver.AAR_Upper_Receiver' was not found! (Referencer '/Game/GunWorks/Materials/GW/GunWorks_M.GunWorks_M:PreviewMesh')
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: LogLinker:Warning: Can't find file '/Game/Environment/Meshes/TEMP_01'
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: LogUObjectGlobals:Warning: Failed to load '/Game/Environment/Meshes/TEMP_01': Can't find file '/Game/Environment/Meshes/TEMP_01'
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: LogLinker:Warning: Can't find file '/Game/Environment/Meshes/TEMP_01'
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: LogUObjectGlobals:Warning: Failed to load '/Game/Environment/Meshes/TEMP_01': Can't find file '/Game/Environment/Meshes/TEMP_01'
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: LogUObjectGlobals:Warning: Failed to find object 'Object /Game/Environment/Meshes/TEMP_01.TEMP_01'
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: LogRedirectors:Warning: String Asset Reference '/Game/Environment/Meshes/TEMP_01.TEMP_01' was not found! (Referencer '/Game/SideScrollerKit/Materials/M_Glass_wall_beam.M_Glass_wall_beam:PreviewMesh')
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: LogShaders:Warning: CompilingMasterWeaponShader: Platform=PCD3D_SM4, Usage=LightingModel=MSM_DefaultLit, BlendMode=BLEND_Opaque, SpecialEngine=0, TwoSided=0, TSNormal=1, InjectEmissiveIntoLPV=0, Masked=0, Distorted=0, BlockGI=0, Usage={bUsedWithSkeletalMesh,bUsedWithVxgiVo
xelization}
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: LogShaders:Warning: 116 Shaders among 3 VertexFactories
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: LogShaders:Warning: CompilingMasterWeaponShader: Platform=PCD3D_SM4, Usage=LightingModel=MSM_DefaultLit, BlendMode=BLEND_Opaque, SpecialEngine=0, TwoSided=0, TSNormal=1, InjectEmissiveIntoLPV=0, Masked=0, Distorted=0, BlockGI=0, Usage={bUsedWithSkeletalMesh,bUsedWithVxgiVo
xelization}, StaticSwitch'Debug AO'=False, StaticSwitch'White Paint Pattern'=False, StaticSwitch'Two Color Pattern'=False, StaticSwitch'Light Metal Pattern'=False, StaticSwitch'Plasma on Channel Two'=False, StaticSwitch'Plasma on Channel One'=False, StaticSwitch'Plasma on Channel Three'=False, StaticSwitch'Panini Projection'=True, StaticMask'Plasma Channel O
ne'=R, StaticMask'Plasma Channel Two'=G, StaticMask'Plasma Channel Three'=G
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: LogShaders:Warning: 116 Shaders among 3 VertexFactories
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: LogShaders:Warning: CompilingM_ShockProto_Screen: Platform=PCD3D_SM4, Usage=LightingModel=MSM_Unlit, BlendMode=BLEND_Additive, SpecialEngine=0, TwoSided=0, TSNormal=1, InjectEmissiveIntoLPV=0, Masked=0, Distorted=0, BlockGI=0, Usage={bUsedWithSkeletalMesh,bUsedWithStaticLi
ghting,bUsedWithVxgiVoxelization}, StaticSwitch'Panini Projection'=True
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: LogShaders:Warning: 72 Shaders among 3 VertexFactories
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: LogShaders:Warning: CompilingM_Shock_Flair_Multi_Color_2: Platform=PCD3D_SM4, Usage=LightingModel=MSM_Unlit, BlendMode=BLEND_Additive, SpecialEngine=0, TwoSided=1, TSNormal=1, InjectEmissiveIntoLPV=0, Masked=0, Distorted=0, BlockGI=0, Usage={bUsedWithSkeletalMesh,bUsedWith
ParticleSprites,bUsedWithBeamTrails,bUsedWithStaticLighting,bUsedWithVxgiVoxelization}, StaticSwitch'Panini Projection'=True
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: LogOutputDevice:Error:
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: begin: stack for UAT
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: LogWindows:Error: === Critical error: ===
MainFrameActions: Cooking (Windows): UE4Editor-Cmd:
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: Fatal error!
MainFrameActions: Cooking (Windows): UE4Editor-Cmd:
MainFrameActions: Cooking (Windows): UE4Editor-Cmd:
MainFrameActions: Cooking (Windows): UE4Editor-Cmd:
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x00000000
MainFrameActions: Cooking (Windows): UE4Editor-Cmd:
MainFrameActions: Cooking (Windows): UE4Editor-Cmd:
MainFrameActions: Cooking (Windows): UE4Editor-Cmd:
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: UE4Editor-Engine.dll!UMaterialInstance::HasOverridenBaseProperties()
MainFrameActions: Cooking (Windows): UE4Editor-Cmd:
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: UE4Editor-Engine.dll!UMaterialInstance::InitStaticPermutation()
MainFrameActions: Cooking (Windows): UE4Editor-Cmd:
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: UE4Editor-Engine.dll!UMaterialInstance::PostLoad()
MainFrameActions: Cooking (Windows): UE4Editor-Cmd:
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: UE4Editor-CoreUObject.dll!UObject::ConditionalPostLoad()
MainFrameActions: Cooking (Windows): UE4Editor-Cmd:
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: UE4Editor-CoreUObject.dll!EndLoad()
MainFrameActions: Cooking (Windows): UE4Editor-Cmd:
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: UE4Editor-CoreUObject.dll!LoadPackageInternal()
MainFrameActions: Cooking (Windows): UE4Editor-Cmd:
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: UE4Editor-CoreUObject.dll!LoadPackageInternal()
MainFrameActions: Cooking (Windows): UE4Editor-Cmd:
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: UE4Editor-CoreUObject.dll!ResolveName()
MainFrameActions: Cooking (Windows): UE4Editor-Cmd:
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: UE4Editor-CoreUObject.dll!StaticLoadObjectInternal()
MainFrameActions: Cooking (Windows): UE4Editor-Cmd:
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: UE4Editor-CoreUObject.dll!StaticLoadObject()
MainFrameActions: Cooking (Windows): UE4Editor-Cmd:
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: UE4Editor-CoreUObject.dll!FRedirectCollector::ResolveStringAssetReference()
MainFrameActions: Cooking (Windows): UE4Editor-Cmd:
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: UE4Editor-UnrealEd.dll!UCookOnTheFlyServer::TickCookOnTheSide()
MainFrameActions: Cooking (Windows): UE4Editor-Cmd:
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: UE4Editor-UnrealEd.dll!UCookCommandlet::NewCook()
MainFrameActions: Cooking (Windows): UE4Editor-Cmd:
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: UE4Editor-UnrealEd.dll!UCookCommandlet::Main()
MainFrameActions: Cooking (Windows): UE4Editor-Cmd:
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: UE4Editor-Cmd.exe!FEngineLoop::PreInit()
MainFrameActions: Cooking (Windows): UE4Editor-Cmd:
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: UE4Editor-Cmd.exe!GuardedMain()
MainFrameActions: Cooking (Windows): UE4Editor-Cmd:
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: UE4Editor-Cmd.exe!GuardedMainWrapper()
MainFrameActions: Cooking (Windows): UE4Editor-Cmd:
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: UE4Editor-Cmd.exe!WinMain()
MainFrameActions: Cooking (Windows): UE4Editor-Cmd:
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: UE4Editor-Cmd.exe!__scrt_common_main_seh()
MainFrameActions: Cooking (Windows): UE4Editor-Cmd:
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: kernel32.dll
MainFrameActions: Cooking (Windows): UE4Editor-Cmd:
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: ntdll.dll
MainFrameActions: Cooking (Windows): UE4Editor-Cmd:
MainFrameActions: Cooking (Windows): UE4Editor-Cmd: ntdll.dll
MainFrameActions: Cooking (Windows): UE4Editor-Cmd:
这里优先查看error,根据红色标出的部分,很快就知道是由于空指针导致的烘焙失败,再往下有具体烘焙失败的调用堆栈(有时候没有堆栈输出,可以尝试直接从代码启动editor,然后烘焙)通过堆栈分析,发下以下代码是导致最终烘焙失败的原因:http://img.blog.csdn.net/20161129100100261
2848行,空指针,很明显,Parent是空指针导致的,也就是说,是由于MaterialInstance的Parent是NULL导致的烘焙失败然后我们从后往前排查输出日志(主要是看有error、warning和fail的),发现材质文件MasterWeaponShader一打开,editor直接闪退,很明显是这个文件导致的烘焙失败,然后查找引用这个文件的地方,发现这些文件项目中并没有用到,于是删除相关文件,再次烘焙,就成功了。ps:好的习惯是重视烘焙和打包中的warning,尽可能消除这些warning,这样不仅能提高烘焙和打包速度,还能尽快的定位问题。还有一种比较笨但比较实用的方式是从地图中不断删除物体后进行烘焙,这样可以不断缩小范围(因为只有被地图引用到的资源才会被烘焙)
页:
[1]