Description

geometry script "Append Simple Swept Polygon" crashes if called w/ an empty path (but non-empty cross section polygon)

Steps to Reproduce
  1. Make sure the Geometry Script plugin is enabled in your project
  2. Create a new Generated Dynamic Mesh blueprint class asset, and place it in the level
  3. Edit the blueprint: In the Event Graph, drag off the Target Mesh pin on "Event On Rebuild Generated Mesh" and create a "Append Simple Swept Polygon" function.  Drag off the "Polygon Vertices" pin, promote that to a variable, and add at least three vertices to that variable.  Drag off the "Sweep Path" pin, promote that to a variable, but leave that array empty.
  4. Compile the blueprint and let it run

Result: Crash
Expected result: Does not create any geometry and puts a message in the log explaining that it didn't have enough vertices in the Sweep Path

Callstack

[Inline Frame] UnrealEditor-GeometryScriptingCore.dll!TArray<UE::Math::TVector<double>,TSizedDefaultAllocator<32>>::RangeCheck(int Index) Line 691[Inline Frame] UnrealEditor-GeometryScriptingCore.dll!TArray<UE::Math::TVector<double>,TSizedDefaultAllocator<32>>::RangeCheck(int Index) Line 691 at E:\code\UE5_Release-5.0\Engine\Source\Runtime\Core\Public\Containers\Array.h(691)[Inline Frame] UnrealEditor-GeometryScriptingCore.dll!TArray<UE::Math::TVector<double>,TSizedDefaultAllocator<32>>::operator[](int) Line 746 at E:\code\UE5_Release-5.0\Engine\Source\Runtime\Core\Public\Containers\Array.h(746)UnrealEditor-GeometryScriptingCore.dll!UGeometryScriptLibrary_MeshPrimitiveFunctions::AppendSimpleSweptPolygon(UDynamicMesh * TargetMesh, FGeometryScriptPrimitiveOptions PrimitiveOptions, UE::Math::TTransform<double> Transform, const TArray<UE::Math::TVector2<double>,TSizedDefaultAllocator<32>> & PolygonVertices, const TArray<UE::Math::TVector<double>,TSizedDefaultAllocator<32>> & SweepPath, bool bLoop, bool bCapped, float StartScale, float EndScale, UGeometryScriptDebug * Debug) Line 637 at E:\code\UE5_Release-5.0\Engine\Plugins\Experimental\GeometryScripting\Source\GeometryScriptingCore\Private\MeshPrimitiveFunctions.cpp(637)UnrealEditor-GeometryScriptingCore.dll!UGeometryScriptLibrary_MeshPrimitiveFunctions::execAppendSimpleSweptPolygon(UObject * Context, FFrame & Stack, void * const Z_Param_Result) Line 590 at E:\code\UE5_Release-5.0\Engine\Plugins\Experimental\GeometryScripting\Intermediate\Build\Win64\UnrealEditor\Inc\GeometryScriptingCore\MeshPrimitiveFunctions.gen.cpp(590)UnrealEditor-CoreUObject.dll!UObject::execCallMathFunction(UObject * Context, FFrame & Stack, void * const Z_ParamResult) Line 945 at E:\code\UE5_Release-5.0\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp(945)[Inline Frame] UnrealEditor-CoreUObject.dll!FFrame::Step(UObject *) Line 422 at E:\code\UE5_Release-5.0\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp(422)UnrealEditor-CoreUObject.dll!UObject::execLetObj(UObject * Context, FFrame & Stack, void * const Z_ParamResult) Line 2692 at E:\code\UE5_Release-5.0\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp(2692)[Inline Frame] UnrealEditor-CoreUObject.dll!FFrame::Step(UObject *) Line 422 at E:\code\UE5_Release-{{monospaced text}}5.0\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp(422)UnrealEditor-CoreUObject.dll!ProcessLocalScriptFunction(UObject * Context, FFrame & Stack, void * const Z_Param_Result) Line 1082 at E:\code\UE5_Release-5.0\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp(1082)

Have Comments or More Details?

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

0
Login to Vote

Fixed
ComponentUE - LD & Modeling - Modeling Tools
Affects Versions5.0
Target Fix5.0.2
Fix Commit19928648
Main Commit19932806
Release Commit19928648
CreatedApr 26, 2022
ResolvedApr 27, 2022
UpdatedJan 25, 2023