Description

Using GeoMerge on fragments of a GeometryCollection (GC) will create a new single particle while removing the old particles, but although you end up with less particles, the disk file size of the GC uasset increases. If we repeat the process of breaking a GC and applying GeoMerge to reduce the number of particles, the sizes keep increasing indefinitely.

The licensee suggested an engine change on UFractureToolMergeSelected::Execute in FractureToolEditing.cpp. During the call to MergeAllSelectedBones, the flag bBooleanUnion is set to false. I've recompiled to engine with that boolean set to true (constexpr bool bBooleanUnion = true; ) and the size change is significant, although it still looks like there's some accumulation happening.

I've compiled some data to illustrate with both bBooleanUnion options. This is the file size after each operation, repeated in sequence:
The default: bBooleanUnion = false
Initial size of the GC uasset: 23KB

Applying Uniform 1: 208KB
Applying GeoMerge 1: 154KB
Applying Uniform 2: 1,311MB
Applying GeoMerge 2: 1,187MB
Applying Uniform 3: 6,079MB
Applying GeoMerge 3: 5,757MB
Applying Uniform 4: 21,829MB
Applying GeoMerge 4: 21,011MB

Changed the boolean: bBooleanUnion = true
Initial size of the GC uasset: 23KB

Applying Uniform 1: 222KB
Applying GeoMerge 1: 92KB
Applying Uniform 2: 392KB
Applying GeoMerge 2: 243KB
Applying Uniform 3: 662KB
Applying GeoMerge 3: 493KB
Applying Uniform 4: 1081KB
Applying GeoMerge 4: 895KB

The difference is plain to see.

Steps to Reproduce

On an empty project with an empty scene, create a cube.
Go to Fracture mode and Generate a New Geometry Collection Asset, save it - check the file size
Fracture using Uniform or similar methods, save and check the file size
Select the particles and GeoMerge them: you end up with a single particle. Save and check the file size, it's similar to the size after fracture, no reduction took place.
Fracture the merged particles again, save and check file size
Repeating this process will increase the sizes indefinitely.
Expected behavior: using Geomerge selecting all the particles would reduce the file size to the size of a non-fractured cube
Actual behavior: although you end up with a single particle, the file size is as if all particles were still present

Callstack

Non-fatal, callstack is for observed behavior:

> UnrealEditor-FractureEditor.dll!UFractureToolMergeSelected::Execute(TWeakPtr<FFractureEditorModeToolkit,1> InToolkit) Line 150 C++
UnrealEditor-FractureEditor.dll!FFractureEditorModeToolkit::ExecuteAction(UFractureActionTool * InActionTool) Line 1521 C++
[Inline Frame] UnrealEditor-FractureEditor.dll!Invoke(void(FFractureEditorModeToolkit::*)(UFractureActionTool *)) Line 66 C++
[Inline Frame] UnrealEditor-FractureEditor.dll!UE::Core::Private::Tuple::TTupleBase<TIntegerSequence<unsigned int,0>,UFractureActionTool >::ApplyAfter(void(FFractureEditorModeToolkit::)(UFractureActionTool *) &) Line 309 C++
UnrealEditor-FractureEditor.dll!TBaseSPMethodDelegateInstance<0,FFractureEditorModeToolkit,1,void __cdecl(void),FDefaultDelegateUserPolicy,UFractureActionTool *>::ExecuteIfSafe() Line 298 C++
[Inline Frame] UnrealEditor-Slate.dll!TDelegate<void __cdecl(void),FDefaultDelegateUserPolicy>::ExecuteIfBound() Line 570 C++
UnrealEditor-Slate.dll!FUIAction::Execute() Line 139 C++
UnrealEditor-Slate.dll!FUICommandList::ExecuteAction(const TSharedRef<FUICommandInfo const ,1> InUICommandInfo) Line 117 C++
UnrealEditor-Slate.dll!SToolBarButtonBlock::OnClicked() Line 446 C++
[Inline Frame] UnrealEditor-Slate.dll!Invoke(FReply(SToolBarButtonBlock::*)()) Line 66 C++
[Inline Frame] UnrealEditor-Slate.dll!UE::Core::Private::Tuple::TTupleBase<TIntegerSequence<unsigned int>>::ApplyAfter(FReply(SToolBarButtonBlock::*)() &) Line 309 C++
UnrealEditor-Slate.dll!TBaseSPMethodDelegateInstance<0,SToolBarButtonBlock,1,FReply __cdecl(void),FDefaultDelegateUserPolicy>::Execute() Line 281 C++
[Inline Frame] UnrealEditor-Slate.dll!TDelegate<FReply __cdecl(void),FDefaultDelegateUserPolicy>::Execute() Line 549 C++
UnrealEditor-Slate.dll!SButton::ExecuteOnClick() Line 465 C++
UnrealEditor-Slate.dll!SButton::OnMouseButtonUp(const FGeometry & MyGeometry, const FPointerEvent & MouseEvent) Line 390 C++
[Inline Frame] UnrealEditor-Slate.dll!FSlateApplication::RoutePointerUpEvent::__l8::<lambda_2>::operator()(const FArrangedWidget &) Line 5293 C++
UnrealEditor-Slate.dll!FEventRouter::Route<FReply,FEventRouter::FToLeafmostPolicy,FPointerEvent,`FSlateApplication::RoutePointerUpEvent'::`8'::<lambda_2>>(FSlateApplication * ThisApplication, FEventRouter::FToLeafmostPolicy RoutingPolicy, FPointerEvent EventCopy, const FSlateApplication::RoutePointerUpEvent::__l8::<lambda_2> & Lambda, ESlateDebuggingInputEvent DebuggingInputEvent) Line 442 C++
UnrealEditor-Slate.dll!FSlateApplication::RoutePointerUpEvent(const FWidgetPath & WidgetsUnderPointer, const FPointerEvent & PointerEvent) Line 5279 C++
UnrealEditor-Slate.dll!FSlateApplication::ProcessMouseButtonUpEvent(const FPointerEvent & MouseEvent) Line 5857 C++
UnrealEditor-Slate.dll!FSlateApplication::OnMouseUp(const EMouseButtons::Type Button, const UE::Math::TVector2<double> CursorPos) Line 5813 C++
UnrealEditor-ApplicationCore.dll!FWindowsApplication::ProcessDeferredMessage(const FDeferredWindowsMessage & DeferredMessage) Line 2243 C++
UnrealEditor-ApplicationCore.dll!FWindowsApplication::DeferMessage(TSharedPtr<FWindowsWindow,1> & NativeWindow, HWND__ * InHWnd, unsigned int InMessage, unsigned __int64 InWParam, __int64 InLParam, int MouseX, int MouseY, unsigned int RawInputFlags) Line 2750 C++
UnrealEditor-ApplicationCore.dll!FWindowsApplication::ProcessMessage(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) Line 1919 C++
[Inline Frame] UnrealEditor-ApplicationCore.dll!WindowsApplication_WndProc(HWND__ *) Line 923 C++
UnrealEditor-ApplicationCore.dll!FWindowsApplication::AppWndProc(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) Line 929 C++
[External Code]
[Inline Frame] UnrealEditor-ApplicationCore.dll!WinPumpMessages() Line 116 C++
UnrealEditor-ApplicationCore.dll!FWindowsPlatformApplicationMisc::PumpMessages(bool bFromMainLoop) Line 145 C++
UnrealEditor.exe!FEngineLoop::Tick() Line 5850 C++
[Inline Frame] UnrealEditor.exe!EngineTick() Line 61 C++
UnrealEditor.exe!GuardedMain(const wchar_t * CmdLine) Line 180 C++
UnrealEditor.exe!LaunchWindowsStartup(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow, const wchar_t * CmdLine) Line 247 C++
UnrealEditor.exe!WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * pCmdLine, int nCmdShow) Line 298 C++
[External Code]

Have Comments or More Details?

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

0
Login to Vote

Unresolved
ComponentUE - Simulation - Physics - Destruction
Affects Versions5.4.4
Target Fix5.6
CreatedNov 26, 2024
UpdatedDec 4, 2024
View Jira Issue