Description

Adding a CanvasRenderTarget2D* UPROPERTY to a class and setting it using CreateCanvasRenderTarget2D will cause the Editor to crash on load.

CRASHREPORT:
[Link Removed]

UDN:
This was also reported by a licensee on UDN (https://udn.unrealengine.com/questions/229643/crash-in-46-when-creating-or-updating-a-canvasrend.html) who was able to trigger the crash by calling a function that created a CanvasRenderTarget2D. Retested in main (CL 2375748) and the crash still occurs.

ANSWERHUB:
https://answers.unrealengine.com/questions/153993/createcanvasrendertarget2d-461.html

WORKAROUND:
The Licensee that reported the issue narrowed down the issue to using whatever is returned by GetWorld->FeatureLevel. Using ERHIFeatureLevel::SM5 instead works for the Licensee.

Steps to Reproduce
  1. Create a new project using the First Person Code template.
  2. Build the project in Visual Studio.
  3. Open the project in the Editor.
  4. Add a new code class derived from StaticMeshActor.
  5. Close the Editor.
  6. In the .h file for the new class, add the following code:
    #include "Engine/CanvasRenderTarget2D.h"
    
    UPROPERTY()
    UCanvasRenderTarget2D* RenderTex;
    
  7. In the .cpp file for the new class, add the following code:
    RenderTex = UCanvasRenderTarget2D::CreateCanvasRenderTarget2D(UCanvasRenderTarget2D::StaticClass(), 512, 512);
    
  8. Build the project in Visual Studio.
  9. Open the project in the Editor.

Have Comments or More Details?

Head over to the existing AnswerHub thread and let us know what's up.

0
Login to Vote

Fixed
ComponentTools
Affects Versions4.54.64.7
Target Fix4.8
Fix Commit2388807
CreatedOct 23, 2014
ResolvedJan 27, 2015
UpdatedApr 27, 2018