Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How to Update Spline Mesh from C++


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.

Product Version: UE 4.10
more ▼

asked Feb 26 '16 at 04:07 PM in C++ Programming

avatar image

13 3 5 7

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

The only resolution I could find to this problem is a work around which involves calling PostEditMove on the owner actor of the component. No method on the SplineMeshCompnent directly triggers the component's mesh regeneration. This seems like a bug. Hopefully this will help others who stumble across obscure problems in the C++ API such as this.

Happy coding.

more ▼

answered Feb 29 '16 at 11:36 PM

avatar image

13 3 5 7

avatar image KyleTimeFireVr Sep 07 '16 at 08:15 PM

Thank You For this solution seriously. been searching for something like this for a while

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question