Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Working with Connections
#1
Question 
Dear Curvy Team,

2 questions:
1) Is there any simple way to query all connected Splines and all Control Points in a list?

2) How to place a SplineController on a specific absolute position on my connected splines?
e.g. Spline1 Length is 5 m and Spline2 is 10 m --> How to place SplineController on Position 8m which is already on Position 3m of Spline2?

Many thanks for your help!
Reply
#2
Hi

1- You can get all the connections using FindObjectsOfType (a unity method). Then, for each spline, get the yourConnection.ControlPointsList, and for each of the control points, you can get the spline from yourControlPoint.Spline
As a suggestion, using LINQ can help you make requests easily, with few code. Some requests can allocate memory though, so profile them in critical paths: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/linq/

2) Get the tf on the desired spline using yourSpline.GetNearestPointTF. Then set that TF as an input for yourSplineController.RelativePosition

Have a nice day
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply
#3
Thanks for your quick reply!

concerning 1): but if I use a junction? not all splines are used when going in forward direction.
A spline controller is following correctly all connected splines. I my case I want to know all control points that the spline controller will follow in advance.
Reply
#4
Ok, that's a different question then. Before answering it, just to be sure that we are on the same wave: I am interpreting your "junction" as a connection (component name: CurvyConnection). If you mean by junction the example meta data script, called MDJunction (from memory), then you have to specify that to me.

When a controller reaches a connection, the rules defining which splines the controller might switch to are explained here: https://curvyeditor.com/documentation/controllers/start?redirect=1#connections_handling
Using the relevant rules, depending on how you configured your controller, you can know in advance which possible splines will be switched to. You can also define your own custom rules if needed.

I hope this helped
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Procedural Connections Janooba 3 7 10-23-2024, 02:53 PM
Last Post: _Aka_
  Connections doesn't work in split scenes nehvaleem 4 10 05-29-2024, 07:31 AM
Last Post: _Aka_
  Connections Problem Juton 3 17 03-06-2024, 10:41 AM
Last Post: _Aka_
Bug Issues when working with in-place prefabs Sacryn 4 7 02-27-2024, 04:08 PM
Last Post: _Aka_

Forum Jump: