Spline animation on attribute components

I know similar questions have come up to this before, but are there any plans around component-wise animation of dimensional attributes? For example, animating the first component of a vector?

I know that translate and scale got scalar xformOps to sort of bypass this, but it seems there are still cases for this, particularly in custom schema attributes (for example, animating a color attribute for a light). To really take advantage of spline animation, a developer would either have to break apart their custom attributes into scalars (which is a bit of an unbounded problem) or design their own solution for mapping a spline to an attribute’s component.

We’re currently looking at taking the second approach ourselves, though I’d really like to avoid/minimize it because we then would have to filter any use of spline animation through our own APIs rather than default USD Get calls.

FYI @jjzanin-SMS

I suspect the sparse array edits might do the trick for you if the proposal comes through

I don’t think arrays are allowed to be splines, so I’m not sure the array edit proposal applies here.

From the array edit proposal: Since splines in USD are restricted to floating point scalars, which are always dense values, we do not need to consider splines here.

@lbiasco-sie I agree with you that it’s unfortunate that spline support for dimensioned floating point type were dropped from the proposal.

As @nvmkuruc alluded to, the initial proposal did propose support for numeric tuples, which Presto’s spline has always supported. My understanding is that the ability got very little use over the years, for several reasons, probably the biggest of which is that the animation interfaces our animators use do not need them, and so adding support to our animation editing tools for them (which is a challenge), never seemed worthwhile. They also resulted in lots of special-cases inside the spline code that were a maintenance challenge, and so the early software designs that flowed out of the proposal involved splitting out a spline into multiple classes based on capabilities… but then that started to look like a lot of client-facing complexity that didn’t seem warranted.

So, with the acknowledgment that we weren’t closing the door permanently, we decided to simplify the design and implementation to only support scalars (quaternions already do SLERPing when recorded to timeSamples, and it didn’t look like Maya’s quaternion implementation provided any useful/used interpolation methods beyond slerping, anyways).

We do animate colors for shading, but that’s performed by shader nodes that have bespoke interfaces for providing samples and interpolation methods… and sidebar that there’s been some discussion about trying to standardize on a ā€œcolor rampā€ schema such that there could be interchangeable widgetry for ramps, though that looks challenging!

Without adding support to splines for tuples, our forward-looking answer might be to split into scalars and use connections and mappers to drive them into the color3f attribute, leveraging OpenExec. That’s not a perfect solution, a) because it’ll be awhile before dataflow and mappers are available in OpenExec, b) even when it is available, splitting into scalars makes working with color pickers challenging.

It’s good to hear use-cases for this, and please feel free to file an Issue… funnily enough we were just talking about this yesterday in the context of XformCommonAPI.

This does kind of seem like it falls under the umbrella of sparse editing arrays and would be sparse editing tuples/vectors. If you could sparse edit an element of a tuple/vector, then you could assign a spline to it. From the OpenExec paper it looks like connections will be able to target specific elements of a tuple/vector for data flow.

Our custom schemas use vectors and to work around this problem, we are considering adding new scalar attributes to the data (not schema) if the attribute is animated. For example:

# Light schema.
class SMSSmLight "SMSSmLight"
{
    color4f color = (1, 1, 1, 0)
    float intensity = 1
}

# Light in data.
def SMSSmLight "SmLight"
{   
    # This isn't in the schema and is added if color has an animation spline.
    float color:r.spline = {
        0: 0; pre (0, 0); post held,
        1: 1; post held,
        2: 2; post held,
        3: 3; post held,
    }

    float intensity.spline = {
        0: 0; pre (0, 0); post held,
        1: 1; post held,
        2: 2; post held,
        3: 3; post held,
    }
}

In addition we would create a non-applied API to access the spline information. (hand-wavy) You would pass it the vector attribute and it would look for the element attributes under the namespace which comes from the name of the vector attribute. Does this approach seem reasonable?

That seems reasonable and would be incorporatable into an OpenExec world. Also, to be clear, if we were to add spline support for tuples, it would not allow for the different components to have different knots… you’d get (e.g.) a float3-valued knot whose tangents were also float3’s.

Does that majority-satisfy what people are looking for? If you want independently timed/authored curves for each component, you’d need to go the OpenExec route.

Thanks for calling out that clarification, as ā€œanimating components with separate splinesā€ is exactly what we’re after here.

We’re coming from a Maya ecosystem, so most attribute components can be driven by their own animation curves. However I’m not sure how extensively this animation is used in our tuple-like data besides transformations, so that’s probably worth digging into further.

Regardless, it sounds like we should continue to move forward with a custom API for authoring and handling these component attributes, similar to the PrimvarsAPI and its indices or idFrom secondary attributes, and keep our eyes on the horizon for integrating it with OpenExec for streamlined data access.

Thanks for the reminder, @lbiasco-sie .. I now remember years ago there was a request for USD connections to support component-wise connections, to facilitate Maya-style connectivity. Regardless of how Maya’s API’s expose it, evaluating those connections efficiently requires an evaluation/execution engine, so it feels pretty similar to the OpenExec route…once mappers and expressions are available with OpenExec, it should be pretty easy to build UI’s that look like component-wise connections and are actually authoring the connections, mapper and/or expression that encode them.

1 Like