Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[usdview] Layered alembic transform payloads not always working #1118

Open
AlexSchwank opened this issue Feb 19, 2020 · 4 comments
Open

[usdview] Layered alembic transform payloads not always working #1118

AlexSchwank opened this issue Feb 19, 2020 · 4 comments

Comments

@AlexSchwank
Copy link
Collaborator

Description of Issue

I'm running into an issue when I use multiple alembic payloads for a prim for transformations.
I have two files: teapot.abc containing a teapot mesh and teapotTransform.abc containing a transform for the teapot. Layering them using payloads is causing issues in usdview (see Case 2).

Case 1: no layers

def Xform "myTeapot_original" {
    over "teapot_teapot" (
        payload = [
            @teapot.abc@</teapot_teapot>
        ]
    )
    {}
}

A non-transformed teapot. No surprise here.

teapot_original

Case 2: abc transform (error case)

def Xform "myTeapot_abcTransform"
{
    over "teapot_teapot" (
        payload = [
            @teapotTransform.abc@</teapot_teapot>,
            @teapot.abc@</teapot_teapot>
        ]
    )
    {}
}

This is the case where it doesn't work. The teapot is not transformed. However, usdview is showing the transform attributes for teapot_teapot.

teapot_abcTransform

Case 3: usd transform

def Xform "myTeapot_usdTransform"
{
    over "teapot_teapot" (
        payload = [
            @teapotTransform.usda@</teapot_teapot>,
            @teapot.abc@</teapot_teapot>
        ]
    )
    {}
}

This works as expected. The teapot is transformed. teapotTransform.usda was generated by usdcat teapotTransform.abc -o teapotTransform.usda. usdview is showing the same transform attributes for teapot_teapot as in Case 2.

teapot_usdTransform

Case 4: flattened stage

def Scope "Assets"
{
    def Xform "myTeapot_usdTransform"
    {
        def Xform "teapot_teapot"
        {
            float3 xformOp:rotateZXY = (1, 2, 3)
            float3 xformOp:scale = (1.1, 1.2, 1.3)
            double3 xformOp:translate = (2, 3, 4)
            uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateZXY", "xformOp:scale"]

            def Mesh "teapot_teapotShape"
            {
                #...
            }
        }
    }

    def Xform "myTeapot_abcTransform"
    {
        def Xform "teapot_teapot"
        {
            float3 xformOp:rotateZXY = (1, 2, 3)
            float3 xformOp:scale = (1.1, 1.2, 1.3)
            double3 xformOp:translate = (2, 3, 4)
            uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateZXY", "xformOp:scale"]

            def Mesh "teapot_teapotShape"
            {
                #...
            }
        }
    }

    def Xform "myTeapot_original"
    {
        def Xform "teapot_teapot"
        {
            def Mesh "teapot_teapotShape"
            {
                #...
            }
        }
    }
}

This works as well. Both myTeapot_usdTransform and myTeapot_abcTransform are transformed correctly.

teapot_files.zip

Package Versions

Tested in 19.07 and 19.11

@spiffmon
Copy link
Member

Hi @AlexSchwank !
The behavior you are describing sounds incredibly weird. Unfortunately, the transform values in your example are really subtle and I am having a hard time seeing any difference in the three pictures you provided... If you can reword it to throw in a 90 degree rotation or a larger scale, I can at least try to verify the behavior here. Honestly, if we see the same behavior I think it’s unlikely we’d be able to investigate anytime soon... this is a rather unexpected use for alembic files in USD (though I can’t imagine how it would screw up if usdcat gives the right answer). Can I point you at. PR #1099 , which we are hoping to accept soon, which would allow you to use ALembic’s own layering feature to compose your alembic files in Alembic-space, which might give you bettter ransform comPosing, since we flatten out all the Alembic xform ops?

@AlexSchwank
Copy link
Collaborator Author

Hi @spiffmon ,

The teapot in the top right corner is the transformed one. The teapot at the origin has not transform.
I'll check out the PR - that might solve some problems on our end.

@jilliene
Copy link

Filed as internal issue #USD-5879

@spitzak
Copy link

spitzak commented Feb 27, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants