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
  Avoiding runtime GC allocations on control point position change Ell223 8 18 02-24-2024, 10:43 AM
Last Post: _Aka_
  Add ControlPoint "ahead" of spline end jh092 3 5 10-23-2023, 08:48 PM
Last Post: _Aka_
  How can I set the generator to stop updating? Chanon 3 19 09-08-2022, 02:54 PM
Last Post: _Aka_
Brick Delete CurvySplineSegment from the start of a Spline causes UV's to change studentloan 5 7 06-14-2022, 03:14 PM
Last Post: _Aka_

Forum Jump: