AnimalLogic / AL_USDMaya

This repo is no longer updated. Please see https://github.com/Autodesk/maya-usd
Other
266 stars 69 forks source link

Proxy shape does not import animated transforms if animation has single key. #129

Closed sopvop closed 1 year ago

sopvop commented 5 years ago

If you try to create proxy shape with usd like this:

def Xform grp {
        float3 xformOp:translate.timeSamples = {
            1: (5, 5, 5),
        }
}

it will not read any values for translate attribute. Same is with any xformOp with single key.

TransformationMatrix::updateToTime tries to be clever and update animation only if there is more than one sample on xformOp. Initial values are read in TransformationMatrix::initialiseToPrim. When initialiseToPrim is called, the m_time is not set and values are read with UsdTimeCode::Default(). And when UsdAttriubute::Get gets default timecode - it ignores timeSamples fields and fails to get any values.

This can be solved by: initialising TransformationMatrix::m_time to some sane value which is not UsdTimeCode::Default(), special casing single sample values, or treating single sample values as animated.

Usd files like that are created by pxrUsd exporter.