Download

Procedural mesh component slicing right after creating

Hi. I use procedural mesh component to slice some things. And it all works withouy any issues. Except for one. But it’s not really any bug or anything I believe.
I need to slice object right after spawning it. Basically I spawn actor with procedural mesh component, and OnConstruction I copy procedural mesh from static mesh. In the same frame I SliceProceduralMesh. But at this point it doesn’t slice it at all. I believe that mesh needs some time to be initialized/created. If I set up delay of let’s say 0.1s it slices properly. So what I am looking for is some method or flag or something like that to be able to confirm that mesh is ready and can be sliced. It is hard to debug it, because slicing mesh function is just a bunch of for loops, that iterate through vertices etc. And yeah, when slice isn’t applied, loops are usually waaay shorter than when it’s used with delay. I dont really want to check number of verts for each mesh I wanna slice, and then check if copied procedural mesh matches it to determine whether it’s ready. So. Any ideas ?