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
  how to change the look direction of a character at end of path ninadpradhan 1 153 12-16-2020, 09:30 AM
Last Post: _Aka_
  Updating old movement code Maltakreuz 3 811 08-18-2020, 04:49 PM
Last Post: _Aka_
  Change curvy gizmos to show direction of spline Horibe 1 1,246 11-01-2019, 07:02 PM
Last Post: _Aka_
  Change Shape Extrusion of Generator by code UsernameHed 5 3,180 09-20-2019, 03:14 PM
Last Post: _Aka_

Forum Jump: