Autodesk / maya-usd

A common USD (Universal Scene Description) plugin for Autodesk Maya
777 stars 201 forks source link

Exporting with `-exportRoots` flag fails to export prototypes' geometry for Instancers #3389

Open BigRoy opened 1 year ago

BigRoy commented 1 year ago

Describe the bug

When exporting a maya instancer node with -exportRoots instancer_node the USD file PointInstancer's prototypes in the USD data will have no geometry defined:

    def "Prototypes" (
        kind = "group"
    )
    {
        def "pCube1_0"
        {
        }
    }

Versus using e.g. -selection flag with instancer node selected:

    def "Prototypes" (
        kind = "group"
    )
    {
        def Mesh "pCube1_0" (
            kind = "component"
        )
        {
            uniform bool doubleSided = 1
            float3[] extent = [(-0.5, -0.5, -0.5), (0.5, 0.5, 0.5)]
            int[] faceVertexCounts = [4, 4, 4, 4, 4, 4]
            int[] faceVertexIndices = [0, 1, 3, 2, 2, 3, 5, 4, 4, 5, 7, 6, 6, 7, 1, 0, 1, 7, 5, 3, 6, 0, 2, 4]
            point3f[] points = [(-0.5, -0.5, 0.5), (0.5, -0.5, 0.5), (-0.5, 0.5, 0.5), (0.5, 0.5, 0.5), (-0.5, 0.5, -0.5), (0.5, 0.5, -0.5), (-0.5, -0.5, -0.5), (0.5, -0.5, -0.5)]
            texCoord2f[] primvars:st = [(0.375, 0), (0.625, 0), (0.375, 0.25), (0.625, 0.25), (0.375, 0.5), (0.625, 0.5), (0.375, 0.75), (0.625, 0.75), (0.375, 1), (0.625, 1), (0.875, 0), (0.875, 0.25), (0.125, 0), (0.125, 0.25)] (
                customData = {
                    dictionary Maya = {
                        token name = "map1"
                    }
                }
                interpolation = "faceVarying"
            )
            int[] primvars:st:indices = [0, 1, 3, 2, 2, 3, 5, 4, 4, 5, 7, 6, 6, 7, 9, 8, 1, 10, 11, 3, 12, 0, 2, 13]
        }
    }

In this case the instancer node I exported was a top level in the maya scene in both cases

Steps to reproduce

Steps to reproduce the behavior:

  1. Create a Maya instancer that instances a cube
  2. Export mayaUSDExport with flag -exportRoots set to the instancer node
  3. Check the exported USD file -it contains no geometry data.

Expected behavior

I'd have expected prototypes to still be exported as intended - but the -exportRoots flag only defining the root for the Instancer node itself.

Attachments If applicable, add screenshots, sample files, etc to help explain your problem.

Specs (if applicable):

Additional context

The computed extent for the instancer when no geometry is included is also infinitesimal, like:

float3[] extent = [(3.4028235e38, 3.4028235e38, 3.4028235e38), (-3.4028235e38, -3.4028235e38, -3.4028235e38)]

Which I suppose is technically correct due to having no shapes.

Other than that the export appears the same but just misses the prototypes geometry.

wallworm commented 1 year ago

Thank you for reporting. I will bring this up with the team.

maya-usd-git-sync[bot] commented 1 year ago

Issue synced internally to EMSUSD-831