I have already submitted this bug via the bug submission form just now, but to notifying this bug to UE4 users, I report it here.
- Create a new project. (Either BP project or C++ project will do.)
- Make an Actor and add Procedural Mesh Component.
- Make 2 sets of different numbers of vertices and triangles.
vertices1 … 101 vertices, triangles1…100 triangles
vertices2 … 501 vertices, triangles2…500 triangles
Here I made 2 circle meshes like the attached image.
- Create Mesh Section with vertices1 and triangles1.
- Make a function which swaps [vertices1 and triangles1] and [vertices2 and triangles2], like the attached image.
- Play and execute the above function once or several times.
It results in crash with the crash reporter.
It seems that when the both length of vertices1 and vertices2, and the length of triangles1 and triangles2 are the same, the editor does not crash.
And when “Delay” node is inserted between “Create Mesh Section” and “Update Mesh Section”, sometimes the editor does not crash.
So I think “Create Mesh Section” is completed when the memory reallocation for different size of vertices array or triangles array has not been completed.
I am changing the vertex positions of the procedural mesh on every frame (via “Create Mesh Section” of Event Tick), so “Update Mesh Section” is sometimes executed just after the “Create Mesh Section”.
I am so suffering from this bug.