How to Update Spline Mesh from C++

anonymous_user_bbbefa12
Fri, 26 Feb 2016 16:07:30 +0000
C++

Hello,

I am working with splines from a C++ plugin to modify splines with some automation. Everything so far works fine with SplineComponent. However, the same cannot be said for SplineMeshComponent in updating geometry based on a spline modification.

Given a reference to a SplineMeshComponent in C++ code, what methods need to be called (from it or other objects) to trigger an update to the mesh so that it conforms to the updated spline shape?

The spline mesh actor that I use in the editor is created from a simple blueprint construct script, where it adds a SplineMeshComponent per spline segment. The resulting blueprint works fine, and updates as expected when tweaked visually in the editor. Just to be clear, the issue is not with this blueprint or its construction, but rather how to modify it after construction in editor mode from C++ code. The code cannot make assumptions of how a spline mesh is constructed.

The mesh will update if I move or rotate the related actor in the main editor view. I have called various Mark…Dirty methods, but those do not help. I have also looked at other code in the engine that use such a component, but mostly I am finding calls to MarkRenderStateDirty which has not worked for me. Hopefully an engine guru can point me to or provide a code snippet that will update the component properly.

Thank you for any assistance.

3 posts - 1 participant