Hello
While working on UsdAnim Splines, it was discovered that negative layer-offset scales conceptually do not make sense. Following on are some reasons on why we are deciding to deprecate these and what steps will be taken for the same:
Why do “negative layer-offset scales” not make sense?
Negative offsets are interpreted as time reversals and any behavior which is asymmetric in time can cause confusing / incorrect time sample resolution or spline evaluation.
-
UsdTimeSample usage:
Depending on the interpolation mode, specifically for Held interpolate. The counterintuitive value resolution results arise because the held interpolation logic operates on the local time (which is reversed due to the negative scale) but does not account for the fact that the order of time samples has been reversed. -
TsSpline and negative Scale:
- Segment interpolation mode: Depending on the mode, each knot controls the mode of the following segment, and with time reversing because of negative scaling, it becomes difficult to reason about.
- Held Segments: Same reason for Spline as for TimeSamples.
- Dual value knots: Similar to held values, it gets difficult to reason about “preValue” with time reversing. This will also imply when dual value knots are added to UsdTimeSample.
- Inner Looping: Involves prototype start-end interval, where start knots are special, a time reversed spline will cause issues with spline loop behavior.
How will the USD core handle “negative layer-offset scales” and Deprecation Cycle?
-
During composition, if the accumulated result of an offset is negative scaling, then it will result in a new composition error (similar to here and here) and layerOffset will be set to identity (both translation and scale components).
-
During the deprecation phase this will be controlled via an environment variable and reported as a warning.
-
That being said, SdfLayerOffset::IsValid() definition still holds true from mathematical standpoint, and an SdfLayerOffset with a negative scale still continues to be valid, as long as its finite and its inverse is finite. But the usage of layer offsets with negative scale during composition and value resolution is being deprecated.
-
Since TsSpline code is still considered in development, spline evaluation code which tries to take negative scale into account, will be removed in the upcoming release. A SdfLayerOffset having a negative scale will be reported as a warning and evaluated as an Identity (both translation and scale components).
We are proposing to deprecate this behavior that we have never actually relied on at Pixar in service of sanity for robust evaluation of splines; we never actually intended for layerOffsets to be usable for reversing animation, and note that Value Clips offsets can and will remain able to play animation back in reverse robustly by animating offsets in a decreasing signal, even if / when splines are added to Value Clips.
We will love to hear community thoughts.
Thanks
–
Varun Talwar