Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Curvy Coppy all points of a Spline Into Another
#1
Hello again

My situation is:
I have 2 spline:
 - a Spline for the road, which contain a mesh
 - a Spline for the path of the player, path who will be invisible
[Image: IEkjccobkje_1.PNG]

My goal is: when pressing a button in inspector: Setup the Spline of the player for matching exactly the CPs position, rotation and copy also all the CurvySplineSegment.
Why: When I am changing the road: position, adding / deleting points, rotation if I want to have looping etc... Then I have to change every point of the player spline too...

So, I want to have the same amout of point (CP00X) in both the spline player & road
I want to set the transform of each CP00X of the splinePlayer to the road CP.
and i want to copy the Curvy Spline Segment of all the CP of the road to the player path

I have tryed to to the hard way (doing my own stuff, creating object, setting a new CurvySplineSegment and assigning the value etc...)
But I get hard problems then, with the spline cache and pooling and other stuff.

So I would like to know if you have a "good" method for dupplicating a Spline

No need to write me all the code for doing that, just some basics methods maybe, I will work my way around then.

Thanks !
Reply
#2
Hi,
Since this is for editor use, I will suggest you a solution that is not the most optimized, but the quickest to implement: use the Import/Export feature of Curvy
https://curvyeditor.com/documentation/import_export
Export your road spline, clear your player spline, then import the exported spline into the player spline. As most, if not all, UI operations, the equivalent tasks can be done though the API. Take a look at the FluffyUnderware.Curvy.ImportExport namespace as a starting point.
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply
#3
Ok thanks ! 2 more question If I may:

1) How to add programmaticly a point on an existing curve ? (adding at the end, or between 2 points)
2) If I have an array of Vector3, How can I create a Spline from code with the data of the array ?

Thanks again
Reply
#4
See the Add methods, and InsertBefore/InsertAfterMethods of CurvySpline
https://api.curvyeditor.com/520/class_fl...pline.html
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
  Disable a spline's gizmo when not selected or disabled. mikechr2000 1 141 02-03-2025, 09:34 AM
Last Post: _Aka_
Information Questions regarding spline colliders and collisions with rigidbodies Spyboticer 7 515 01-20-2025, 12:25 PM
Last Post: _Aka_
  Extrude mesh along spline. New and confused user GhostStalker 3 215 01-02-2025, 09:58 AM
Last Post: _Aka_
  Newly created spline is invisible quickytools 7 503 12-21-2024, 10:14 AM
Last Post: _Aka_

Forum Jump: