static
bool
_TranslateAnimatedUsdAttributeToPlug(
        const UsdAttribute& usdAttr,
        MPlug& plug,
        const UsdMayaPrimReaderArgs& args,
        UsdMayaPrimReaderContext* context,
        const MDistance::Unit convertToUnit = MDistance::kMillimeters)
{
    if (args.GetTimeInterval().IsEmpty()) {
        return false;
    }

    MTimeArray timeArray;
    MDoubleArray valueArray;
    if (!_GetTimeAndValueArrayForUsdAttribute(usdAttr,
                                              args.GetTimeInterval(),
                                              &timeArray,
                                              &valueArray,
                                              convertToUnit)) {
        return false;
    }

    if (!_CreateAnimCurveForPlug(plug, timeArray, valueArray, context)) {
        return false;
    }

    return true;
}
Exemplo n.º 2
0
static
bool
_TranslateAnimatedUsdAttributeToPlug(
        const UsdAttribute& usdAttr,
        MPlug& plug,
        const PxrUsdMayaPrimReaderArgs& args,
        PxrUsdMayaPrimReaderContext* context,
        bool millimetersToInches=false)
{
    if (!args.GetReadAnimData()) {
        return false;
    }

    MTimeArray timeArray;
    MDoubleArray valueArray;
    if (!_GetTimeAndValueArrayForUsdAttribute(usdAttr,
                                                 args,
                                                 &timeArray,
                                                 &valueArray,
                                                 millimetersToInches)) {
        return false;
    }

    if (!_CreateAnimCurveForPlug(plug, timeArray, valueArray, context)) {
        return false;
    }

    return true;
}