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/...epts/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 will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
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/co...s_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 will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  SplineController slows down approaching connections jh092 5 2,144 08-07-2020, 03:56 PM
Last Post: _Aka_
Information Connections tutorial available _Aka_ 0 813 05-22-2020, 01:46 PM
Last Post: _Aka_
  Refresh spline doesn't seem to be working dazz777 6 4,314 01-22-2020, 12:55 AM
Last Post: _Aka_
  How to find connections dazz777 5 3,444 09-12-2019, 11:08 AM
Last Post: _Aka_

Forum Jump: