Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Change ControlPoint handle seems not updating internal Cache
#1
I use the new Version 2.1.
On change the position of a ControlPoint Handle (Bezier) in EDITOR, it seems the internal cache points (pre calculated Approximation) are not updated. Calculating the all tf/dist on a spline are wrong for the first time. CheckTransForm is True.

A) Is there a command to the force update the internal info/cache/orientation to make the spline also Initialized=true?

B) Further I have another problem to position objects after pressing Stop in Editor.
By pressing Stop then OnValidate() is called to reposition the object to it's original position in my script.
But if OnValidate() is called, none of the splines are Initialized.
Waiting for all splines are initialised doesn't work in OnValidate() for any reason.

Code:
 Void OnValidate() {
   WaitForInitSplines();
   ... resposition any stuff ........
}

IEnumerator WaitForInitSplines() {
     Debug.Log("WaitForInitSplines()");
     allSplinesInitialized = false;
     AllSplines = FindObjectsOfType(typeof(CurvySpline)) as CurvySpline[];
     foreach (var Spline in AllSplines) {
       while (!Spline.IsInitialized) {
          yield return null;
        }
    }
    allSplinesInitialized = true;
}

Is there any solution wait for spilnes are initialized after pressing stop in editor? (Script has not [ExecuteInEditMode])

Thanks
(Henry Ford) Each hour more of searching is each hour less of your live time.

Reply
#2
I will check this next week when I'm back from vacation!
Reply
#3
(06-09-2016, 07:54 PM)Jake Wrote: I will check this next week when I'm back from vacation!

I will make a scene to download.
(Henry Ford) Each hour more of searching is each hour less of your live time.

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  best way to rotate, change offset, and inset position of splinecontroller object smackledorf 1 4 01-17-2022, 01:39 PM
Last Post: _Aka_
  Change Speed on spline linkinballzpokemon 1 10 12-29-2021, 10:58 AM
Last Post: _Aka_
  How to send event to generated game object upon ControlPoint deletion? toxicfrog 8 184 12-03-2021, 02:02 PM
Last Post: _Aka_
  Change to Random Spline on End Reached Event ricke 10 976 09-14-2021, 12:31 AM
Last Post: ricke

Forum Jump: