omni::connect::core::getLocalTransform does not return scale nor rotation, why?

Hello,

I’m trying to get transformation from a UsdPrim using omni::connect::core::getLocalTransform() function. It seems it does not compute rotation and scale and only takes translation into account from what I can tell. Am I doing something wrong?

I’m testing with a simple cube I create with USDComposer and I apply a scale, or a rotation, but when reading the USD I don’t find the same matrix.

If I use the USD library functionalities I find the appropriate 4x4 matrix it seems:

GfMatrix4d GetGfTransform(const UsdPrim& prim) {
    if (!prim) {
        throw std::invalid_argument("Invalid UsdPrim provided");
    }

    UsdGeomXformable xformable(prim);
    if (!xformable) {
        throw std::invalid_argument("The provided prim is not transformable");
    }

    // Get the local transformation matrix
    bool resetXformStack;
    GfMatrix4d transformMatrix;
    xformable.GetLocalTransformation(&transformMatrix, &resetXformStack);

    return transformMatrix;
}

...

// xform gets wrong data
pxr::GfTransform xform = omni::connect::core::getLocalTransform(prim);
// usdXform seems better
auto usdXform = GetGfTransform(prim);

Hi there, I just saw this old thread. I apologize. Are you still having an issues?

Hello Richard,

thank you for getting back to me even if it’s been a while. I have not upgraded version so I still see the problem on my end, it’s worth forwarding it to the dev team in order to double check if there is an issue or if it’s me using the wrong functions.

I’m using the workaround I found so far.

Best regards,

Ok I have let them know, but it may have already been fixed in the latest version so I would strongly advise you upgrade to the latest, which is 107.3 as of today.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.