Description

When adding a Material Layer, that has a Static Component Mask Parameter node in it, to a Material Instance, the editor will crash.  

The ability to set Material Attribute layers in a Material Instance is not available in 4.25.4, so not marking as a Regression.

Steps to Reproduce
  1. Create a new material
  2. Set the Material to use Material Attributes
  3. Add a Material Attribute Layers node
  4. In the Content Browser, right-click the new material you created
  5. Select Create Material Instance
  6. Right-click in the Content Browser
  7. Navigate to Materials & Textures > Material Layers to create a new Material Layer asset
  8. Open the Material Layer asset
  9. Add a Static Component Mask Parameter node
  10. Open the Material Instance you created
  11. In the Layer Parameters, set the Layer Asset to the Material Layer you created

RESULT:

The engine crashes

EXPECTED:

The user would be able to use a Static Component Mask Parameter node in a Material Layer without crashing

Callstack
 === Critical error: ===
 
 Assertion failed: (Index >= 0) & (Index < ArrayNum) [File:D:\Build\++UE4\Sync\Engine\Source\Runtime\Core\Public\Containers/Array.h] [Line: 674] 
 Array index out of bounds: 0 from an array of size 0
 
 
 [Callstack] 0x00007ff8caab3b19 KERNELBASE.dll!UnknownFunction []
 [Callstack] 0x00007ff87ec3d066 UE4Editor-Core.dll!ReportAssert() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Core\Private\Windows\WindowsPlatformCrashContext.cpp:1616]
 [Callstack] 0x00007ff87ec407a8 UE4Editor-Core.dll!FWindowsErrorOutputDevice::Serialize() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Core\Private\Windows\WindowsErrorOutputDevice.cpp:78]
 [Callstack] 0x00007ff87e94e8cd UE4Editor-Core.dll!FOutputDevice::LogfImpl() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Core\Private\Misc\OutputDevice.cpp:61]
 [Callstack] 0x00007ff87e8e5575 UE4Editor-Core.dll!AssertFailedImplV() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Core\Private\Misc\AssertionMacros.cpp:104]
 [Callstack] 0x00007ff87e8e7620 UE4Editor-Core.dll!FDebug::CheckVerifyFailedImpl() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Core\Private\Misc\AssertionMacros.cpp:461]
 [Callstack] 0x00007ff87d1e8208 UE4Editor-Engine.dll!DispatchCheckVerify<void,<lambda_a42d0919e8303add9bf9f7b44044abc5> >() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Core\Public\Misc\AssertionMacros.h:165]
 [Callstack] 0x00007ff87c1f946c UE4Editor-Engine.dll!FMaterialCachedExpressionData::UpdateForExpressions() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\Materials\MaterialCachedData.cpp:528]
 [Callstack] 0x00007ff87c18fc5d UE4Editor-Engine.dll!<lambda_52b30304b52de31a4a8cc5e30d70deca>::operator()() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\Materials\MaterialCachedData.cpp:222]
 [Callstack] 0x00007ff87c1fabeb UE4Editor-Engine.dll!FMaterialCachedExpressionData::UpdateForFunction() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\Materials\MaterialCachedData.cpp:239]
 [Callstack] 0x00007ff87c1fac92 UE4Editor-Engine.dll!FMaterialCachedExpressionData::UpdateForLayerFunctions() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\Materials\MaterialCachedData.cpp:247]
 [Callstack] 0x00007ff87c2895e2 UE4Editor-Engine.dll!UMaterialInstance::UpdateCachedLayerParameters() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\Materials\MaterialInstance.cpp:4031]
 [Callstack] 0x00007ff87c27159b UE4Editor-Engine.dll!UMaterialInstance::PostEditChangeProperty() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\Materials\MaterialInstance.cpp:4097]
 [Callstack] 0x00007ff87c271dde UE4Editor-Engine.dll!UMaterialInstanceConstant::PostEditChangeProperty() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\Materials\MaterialInstanceConstant.cpp:55]
 [Callstack] 0x00007ff8ac234816 UE4Editor-CoreUObject.dll!UObject::PostEditChange() [D:\Build\++UE4\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\Obj.cpp:342]
 [Callstack] 0x00007ff85b8e75db UE4Editor-MaterialEditor.dll!UMaterialEditingLibrary::UpdateMaterialFunction() [D:\Build\++UE4\Sync\Engine\Source\Editor\MaterialEditor\Private\MaterialEditingLibrary.cpp:915]
 [Callstack] 0x00007ff85b8eb984 UE4Editor-MaterialEditor.dll!FMaterialEditor::UpdateOriginalMaterial() [D:\Build\++UE4\Sync\Engine\Source\Editor\MaterialEditor\Private\MaterialEditor.cpp:2102]
 [Callstack] 0x00007ff85b8b53b2 UE4Editor-MaterialEditor.dll!FMaterialEditor::OnApply() [D:\Build\++UE4\Sync\Engine\Source\Editor\MaterialEditor\Private\MaterialEditor.cpp:2786]
 [Callstack] 0x00007ff85b891436 UE4Editor-MaterialEditor.dll!TBaseSPMethodDelegateInstance<0,FMaterialEditor,0,void __cdecl(void),FDefaultDelegateUserPolicy>::ExecuteIfSafe() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Core\Public\Delegates\DelegateInstancesImpl.h:307]
 [Callstack] 0x00007ff87abe0088 UE4Editor-Slate.dll!FUICommandList::ExecuteAction() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Slate\Private\Framework\Commands\UICommandList.cpp:102]
 [Callstack] 0x00007ff87accf342 UE4Editor-Slate.dll!SToolBarButtonBlock::OnClicked() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Slate\Private\Framework\MultiBox\SToolBarButtonBlock.cpp:301]
 [Callstack] 0x00007ff87acabd07 UE4Editor-Slate.dll!TBaseSPMethodDelegateInstance<0,SToolBarButtonBlock,0,FReply __cdecl(void),FDefaultDelegateUserPolicy>::Execute() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Core\Public\Delegates\DelegateInstancesImpl.h:290]
 [Callstack] 0x00007ff87ad4859e UE4Editor-Slate.dll!SButton::ExecuteOnClick() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Slate\Private\Widgets\Input\SButton.cpp:385]
 [Callstack] 0x00007ff87ad6071e UE4Editor-Slate.dll!SButton::OnMouseButtonUp() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Slate\Private\Widgets\Input\SButton.cpp:304]
 [Callstack] 0x00007ff87aba46be UE4Editor-Slate.dll!FEventRouter::Route<FReply,FEventRouter::FToLeafmostPolicy,FPointerEvent,<lambda_cc5aea9e7377b04ce85c30c65ec3889b> >() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:378]
 [Callstack] 0x00007ff87ac27f14 UE4Editor-Slate.dll!FSlateApplication::RoutePointerUpEvent() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:4815]
 [Callstack] 0x00007ff87ac10337 UE4Editor-Slate.dll!FSlateApplication::ProcessMouseButtonUpEvent() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:5356]
 [Callstack] 0x00007ff87ac03632 UE4Editor-Slate.dll!FSlateApplication::OnMouseUp() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:5321]
 [Callstack] 0x00007ff8b168bcb5 UE4Editor-ApplicationCore.dll!FWindowsApplication::ProcessDeferredMessage() [D:\Build\++UE4\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsApplication.cpp:2178]
 [Callstack] 0x00007ff8b1679197 UE4Editor-ApplicationCore.dll!FWindowsApplication::DeferMessage() [D:\Build\++UE4\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsApplication.cpp:2642]
 [Callstack] 0x00007ff8b168e389 UE4Editor-ApplicationCore.dll!FWindowsApplication::ProcessMessage() [D:\Build\++UE4\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsApplication.cpp:1046]
 [Callstack] 0x00007ff8b1674310 UE4Editor-ApplicationCore.dll!FWindowsApplication::AppWndProc() [D:\Build\++UE4\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsApplication.cpp:878]
 [Callstack] 0x00007ff8ccf35c1d USER32.dll!UnknownFunction []
 [Callstack] 0x00007ff8ccf35612 USER32.dll!UnknownFunction []
 [Callstack] 0x00007ff8b168f914 UE4Editor-ApplicationCore.dll!FWindowsPlatformApplicationMisc::PumpMessages() [D:\Build\++UE4\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsPlatformApplicationMisc.cpp:130]
 [Callstack] 0x00007ff7c02e8848 UE4Editor.exe!FEngineLoop::Tick() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:4748]
 [Callstack] 0x00007ff7c030117c UE4Editor.exe!GuardedMain() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Launch\Private\Launch.cpp:169]
 [Callstack] 0x00007ff7c030125a UE4Editor.exe!GuardedMainWrapper() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:137]
 [Callstack] 0x00007ff7c03152bd UE4Editor.exe!WinMain() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:268]
 [Callstack] 0x00007ff7c0317fea UE4Editor.exe!__scrt_common_main_seh() [d:\agent\_work\5\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
 [Callstack] 0x00007ff8cd7c7c24 KERNEL32.DLL!UnknownFunction []
 [Callstack] 0x00007ff8cd9cd721 ntdll.dll!UnknownFunction []

Have Comments or More Details?

There's no existing public thread on this issue, so head over to AnswerHub just mention UE-113590 in the post.

0
Login to Vote

Fixed
ComponentRendering
Affects Versions4.26.2
Target Fix4.27
Fix Commit16036220
Main Commit16114108
Release Commit16036220
CreatedApr 15, 2021
ResolvedApr 16, 2021
UpdatedMay 7, 2021