unreal-engine4

Mongodb cxx + Unreal Engine 4 - Crash while iterating over Cursor

微笑、不失礼 提交于 2019-12-06 05:30:28
I got an error while or after iterating over a mongocxx::cursor after finding some documents in my database. I am using Windows 10, Unreal Engine 4.16.1 and mongodb cxx 3.1.1. The database connection is set up correctly, the find function finds my documents and returns a valid cursor. It ends up in this Exception: Exception thrown at 0x00007FFDED56B698 (UE4Editor-Core.dll) in UE4Editor.exe: 0xC0000005: Access violation writing location 0x0000000000000010. with this output: 2598:0a50 @ 01781390 - LdrpCallTlsInitializers - INFO: Calling TLS callback 00007FFDDC66C154 for DLL "C:\WINDOWS\System32

UE4: output game frames to file

你说的曾经没有我的故事 提交于 2019-12-05 19:41:10
This applies to Unreal Engine 4.9 Each frame, I'd like to save it to file (overwriting the existing one). For a simple D3D11 demo that I have made, I've been able to do this with: void Engine::CaptureFrame(D3DX11_IMAGE_FILE_FORMAT format, const LPCTSTR fileName){ backbuffer->GetResource(&resource); ID3D11Texture2D* texture; HRESULT hResult = resource->QueryInterface(__uuidof(ID3D11Texture2D), reinterpret_cast<LPVOID*>(&texture)); D3DX11SaveTextureToFile(deviceContext, texture, format, fileName); //Clean up texture->Release(); resource->Release(); } I have done this with OpenGL, too, using a

How to read data from a UTexture2D in C++

僤鯓⒐⒋嵵緔 提交于 2019-12-04 19:35:02
I am trying to read the pixel data from a populated UTexture2D in an Unreal Engine C++ project. Before I post the question here, I tried to use the method described in this link: https://answers.unrealengine.com/questions/25594/accessing-pixel-values-of-texture2d.html . However, it doesn't work for me. All pixel values I got from the texture are some garbage data. I just want to get the depth values from the SceneCapture2D and a post-processing material that contains SceneTexture: Depth node. I need the depth values available in C++ so that I can do further processing with OpenCV. In Directx11

Do all C++ compilers support the async/await keywords?

元气小坏坏 提交于 2019-12-03 11:18:19
I want to use async/await syntax in C++ (UE4 framework), but due to cross-platform code I not sure that is possible... Or possible? If yes, how can I use it? And also there are await and __await ( resumable , yield and __yield_value also) keywords that highlighted in Visual Studio. What's difference? Maybe not all compilers supports this keywords or supports separately? gcc , clang are accepts it? Or not accepts and I can just use macros for each platform individually. async and await are language extensions proposed by Microsoft with several revisions, but current is N4134 . This has not yet

Unreal GAS: Print out the current value of an attribute to UI when it changes

谁说胖子不能爱 提交于 2019-12-02 10:57:39
问题 When the base value of an attribute changes, there is UAttributeSet::PostGameplayEffectExecute() available to access the (new) value and GameplayEffect with its context. I'm using this to print the changed value to UI (this is also done in ActionRPG). Is there something similar available for the current value of an attribute? How to notify UI, when FGameplayAttributeData::CurrentValue is updated? Though UAttributeSet::PreAttributeChange() is called on every value update, it doesn't provide

Unreal Engine 4.10.1 can't compile Visual Studio 2015 project

我是研究僧i 提交于 2019-12-01 05:38:57
问题 I recently installed the most recent version of UE on my Windows 7 and made a new empty C++ project. After creating the project it gave me an error saying it failed to compile. I opened the project in VS to manually compile it and this is the output I got. I looked online but got no answers. EDIT: I use these headers with no issues when compiling non-UE projects. 1>------ Build started: Project: RPG, Configuration: Development_Editor x64 ------ 1> Performing 7 actions (2 in parallel) 1> [2/7]

Encoding frames to video with ffmpeg

吃可爱长大的小学妹 提交于 2019-11-29 12:54:09
I am trying to encode a video in Unreal Engine 4 with C++. I have access to the separate frames. Below is the code which reads viewport's displayed pixels and stores in buffer. //Safely get render target resource. FRenderTarget* RenderTarget = TextureRenderTarget->GameThread_GetRenderTargetResource(); FIntPoint Size = RenderTarget->GetSizeXY(); auto ImageBytes = Size.X* Size.Y * static_cast<int32>(sizeof(FColor)); TArray<uint8> RawData; RawData.AddUninitialized(ImageBytes); //Get image raw data. if (!RenderTarget->ReadPixelsPtr((FColor*)RawData.GetData())) { RawData.Empty(); UE_LOG

Encoding frames to video with ffmpeg

三世轮回 提交于 2019-11-28 06:32:20
问题 I am trying to encode a video in Unreal Engine 4 with C++. I have access to the separate frames. Below is the code which reads viewport's displayed pixels and stores in buffer. //Safely get render target resource. FRenderTarget* RenderTarget = TextureRenderTarget->GameThread_GetRenderTargetResource(); FIntPoint Size = RenderTarget->GetSizeXY(); auto ImageBytes = Size.X* Size.Y * static_cast<int32>(sizeof(FColor)); TArray<uint8> RawData; RawData.AddUninitialized(ImageBytes); //Get image raw