Expose Spline Points as a variable?

Hello, is there any way we can expose the Spline Points as a variable in a Blueprint?

  1. There seem to be a unique “Input Key” integer value for every Spline Point. I’m wondering if the Spline Point (Input Key) can be exposed as a variable so the spline can be animated in sequencer.

If we can expose the Spline Point (Input Key) in a blueprint variable, we can expose the Variables to Sequencer.

I think you could create a struct where you put the position and the tangent of the point, and then use an array of structs as variable

Hello, may I ask how we can grab the " position and the tangent of the point " so we can put them in a struct? Thank you for the suggestion.

Things I've tried, feel free to skip

The engine already has a struct called “Spline Point” that has all the requirements needed to create a spline point, but it can’t be exposed to cinematics, I also tried creating an identical struct but it has the same issue:

image

The only decent way to expose something to cinematic I was able to find is the following:

  • Create a variable of type “array of vectors” and expose it to cinematics, show 3D widget is useful to control them from the map

  • Displaying the 3D widgets will allow you to drag the points in the world editor:

  • Create a function to create a spline between these points (In this case I called it in the constructor)

  • If you want to set tangents you can create other arrays of vectors and also use 3D widgets to drag them, but this can get quite messy very easily:

2 Likes

Hello Ares9323, may I ask a question? Did I do something wrong? I do not see the spline in the level after I set up the Event Graph.

You mentioned constructing the spline in the “constructor,” could the spline be constructed in the Construction Graph?

Yes, you have to call “Init spline” in the event construct, and in the timeline every time you need to update the spline

Thank you, I can see the spline in the View port.


image

1 Like

May I ask another question? How were you able to attach the tangents to the Spline Points in the view port? Did I do something wrong?

This is my Event Script.

I see the Arrive Tangent and the Leave Tangent in the detail panel. But they are not attached to the individual spline points?

They are visible
image
image

O I see it now, I had to scroll down the details panel.
image

I think I did something wrong after I added the tangents, I now have two splines.

How did you get a single spline after creating the tangents?
My tangents seems to have created a second spline (Image in the previous post). I like how your tangents augment a single spline like your image below.
image

You are using two foreach nodes, you just have to use one and use the index to get values from the tangent arrays

1 Like

Thank you, I’m learning. I have a single spline, now.

If you have time, may I ask another question? My “Arrive” and “Leave” tangents seem to be out of alignment with the spline point. That is to say the spline does not follow the tangent. Have I done something wrong.


I would like to say thank you for all your help. I appreciate everything you have helped me with.

1 Like

I would not use 3D widgets on the tangents, because they return values relatives to the center of the actor, it’s a bit tedious but I’d rather tweak them manually from the details panel.

You are welcome, I am always curious and I like learning new things, I wanted to understand why it was not possible to expose a spline to cinematics and I suggested the first idea that popped up in my mind.
Feel free to ask, I’d be happy to help you if I can (I’m literally here everyday, today is my 365th consecutive day on the forum so I’m living it like a birthday :rofl:)

1 Like

365 consecutive day :smiley:
If I use the Detail panel to move the widget, the curve is still not aligned to the tangent.

Maybe the tangent needs a pole vector or something to help align the spline?

Or, maybe there is a way to create a Bezier handles for the spline point?

This spline creation has Bezier handles, but I cannot make the spline points available to Sequencer.

Have you tried increasing the value to something bigger?
Another approach could be using an array of transforms instead of the vectors and using the rotators and scale to calculate the tangents, but that would require some reasoning!

Yes, making bigger values just pushes the spline further away from the tangent. For some reason the spline is moving in the opposite direction from the tangent.

Do you think there is a way to expose this type of spline set up to the sequencer?

The Spline Points have an “Input Key.” And the Input Key has a unique value to distinguish them from other spine points on the spline. Is there was a way to use these to expose them in sequencer as vector variables?