x

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"

Spline mesh and loops

No amount of spline point rotation will make a spline mesh rotate properly (upside down) in a loop. I am setting the spline mesh component's start and end tangent in its BP construction script.

Plane:

alt text

Cube:

alt text

Blueprint:

alt text

Product Version: Not Selected
Tags:
more ▼

asked Sep 12 '14 at 01:36 AM in Bug Reports

avatar image

OhiraKyou
306 21 43 53

avatar image TJ V ♦♦ STAFF Sep 12 '14 at 08:06 PM

Hi OhiraKyou,

Could you also post some screenshots of the Details panel for the Spline Mesh component so we can see how you are calculating the loop?

avatar image OhiraKyou Sep 12 '14 at 10:23 PM

I've attached my BP to the main post. After the construction script is done, it's simply a matter of placing points in a loop shape. Points refuse to turn upside down, even while rotating them. Everything works pretty well when the track never goes upside down, but loops and twists are absolutely vital.

Here's another, simple example:

alt text

avatar image TJ V ♦♦ STAFF Sep 15 '14 at 05:19 PM

Hi OhiraKyou,

Thank you for the feedback. I was able to reproduce the issue and have entered TTP# 346554 into our tracking software. Our developers will be looking into the issue.

I don't have a workaround at the moment. As soon as I hear back on the TTP we will post back here.

Thanks, TJ

avatar image Furroy Jan 07 '15 at 02:10 AM

I think this is a limitation of UE4 for now, that I am also stuck on. Check out the comments left by sds-michael in this forum thread, he had to fix some C++ in the engine:

https://forums.unrealengine.com/showthread.php?20194-TUTORIAL-Create-a-procedural-spline-road-tool-in-blueprints-4-part-video-series

(comments are locked)
10|2000 characters needed characters left

3 answers: sort voted first

It's a bit of a hack job, but I was able to get loops acting correctly with a bit of math.

From the Get World Direction at Distance Along Spline node, simply Rotate Vector Around Axis. In my case (building a road along a spline), I rotated -90 degrees along the Y axis, then set the resulting value as the Up Dir for the Spline Mesh before doing any other calculations. This ensures that the up vector for any spline mesh along this spline is basically its "normal".

Here's a picture of my sloppy blueprint code. The essentials are highlighted.

alt text

And here are a few pictures of the track in the editor. The red lines are debug draws of the up vectors for each spline mesh (with a length of 200).

alt text alt text

Hope this helps!

ue4spline.png (204.8 kB)
ue4track1.png (621.3 kB)
ue4track2.png (597.8 kB)
more ▼

answered Apr 13 '15 at 08:50 PM

avatar image

iwhitt
66 2 3 5

avatar image Monokkel Jun 06 '16 at 11:23 AM

I'm unable to replicate your results in UE4.12. I'm uncertain if this is because I am missing something or if it is because UE4 now handles spline meshes a bit differently. This thread is a year old and has been marked as solved so I have opened a new thread here. I'm curious if you are able to replicate your own results in 4.12. If this is too much to ask I wonder if you can tell me what two additional nodes the output from your "Add spline mesh component" are connected too.

avatar image Andrei Branescu Dec 06 '16 at 09:18 PM

Thanks for this tip! It works for this case, but if you bend back and forth the same mesh, it does't work anymore, as the mesh has only one Up Direction. Isn't this a bug?

avatar image AyanMiru Jan 08 '18 at 07:29 AM

Had a setup with spline that updates with cable component particles. Used this solution to fix that nasty twisting. Thank you!

(comments are locked)
10|2000 characters needed characters left

I think you need to play with the 'SplineUpDir' parameter. This has to be a direction which the curve will never be parallel to, that the X axis of the mesh will be oriented towards.

more ▼

answered Sep 16 '14 at 01:11 PM

avatar image

JamesG STAFF
1.3k 8 6 32

avatar image OhiraKyou Sep 16 '14 at 05:59 PM

My tracks curve in every direction ever.

avatar image mdsf Mar 10 '15 at 02:20 AM

Hey, I have been trying to make a vertical loop and am not sure how "get spline up dir" helps. I've tried multiple times adjusting yaw, roll, up direction. Could you please elaborate on the solution? alt text

badspline.png (88.5 kB)
avatar image TJ V ♦♦ STAFF Mar 10 '15 at 04:59 PM

Hi mdsf,

The values for the Spline Up Dir generally needs to be experimented with until you get the effect you want. If you're willing to create a small test project with just the mesh and spline making the loop that you want, I'm happy to help you find the solution.

avatar image mdsf Mar 13 '15 at 10:03 PM

Thanks for the quick response TJ,

I will create a test project and experiment and get back with what I find. Thanks again

avatar image JamesG STAFF Mar 12 '15 at 09:38 AM

The main thing is to find some direction that the curve will never be parallel to - that is what you said as the 'up dir'. The system right now needs some 'fixed' direction that it will point the 'up' vector towards.

avatar image Allar Mar 12 '15 at 09:40 AM

Any plans on being able to change the up vector along the spline path? I know this isn't exactly a trivial thing to do.

avatar image JamesG STAFF Mar 12 '15 at 10:20 AM

You can change the up direction per component, but that will probably cause a discontinuity. It would be a bit expensive to interpolate up vectors I'm afraid :(

avatar image mdsf Mar 13 '15 at 10:04 PM

That sounds like a good rule of thumb, I'll see how I can apply it to my project and get back to you.

avatar image TJ V ♦♦ STAFF Mar 20 '15 at 03:17 PM

Hi mdsf,

I just wanted to check up with you. Did you get this working correctly in your project?

(comments are locked)
10|2000 characters needed characters left

I know this is an old post but my plugin is specifically designed to address this issue.

https://www.unrealengine.com/marketplace/spline-twist-correct

alt text

It offsets a second spline so that even when the spline is subdivided you won't get any twisting.

more ▼

answered May 25 '18 at 07:53 PM

avatar image

RyanGadz
93 2 9 15

(comments are locked)
10|2000 characters needed characters left
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