Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CurvySpline.Update() sorta expensive
#1
I have a lot of splines, I don't ever move them, they are static. Why do they need to Update ? 

Can there be a "No Update" mode ? I tried adding one, but then querying spline info does not 
seem to work anymore.

I've added : 
            if (m_UpdateIn == CurvyUpdateMethod.NoUpdate)
                doUpdate();


to the OnEnable call for CurvySpline.cs :  

that seems to make it work, although would be better if it didn't have to refresh the spline OnEnable, just use the data from Editor, I'm going to keep on modding it. Is there a better way to just generate the spline and never update ?


OK I think this does it: 

moved the code all the way to the top of the OnEnable() function:

            if (m_UpdateIn == CurvyUpdateMethod.NoUpdate)
            {
                mIsInitialized = true;
                doUpdate();
                return;
            }


This effectively makes the splines almost zero cost all the time. Not sure what effect it might have in the Editor, but
you can switch it back to Update when editing the splines and switch it back to NoUpdate once you are done. 

Anyway I suggest this small change, should be added to next version !  Big Grin
Reply


Messages In This Thread
CurvySpline.Update() sorta expensive - by invadererik - 04-21-2016, 09:49 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  CG documentation update _Aka_ 0 138 06-19-2026, 11:13 PM
Last Post: _Aka_
  Update and Black Friday sale _Aka_ 2 2,012 11-23-2024, 11:58 AM
Last Post: _Aka_
  Destroying curvyspline instances jmh1804 5 3,340 09-18-2024, 07:52 AM
Last Post: _Aka_
  CurvySpline Optimize Candy 1 1,622 08-02-2024, 08:35 AM
Last Post: _Aka_

Forum Jump: