OpenUSD icon indicating copy to clipboard operation
OpenUSD copied to clipboard

Inconsistency regarding skel:animationSource relationship directly on the Skeleton prim

Open 1danielcoelho opened this issue 1 year ago • 2 comments

This follows from the discussion on https://forum.aousd.org/t/skel-animationsource-relationship-directly-on-the-skeleton-prim/2209

We’ve recently ran into some USD like this:

#usda 1.0

def SkelRoot "Model"
{
    def Skeleton "Skel" ( apiSchemas = ["SkelBindingAPI"] )
    {
        rel skel:animationSource = </Anim>

        ...
    }

    def Mesh "Arm" ( apiSchemas = ["SkelBindingAPI"] )
    {
        rel skel:skeleton = </Model/Skel>

        ...
    }
}

def SkelAnimation "Anim" {
    ...
}

According to the Binding Skeletons part of the documentation, this should not animate. You can deduce this from the examples, and also from this statement:

a skel:animationSource binding is not considered to have any effect until the next skel:skeleton binding at or beneath the binding location in namespace.

In the USD above, the rel skel:animationSource cannot inherit down to where rel skel:skeleton is, so I think it shouldn’t animate, right?

And yet, it does animate in usdview… and in fact if you construct an AnimQuery for that skeleton, it will be valid and point at the “Anim” prim. Additionally, the setup shown at the top of this doc page has the same pattern, suggesting this is supported.

Furthermore, as Spiff suggested it seems that the rel skel:animationSource binding on the Skeleton wins over any binding done at the point where rel skel:skeleton is authored...

For example, this:

def SkelRoot "Model"
{
    def Skeleton "Skel" ( apiSchemas = ["SkelBindingAPI"] )
    {
        rel skel:animationSource = </NoAnim>
        ...
    }

    def Mesh "Arm" ( apiSchemas = ["SkelBindingAPI"] )
    {
        rel skel:animationSource = </SomeAnim>
        rel skel:skeleton = </Model/Skel>
        ...
    }
}

def SkelAnimation "NoAnim" {
    uniform token[] joints = ["Shoulder/Elbow"]

    float3[] translations = [(0,0,2)]
    quatf[] rotations.timeSamples = {
        0: [(1,0,0,0)]
    }
    half3[] scales = [(1,1,1)]
}

def SkelAnimation "SomeAnim" {
    uniform token[] joints = ["Shoulder/Elbow"]

    float3[] translations = [(0,0,2)]
    quatf[] rotations.timeSamples = {
        5: [(1,0,0,0)],
        10: [(0.7071, 0.7071, 0, 0)]
    }
    half3[] scales = [(1,1,1)]
}

Does not animate, when I believe it should.

It doesn't seem like I can attach USD files here but there are some sample files in the AOUSD thread link above, with those exact setups.

1danielcoelho avatar Feb 15 '25 09:02 1danielcoelho

Filed as internal issue #USD-10677

(This is an automated message. See here for more information.)

jesschimein avatar Feb 17 '25 18:02 jesschimein

Thanks, @1danielcoelho ! We don't yet have a timeline for addressing this, but please advise if this becomes a workflow impediment.

spiffmon avatar Feb 17 '25 19:02 spiffmon