Skip to content
New issue

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

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

Already on GitHub? # to your account

Indexed primvars use :vals suffix in ABC #860

Closed
AlexSchwank opened this issue May 30, 2019 · 4 comments
Closed

Indexed primvars use :vals suffix in ABC #860

AlexSchwank opened this issue May 30, 2019 · 4 comments

Comments

@AlexSchwank
Copy link
Collaborator

Description of Issue

Coming from Alembic, indexed primvars use a :vals suffix for the value attributes.

For example, adding an additional UV Set to a cube in Maya and then export it to alembic, results in this ABC structure:

  ScalarProperty name=statistics;interpretation=;datatype=string;arraysize=1;numsamps=1
  ScalarProperty name=1.samples;interpretation=;datatype=uint32_t;arraysize=1;numsamps=1
  ScalarProperty name=.childBnds;interpretation=box;datatype=float64_t[6];arraysize=6;numsamps=1
Object name=/pCube1
  CompoundProperty name=.xform;schema=AbcGeom_Xform_v3
Object name=/pCube1/pCubeShape1
  CompoundProperty name=.geom;schema=AbcGeom_PolyMesh_v1
    ScalarProperty name=.selfBnds;interpretation=box;datatype=float64_t[6];arraysize=6;numsamps=1
    ArrayProperty name=.faceIndices;interpretation=;datatype=int32_t;arraysize=24;numsamps=1
    CompoundProperty name=uv;schema=
      ArrayProperty name=.indices;interpretation=;datatype=uint32_t;arraysize=24;numsamps=1
      ArrayProperty name=.vals;interpretation=vector;datatype=float32_t[2];arraysize=24;numsamps=1
    ArrayProperty name=P;interpretation=point;datatype=float32_t[3];arraysize=8;numsamps=1
    ArrayProperty name=N;interpretation=normal;datatype=float32_t[3];arraysize=24;numsamps=1
    CompoundProperty name=.arbGeomParams;schema=
      CompoundProperty name=secondaryUVsA;schema=
        ArrayProperty name=.indices;interpretation=;datatype=uint32_t;arraysize=24;numsamps=1
        ArrayProperty name=.vals;interpretation=vector;datatype=float32_t[2];arraysize=14;numsamps=1
    ArrayProperty name=.faceCounts;interpretation=;datatype=int32_t;arraysize=6;numsamps=1

secondaryUVsA is a compound attribute with two children: .indices and .vals . The same is the case for the uv attribute. Converting it to USD results in a stage with this:

        custom uint[] primvars:secondaryUVsA:indices
        uint[] primvars:secondaryUVsA:indices.timeSamples = {
            1: [ ... ],
        }
        custom float2[] primvars:secondaryUVsA:vals (
            interpolation = "faceVarying"
        )
        float2[] primvars:secondaryUVsA:vals.timeSamples = {
            1: [ ... ],
        }

       float2[] primvars:uv (
            interpolation = "faceVarying"
        )
        float2[] primvars:uv.timeSamples = {
            1: [ ... ],
        }
        int[] primvars:uv:indices (
            interpolation = "faceVarying"
        )
        int[] primvars:uv:indices.timeSamples = {
            1: [ ... ],
        }

Apart from the uint issue (#859), you can see that primvars:secondaryUVsA:vals has a :vals suffix but primvars:uv doesn't. Opening the file with usdview will show all the attributes but secondaryUVsA isn't properly loaded into applications like Katana.

I've attached a pure USD example which contains two primvars, one with :vals suffix and one without: valsPrimvars.usda.zip . It illustrates the question if the USD side should be able to handle :vals for indexed primvars or if the alembic reader should remove it to create a correct USD file?

Steps to Reproduce

  1. Add secondary UV Set to mesh in Maya
  2. Export as Alembic (with UV Sets)
  3. Load ABC in Katana through PxrUsdIn node -> the secondary UV Set is missing

Package Versions

USD: 19.05
Alembic: 1.6.1 & 1.7.10

@spiffmon
Copy link
Member

The proper fixes would be for usdAbc to strip the ":vals" suffix, and change the typeName for indices from uint to int. We'd be happy to take a PR on this!

@jilliene
Copy link

jilliene commented Jun 6, 2019

Filed as internal issue #USD-5343

@cameronwhite
Copy link
Contributor

I think this was fixed by PR #1635

@spiffmon
Copy link
Member

spiffmon commented Oct 5, 2023

Thanks for noticing that, @cameronwhite !

@spiffmon spiffmon closed this as completed Oct 5, 2023
AdamFelt pushed a commit to autodesk-forks/USD that referenced this issue Apr 16, 2024
…ni1/LineStyle_refactor

LineStyle properties post process small refactoring
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants