Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem adding control point after another control point via script
#3
(02-11-2014, 11:21 AM)'Jake' Wrote: If you want to add to the end, just use CurvySpline.Add() and the segment should be added normally (that's what the editor is doing). Did you try calling MeshBuilder.Refresh() after creating the new CP?


 
Thanks for the response. I'm sorry to say that the answer is no, this doesn't work. As I said before, that just makes another CP000, and messes up my curve (not just the mesh). As a bonus problem, it starts throwing errors when I try to do the following:



Code:
spline.ControlPoints[1].transform.position = transform.position;

it says:

ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index


Now, this error does NOT occur if I refrain from adding a point, but once I add a point (which again it names CP000, meaning the points in the curve are now CP000, CP001 and CP000 ) it starts thinking control point 1 is null.  I thought maybe I got the curve into a weird state, but I recreated the curve from scratch only to find the same result. I don't know if this is too much to go through, but the project is small and I can zip it up pretty easily if you want to check it out.

 
Reply


Messages In This Thread

Possibly Related Threads…
Thread Author Replies Views Last Post
  Control Point Interpolation Overrides. rickgplus 1 525 12-11-2025, 08:52 AM
Last Post: _Aka_
  12_Train junction point richardzzzarnold 5 3,408 04-16-2025, 02:19 PM
Last Post: _Aka_
  OnAfterControlPointAdded - Control Point is null jh092 5 3,177 02-04-2025, 09:31 PM
Last Post: _Aka_
Photo Volume Spots problem with spacing Bond007 3 2,543 01-20-2025, 12:27 PM
Last Post: _Aka_

Forum Jump: