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
Exclamation Need Help Stopping an Object at a ControlPoint DCalabrese 3 115 08-01-2019, 01:34 PM
Last Post: _Aka_
  Change default settings when adding a point UsernameHed 3 119 07-31-2019, 11:03 AM
Last Post: _Aka_
  Change Shape Extrusion of Generator by code UsernameHed 1 226 06-03-2019, 02:00 PM
Last Post: _Aka_
  Connections during speed change 3583Bytes 8 1,271 04-05-2019, 01:12 PM
Last Post: _Aka_

Forum Jump: