Posts: 44
Threads: 16
Joined: Nov 2018
Hi,
So If I've already got a spline with say 3 control points, then I want to connect a 2nd spline to the first but between the 2nd and 3rd control point ( CP0001 & CP0002 )
how could I do that please.
Regards
Posts: 1,984
Threads: 82
Joined: Jun 2017
Hi,
You can connect control points only at control points. So in your case, you will have to create a control point at the desired position and then make the connection at that level.
Did this help?
Also, the Shift and Subdivide tools in the toolbar might help in your task
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.
Posts: 44
Threads: 16
Joined: Nov 2018
Hi. I just wondered if there was a built in way if doing that.
As what i want to achieve will be at runtime what i could do is store the info of each control point then redraw the spline but adding the new connection control point at the appropriate place, ie if between cp 1 and 2 the new control point would become cp0002 then all subsequent control points would be one number higher it'd that makes sense.
Posts: 1,984
Threads: 82
Joined: Jun 2017
Hi,
The Subdivide tool is the built-in way but it will add the new CP halfway in between the existing two CPs.
The Shift tool is the built-in way to move a CP on the spline between its neighboring CPs
Other than this, you will have to use the API to do what you described
Please consider leaving a
review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Posts: 44
Threads: 16
Joined: Nov 2018
Hi again, I've almost achieved what I want to achieve. Hopefully just one more question :
If I want to add a connection to say CP0003 and I've got 7 control points ( so I cant use last visible control point ) how could I do that ?
Cheers
Posts: 1,984
Threads: 82
Joined: Jun 2017
Hi,
You can access the third cp like this
yourSpline.ControlPointsList[3]
CurvyConnection is the class for creating connections
Please consider leaving a
review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Posts: 44
Threads: 16
Joined: Nov 2018
Posts: 1,984
Threads: 82
Joined: Jun 2017
You are welcome
Please consider leaving a
review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Posts: 44
Threads: 16
Joined: Nov 2018
04-08-2020, 10:20 AM
(This post was last modified: 04-08-2020, 10:26 AM by dazz777.)
Sorry for even more questions but this is what I'm doing
( seg is a CurvySplineSegment)
Code:
tempExisting_spline_toJoin.ControlPointsList[4].Connection.AddControlPoints (seg);
The above control point does have a connection, when I run this it doesn't give any errors but also doesn't add the control point to the connection.
EDIT : seg is already part of another connection, could that be the reason it wont become part of the above connection ?
Posts: 1,984
Threads: 82
Joined: Jun 2017
Yes, it is because it is already in a connection. It is the same behaviour as the connect tool in the UI. I should make the method return an error message to make things clear
Please consider leaving a
review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.