Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Variable Mix Shape Interpolation Not Spanning Entire Input Spine
#4
I may have actually figured out a solution / workaround. Increasing the Max Points Per Unit on the Input Spline Path from it's default of 8 to something arbitrarily higher (30-100 range) seems to fix it.

Are there any "gotchas" I might run into with setting that number so high?

Edit/Update 2: Looks like Max Point Points Per Unit can still have variable results depending on the length of the Input Spline Path. I'm not sure of the perfect way to auto calculate the lowest necessary number to get a perfect mirror result, but setting it to something ridiculous like 1000 seems to work in most of my cases, although I have a feeling that's not ideal from a performance perspective.

Final Edit: Solved for the formula. Code is as follows:
Code:
Keyframe[] keys = new Keyframe[4];
keys[0] = new Keyframe(0, 1);
keys[1] = new Keyframe(timeOffset, -1);
keys[2] = new Keyframe(1f - timeOffset, -1);
keys[3] = new Keyframe(1, 1);
AnimationCurve animationCurve = new AnimationCurve(keys);

float length = 5f; // arbitrary length
float fidelity = 10f; // Can be any number between 1 and infinity
CurvySpline spline = splineObject.AddComponent<CurvySpline>();
Vector3[] splinePoints = new Vector3[] {
  new Vector3(0, 0, 0),
  new Vector3(length, 0, 0)
};
spline.Add(splinePoints);
spline.MaxPointsPerUnit = (float)System.Math.Round((1f / length) * (animationCurve.length - 1), 2) * fidelity;

This ensures each longitudinal segment of the volume extrusion are as even as possible. Without it you might end up with a strange "hanging" segment at the end of the volume that doesn't match the length of the other segments. It's this uneven segment that throws off the symmetry of the animation curve.

Hopefully this helps anyone else that runs into the symmetry issue. It's technically not perfect since it requires rounding down, but increasing the fidelity makes it pretty much irrelevant.
Reply


Messages In This Thread
RE: Variable Mix Shape Interpolation Not Spanning Entire Input Spine - by Diasporism - 04-20-2021, 03:40 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Curvy discards Input Spline Range VoltDriver 3 5 11-28-2023, 07:14 PM
Last Post: _Aka_
  "MetaData" Of Entire Spline Heightmap SAMYTHEBIGJUICY 3 6 10-16-2023, 08:42 AM
Last Post: _Aka_
  Skip Input Mesh if spline has too much bend Zilk1 3 9 09-27-2023, 09:45 PM
Last Post: _Aka_
  I want to improve the performance of Variable Mix Shapes yanke 7 8 07-27-2023, 09:15 PM
Last Post: _Aka_

Forum Jump: