I’m converting geometry from an indexed face set representation to USD. There are multiple objects all indexing into one large vertex array, normal array, and uv array. I would like to place those arrays into a base prim, and put only the index arrays into the individual Mesh objects I am creating.
This structure seems like it will work:
def Xform "xform1"
{
def Mesh "mesh1" (
prepend inherits = </xform1/mesh_verts>
)
{
int[] faceVertexCounts = [...]
int[] faceVertexIndices = [...]
rel material:binding = </xform1/material1>
int[] primvars:normals:indices = [...]
int[] primvars:uvs:indices = [...]
uniform token subdivisionScheme = "none"
}
def Mesh "mesh_verts"
{
point3f[] points = [(0.0, 0.5, 0.0), ...]
normal3f[] primvars:normals = [(0, 0, 1), ...]
texCoord2f[] primvars:uvs = [(0.2, 0.4), ...]
}
def Material "material1"
{ ... }
}
And indeed, I have hand-edited a .usda using this pattern that works. However, I can’t figure out how to create the primvars:normals:indices
and primvars:uvs:indices
without also adding primvars:normals
and primvars:uvs
to the individual Mesh objects, and they are preventing those elements from being inherited from the mesh_verts
prim.
Using the Python API, how can I create the primvar:*
arrays in the mesh_verts
prim and the primvar:*:indices
arrays in the individual Mesh prims?