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
  Is there a way to get the position of each ControlPoint in spline by API? Chanon 1 1,931 06-07-2025, 09:44 AM
Last Post: _Aka_
  How can I set the generator to stop updating? emerrryjones 1 1,367 07-26-2024, 10:07 AM
Last Post: _Aka_
  Avoiding runtime GC allocations on control point position change Ell223 8 3,919 02-24-2024, 10:43 AM
Last Post: _Aka_
  Add ControlPoint "ahead" of spline end jh092 3 1,803 10-23-2023, 08:48 PM
Last Post: _Aka_

Forum Jump: