Description

Adding an instance static mesh component to a class causes the editor to crash when an instance is added to a blueprint of the class.

Regression:
Yes - this behavior does not occur on 4.16.3 (CL 3561208)

Steps to Reproduce
  1. Open UE4 Editor (any project)
  2. Add code to project based on actor (MyActor)
  3. Add the following to MyActor.h:
    UPROPERTY(EditAnywhere, BlueprintReadOnly)
    	class UInstancedStaticMeshComponent* ModularMeshComponent;
    
  4. In MyActor.cpp add this include to the bottom of the include list:
    #include "Runtime/Engine/Classes/Components/InstancedStaticMeshComponent.h"
    
  5. Add the following to constructor:
    ModularMeshComponent = CreateDefaultSubobject<UInstancedStaticMeshComponent>(TEXT("ModularMesh"));
    
  6. Compile
  7. In the editor, create and open a blueprint of MyActor (MyActorBP)
  8. With ModularMeshComponent selected, set any mesh to ModularMeshComponent->StaticMesh->StaticMesh
  9. Add element to ModularMeshComponent->Instances-Instances array

Result:
Editor crashes with provided callstack

Expected:
The set mesh is added to the component for each instance in the array

Callstack
LoginId:7156c35640f86204e61b8383f45dee17
EpicAccountId:c807849e05a0413d99e379f2802cae9c

Assertion failed: Stream.VertexBuffer->IsInitialized() [File:D:\Build\++UE4+Release-4.17+Compile\Sync\Engine\Source\Runtime\ShaderCore\Private\VertexFactory.cpp] [Line: 184] Vertex buffer was not initialized! Stream 3, Stride 48, Name Static-mesh instances

UE4Editor_Core!FDebug::AssertFailed() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\core\private\misc\assertionmacros.cpp:349]
UE4Editor_ShaderCore!FVertexFactory::Set() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\shadercore\private\vertexfactory.cpp:184]
UE4Editor_Renderer!FMeshDrawingPolicy::SetSharedState() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\renderer\private\drawingpolicy.cpp:198]
UE4Editor_Renderer!FDepthDrawingPolicy::SetSharedState() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\renderer\private\depthrendering.cpp:421]
UE4Editor_Renderer!FDepthDrawingPolicyFactory::DrawMesh() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\renderer\private\depthrendering.cpp:743]
UE4Editor_Renderer!FDeferredShadingSceneRenderer::RenderPrePassViewDynamic() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\renderer\private\depthrendering.cpp:848]
UE4Editor_Renderer!FDeferredShadingSceneRenderer::RenderPrePassView() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\renderer\private\depthrendering.cpp:980]
UE4Editor_Renderer!FDeferredShadingSceneRenderer::RenderPrePass() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\renderer\private\depthrendering.cpp:1289]
UE4Editor_Renderer!FDeferredShadingSceneRenderer::Render() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\renderer\private\deferredshadingrenderer.cpp:759]
UE4Editor_Renderer!RenderViewFamily_RenderThread() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\renderer\private\scenerendering.cpp:1849]
UE4Editor_Renderer!TGraphTask<`FRendererModule::BeginRenderingViewFamily'::`26'::EURCMacro_FDrawSceneCommand>::ExecuteTask() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\core\public\async\taskgraphinterfaces.h:784]
UE4Editor_Core!FNamedTaskThread::ProcessTasksNamedThread() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\core\private\async\taskgraph.cpp:650]
UE4Editor_Core!FNamedTaskThread::ProcessTasksUntilQuit() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\core\private\async\taskgraph.cpp:559]
UE4Editor_RenderCore!RenderingThreadMain() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\rendercore\private\renderingthread.cpp:325]
UE4Editor_RenderCore!FRenderingThread::Run() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\rendercore\private\renderingthread.cpp:459]
UE4Editor_Core!FRunnableThreadWin::Run() [d:\build\++ue4+release-4.17+compile\sync\engine\source\runtime\core\private\windows\windowsrunnablethread.cpp:76]

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-49753 in the post.

2
Login to Vote

Fixed
ComponentUE - Gameplay - Blueprint
Affects Versions4.17.14.17.2
Target Fix4.18
Fix Commit3671472
Release Commit3671472
CreatedSep 14, 2017
ResolvedSep 29, 2017
UpdatedApr 27, 2018
View Jira Issue