Runtime Mesh Component

Thanks, , this looks really good. I’m curious though. It seems not to have an equivalent ‘Get Section from Procedural Mesh’ node (I’m using blueprints atm). I’m not sure how to update an existing mesh in realtime without it. Am I missing something obvious?

Never mind, I realised I could copy the mesh data initially from a Procedural Mesh component into an array variable in the construction script, do my calculations on that and then update the mesh.

Unfortunately, despite the claims, updating the RMC is noticeably slower than updating the built-in Procedural Mesh.

that is an issue we are currently facing as well. He wanted to save on memory, thus he combines normald and tangents into a single struct for internal use. But that needs shitload of calculation time. Especially if you have lots of vertices.

Ah, thanks for the explanation. It’s a shame as I’m having to greatly reduce the poly count in my model (from 26k to 600) to make performance reasonable and it doesn’t look nearly as good anymore. Tessellation doesn’t help either as the result is all lumpy and horrible.

I checked this and it’s already enabled… hmmm

what does the log say? Callstack of the crash?


[2018.09.29-15.24.05:539][148]LogWindows: Error: === Critical error: ===
[2018.09.29-15.24.05:539][148]LogWindows: Error:
[2018.09.29-15.24.05:539][148]LogWindows: Error: Assertion failed: Pair != nullptr [File:C:\UnrealEngine-FleX-4.19.2\Engine\Source\Runtime\Core\Public\Containers/Map.h] [Line: 465]
[2018.09.29-15.24.05:539][148]LogWindows: Error:
[2018.09.29-15.24.05:539][148]LogWindows: Error:
[2018.09.29-15.24.05:539][148]LogWindows: Error:
[2018.09.29-15.24.05:539][148]LogWindows: Error: [Callstack] 0x00000000D827A388 KERNELBASE.dll!UnknownFunction ]
[2018.09.29-15.24.05:539][148]LogWindows: Error: [Callstack] 0x00000000B8676CB4 UE4Editor-ApplicationCore.dll!FWindowsErrorOutputDevice::Serialize() [c:\unrealengine-flex-4.19.2\engine\source\runtime\applicationcore\private\windows\windowserroroutputdevice.cpp:65]
[2018.09.29-15.24.05:539][148]LogWindows: Error: [Callstack] 0x000000008A5D706C UE4Editor-Core.dll!FOutputDevice::LogfImpl() [c:\unrealengine-flex-4.19.2\engine\source\runtime\core\private\misc\outputdevice.cpp:70]
[2018.09.29-15.24.05:539][148]LogWindows: Error: [Callstack] 0x000000008A578B5B UE4Editor-Core.dll!FDebug::AssertFailed() [c:\unrealengine-flex-4.19.2\engine\source\runtime\core\private\misc\assertionmacros.cpp:419]
[2018.09.29-15.24.05:539][148]LogWindows: Error: [Callstack] 0x000000006A7783BD UE4Editor-RuntimeMeshComponent.dll!URuntimeMeshLibrary::GetStaticMeshSection() [c:\unrealengine-flex-4.19.2\flexproject\plugins\runtimemeshcomponent-master\source\runtimemeshcomponent\private\runtimemeshlibrary.cpp:696]
[2018.09.29-15.24.05:539][148]LogWindows: Error: [Callstack] 0x000000006A77989B UE4Editor-RuntimeMeshComponent.dll!URuntimeMeshLibrary::GetStaticMeshSection() [c:\unrealengine-flex-4.19.2\flexproject\plugins\runtimemeshcomponent-master\source\runtimemeshcomponent\private\runtimemeshlibrary.cpp:340]
[2018.09.29-15.24.05:539][148]LogWindows: Error: [Callstack] 0x000000006A758563 UE4Editor-RuntimeMeshComponent.dll!URuntimeMeshLibrary::CopyStaticMeshToRuntimeMesh() [c:\unrealengine-flex-4.19.2\flexproject\plugins\runtimemeshcomponent-master\source\runtimemeshcomponent\private\runtimemeshlibrary.cpp:375]
[2018.09.29-15.24.05:539][148]LogWindows: Error: [Callstack] 0x000000006A7A4814 UE4Editor-RuntimeMeshComponent.dll!URuntimeMeshLibrary::execCopyStaticMeshToRuntimeMeshComponent() [c:\unrealengine-flex-4.19.2\flexproject\plugins\runtimemeshcomponent-master\source\runtimemeshcomponent\public\runtimemeshlibrary.h:18]
[2018.09.29-15.24.05:539][148]LogWindows: Error: [Callstack] 0x000000009432BA84 UE4Editor-CoreUObject.dll!UFunction::Invoke() [c:\unrealengine-flex-4.19.2\engine\source\runtime\coreuobject\private\uobject\class.cpp:4551]
[2018.09.29-15.24.05:539][148]LogWindows: Error: [Callstack] 0x000000009450CEFE UE4Editor-CoreUObject.dll!UObject::CallFunction() [c:\unrealengine-flex-4.19.2\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:763]
[2018.09.29-15.24.05:539][148]LogWindows: Error: [Callstack] 0x00000000945246E8 UE4Editor-CoreUObject.dll!UObject::ProcessContextOpcode() [c:\unrealengine-flex-4.19.2\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:2198]
[2018.09.29-15.24.05:539][148]LogWindows: Error: [Callstack] 0x00000000945269F2 UE4Editor-CoreUObject.dll!UObject::ProcessInternal() [c:\unrealengine-flex-4.19.2\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:985]
[2018.09.29-15.24.05:539][148]LogWindows: Error: [Callstack] 0x000000009450D98D UE4Editor-CoreUObject.dll!UObject::CallFunction() [c:\unrealengine-flex-4.19.2\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:887]
[2018.09.29-15.24.05:539][148]LogWindows: Error: [Callstack] 0x00000000945269F2 UE4Editor-CoreUObject.dll!UObject::ProcessInternal() [c:\unrealengine-flex-4.19.2\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:985]
[2018.09.29-15.24.05:539][148]LogWindows: Error: [Callstack] 0x000000009432BA84 UE4Editor-CoreUObject.dll!UFunction::Invoke() [c:\unrealengine-flex-4.19.2\engine\source\runtime\coreuobject\private\uobject\class.cpp:4551]
[2018.09.29-15.24.05:539][148]LogWindows: Error: [Callstack] 0x0000000094525CA3 UE4Editor-CoreUObject.dll!UObject::ProcessEvent() [c:\unrealengine-flex-4.19.2\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:1345]
[2018.09.29-15.24.05:539][148]LogWindows: Error: [Callstack] 0x00000000818818FC UE4Editor-Engine.dll!AActor::ProcessEvent() [c:\unrealengine-flex-4.19.2\engine\source\runtime\engine\private\actor.cpp:687]
[2018.09.29-15.24.05:539][148]LogWindows: Error: [Callstack] 0x0000000081841CCC UE4Editor-Engine.dll!AActor::BeginPlay() [c:\unrealengine-flex-4.19.2\engine\source\runtime\engine\private\actor.cpp:3140]
[2018.09.29-15.24.05:539][148]LogWindows: Error: [Callstack] 0x000000008184EC7A UE4Editor-Engine.dll!AActor::DispatchBeginPlay() [c:\unrealengine-flex-4.19.2\engine\source\runtime\engine\private\actor.cpp:3107]
[2018.09.29-15.24.05:539][148]LogWindows: Error: [Callstack] 0x0000000082B5BBE5 UE4Editor-Engine.dll!AWorldSettings::NotifyBeginPlay() [c:\unrealengine-flex-4.19.2\engine\source\runtime\engine\private\worldsettings.cpp:189]
[2018.09.29-15.24.05:539][148]LogWindows: Error: [Callstack] 0x0000000081FFA9E5 UE4Editor-Engine.dll!AGameMode::HandleMatchHasStarted() [c:\unrealengine-flex-4.19.2\engine\source\runtime\engine\private\gamemode.cpp:234]
[2018.09.29-15.24.05:539][148]LogWindows: Error: [Callstack] 0x0000000082017713 UE4Editor-Engine.dll!AGameMode::SetMatchState() [c:\unrealengine-flex-4.19.2\engine\source\runtime\engine\private\gamemode.cpp:350]
[2018.09.29-15.24.05:539][148]LogWindows: Error: [Callstack] 0x000000008201D613 UE4Editor-Engine.dll!AGameMode::StartMatch() [c:\unrealengine-flex-4.19.2\engine\source\runtime\engine\private\gamemode.cpp:211]
[2018.09.29-15.24.05:539][148]LogWindows: Error: [Callstack] 0x0000000082B44C7E UE4Editor-Engine.dll!UWorld::BeginPlay() [c:\unrealengine-flex-4.19.2\engine\source\runtime\engine\private\world.cpp:3536]
[2018.09.29-15.24.05:539][148]LogWindows: Error: [Callstack] 0x000000008201E007 UE4Editor-Engine.dll!UGameInstance::StartPlayInEditorGameInstance() [c:\unrealengine-flex-4.19.2\engine\source\runtime\engine\private\gameinstance.cpp:355]
[2018.09.29-15.24.05:539][148]LogWindows: Error: [Callstack] 0x00000000880FA73B UE4Editor-UnrealEd.dll!UEditorEngine::CreatePIEGameInstance() [c:\unrealengine-flex-4.19.2\engine\source\editor\unrealed\private\playlevel.cpp:3274]
[2018.09.29-15.24.05:539][148]LogWindows: Error: [Callstack] 0x000000008811D42E UE4Editor-UnrealEd.dll!UEditorEngine::PlayInEditor() [c:\unrealengine-flex-4.19.2\engine\source\editor\unrealed\private\playlevel.cpp:2410]
[2018.09.29-15.24.05:539][148]LogWindows: Error: [Callstack] 0x000000008813A15F UE4Editor-UnrealEd.dll!UEditorEngine::StartQueuedPlayMapRequest() [c:\unrealengine-flex-4.19.2\engine\source\editor\unrealed\private\playlevel.cpp:1271]
[2018.09.29-15.24.05:539][148]LogWindows: Error: [Callstack] 0x0000000087B9AD6B UE4Editor-UnrealEd.dll!UEditorEngine::Tick() [c:\unrealengine-flex-4.19.2\engine\source\editor\unrealed\private\editorengine.cpp:1590]
[2018.09.29-15.24.05:539][148]LogWindows: Error: [Callstack] 0x000000008845DCD6 UE4Editor-UnrealEd.dll!UUnrealEdEngine::Tick() [c:\unrealengine-flex-4.19.2\engine\source\editor\unrealed\private\unrealedengine.cpp:401]
[2018.09.29-15.24.05:539][148]LogWindows: Error: [Callstack] 0x00000000EAF65E8D UE4Editor.exe!FEngineLoop::Tick() [c:\unrealengine-flex-4.19.2\engine\source\runtime\launch\private\launchengineloop.cpp:3345]
[2018.09.29-15.24.05:539][148]LogWindows: Error: [Callstack] 0x00000000EAF7601C UE4Editor.exe!GuardedMain() [c:\unrealengine-flex-4.19.2\engine\source\runtime\launch\private\launch.cpp:166]
[2018.09.29-15.24.05:539][148]LogWindows: Error: [Callstack] 0x00000000EAF7609A UE4Editor.exe!GuardedMainWrapper() [c:\unrealengine-flex-4.19.2\engine\source\runtime\launch\private\windows\launchwindows.cpp:144]
[2018.09.29-15.24.05:539][148]LogWindows: Error: [Callstack] 0x00000000EAF8405C UE4Editor.exe!WinMain() [c:\unrealengine-flex-4.19.2\engine\source\runtime\launch\private\windows\launchwindows.cpp:223]
[2018.09.29-15.24.05:539][148]LogWindows: Error: [Callstack] 0x00000000EAF85CCA UE4Editor.exe!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:283]
[2018.09.29-15.24.05:539][148]LogWindows: Error: [Callstack] 0x00000000D89C3034 KERNEL32.DLL!UnknownFunction ]
[2018.09.29-15.24.05:539][148]LogWindows: Error: [Callstack] 0x00000000DB511461 ntdll.dll!UnknownFunction ]
[2018.09.29-15.24.05:539][148]LogWindows: Error: [Callstack] 0x00000000DB511461 ntdll.dll!UnknownFunction ]
[2018.09.29-15.24.05:539][148]LogWindows: Error:
[2018.09.29-15.24.05:549][148]LogExit: Executing StaticShutdownAfterError
[2018.09.29-15.24.05:554][148]LogWindows: FPlatformMisc::RequestExit(1)
[2018.09.29-15.24.05:554][148]Log file closed, 09/29/18 16:24:05

@bishop86 I had a look but I do not have enough understanding of how all this stuff works.


  
...
             // Lets copy the adjacency information too for tessellation 
                // At this point all vertices should be copied so it should work to just copy/convert the indices.
                if (LOD.bHasAdjacencyInfo && LOD.AdjacencyIndexBuffer.GetNumIndices() > 0)
                {
                    FIndexArrayView AdjacencyIndices = LOD.AdjacencyIndexBuffer.GetArrayView();

                    // We multiply these by 4 as the adjacency data is 12 indices per triangle instead of the normal 3
                    uint32 StartIndex = Section.FirstIndex * 4;
                    uint32 NumIndices = Section.NumTriangles * 3 * 4;

                    for (uint32 Index = 0; Index < NumIndices; Index++)
                    {
                        AdjacencyIndexCreator(**MeshToSectionVertMap[AdjacencyIndices[Index]]**);
                    }
                }
...


The crash happens when trying to access MeshToSectionVertMap with a value that is not present within the map. If you don’t need Tessellation, your best bet is to somehow prevent the mesh to have adjacency information. What ever that means.

OK thanks for looking :slight_smile:

Could it be because I’m trying to copy a static mesh that was converted from a skeletal mesh with ‘make static mesh’ in the editor? Not sure if this could have something to do with it.

It works fine with procedural mesh comp. I’ll have a look at the RMC code.

You can try exporting and reimporting the static mesh. Maybe that solves it. I think there is a checkbox on import for adjacency info.

Wow it worked!! Thanks so much :slight_smile:

Glad I could help. Enjoy!

I’m having a problem getting overlap events to work with the runtime mesh component, they work with any static mesh, but not with the runtime mesh, is there a way to make it work in blueprints, or is this just not implemented?

they work. There are some checkboxes in the component that need to be adjusted correctly I gues.

Oh, okay, thanks then, appreciated.

Version: 4.20
I followed the instructions here: https://github.com//RuntimeMeshComponent/wiki/Installing-the-RMC-from-GitHub
Added the four dependencies as shown here: https://github.com//RuntimeMeshComponent/wiki/Making-the-RMC-available-to-your-project-in-CPP
And still, “Cannot open include file: ‘RuntimeMeshCore.generated.h’ No such file or directory”?
I put my plugin files to the plugin folder in ue4, along with other plugins

Update:
I tried reinstalling, deleting binaries and intermediate files, etc., updating the target.cs of the editor files in RuntimeMeshComponent, still doesn’t work, as the error below persists:

Severity Code Description Project File Line Suppression State
Error LNK1181 cannot open input file ‘C:\Program Files\Epic Games\UE_4.20\Engine\Plugins\RuntimeMeshComponent-master\RuntimeMeshComponent-master\Intermediate\Build\Win64\UE4Editor\Development\RuntimeMeshComponent\UE4Editor-RuntimeMeshComponent.lib’ DungeonOfTimePaul C:\Users\Desktop\Unreal ■■■■■\DungeonOfTimePaul\Intermediate\ProjectFiles\LINK 1

do you manually include the generated.h file in the files where you use the plugin?

This is probably due to the changes to Plugin include paths in 4.20/4.21.

In your [Project Directory]\Plugins\RuntimeMeshComponent\Source\RuntimeMeshComponent\RuntimeMeshComponent.Build.cs file, comment out the PublicIncludePaths and PrivateIncludePaths lines and replace them with the new ModuleDirectory-relative paths like so:

// PublicIncludePaths.AddRange(
// new string] {
// “RuntimeMeshComponent/Public”
// // … add public include paths required here …
//}
// );
PublicIncludePaths.Add(Path.Combine(ModuleDirectory, “Public”));

// PrivateIncludePaths.AddRange(
// new string] {
// “RuntimeMeshComponent/Private”,
// // … add other private include paths required here …
//}
// );
PrivateIncludePaths.Add(Path.Combine(ModuleDirectory, “Private”));

Do the same in RuntimeMeshComponentEditor\RuntimeMeshComponentEditor.Build.cs

This should probably cover it for 4.20. For 4.21 you will need to take the “#if ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION < 21” line in RuntimeMeshComponent.cpp and move it from above GetPhysicsTriMeshData() to above CreateNewBodySetup()

I have no idea whether this has any impact on physics in an actual shipping build, but it will get your project compiled and running a Development Editor build for the time being.

Edit: quick update - tried packaging a shipping Win64 build of the default map to which I added a runtime MeshSlicer BP. Works great; slices respond to player and projectile physics as expected.

Thanks for the tip about moving the #if Ryvar, I was pretty stuck for a moment there…