When creating a new mesh section in the ProceduralMeshComponent, all existing sections with higher index are removed
Branch: Binary build from the Unreal Launcher.
Build version: Version: 4.8.1-2591939
Description: When calling the CreateMeshSection function (with the argument "SectionIndex") in the new ProceduralMeshComponent, the section array is resized to "SectionIndex+1". This has the effect, that all existing sections with higher index than "SectionIndex" are deleted. I guess that is not intended.
Action 1: Create new ProceduralMeshComponent
Action 2: Create mesh section with index 1, then create mesh section with index 2
Action 3: Update/create mesh section with index 1 (this will delete section 2)
asked Jul 08 '15 at 08:21 PM in C++ Programming
The issue seems to be that the scope of the arrays is not being considered. When the loop is entered the first time it will create the vertices and faces arrays. Because they only exist inside the loop, each iteration of the loop will recreate both arrays. The arrays are again recreated once the loop exits. Moving the first two lines of the loop to before the loop is called and removing the first two lines after the loop completely should solve the problem.
answered Jul 30 '15 at 03:46 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here