# Share indexed point data among multiple prims?

**URL:** <https://forum.aousd.org/t/share-indexed-point-data-among-multiple-prims/1114>\
**Category:** USD\
**Tags:** python, beginner\
**Created:** [January 10, 2024, 12:26am UTC](https://forum.aousd.org/t/share-indexed-point-data-among-multiple-prims/1114 "2024-01-10T00:26:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![notsofast](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.aousd.org/notsofast/32/387_2.png) [@notsofast](https://forum.aousd.org/u/notsofast)\
**Post date:** [January 10, 2024, 12:26am UTC](https://forum.aousd.org/t/share-indexed-point-data-among-multiple-prims/1114/1 "2024-01-10T00:26:53Z")

</div>

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:

```auto
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?

---

<div class="post-metadata">

**Author:** ![spiff](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.aousd.org/spiff/32/22_2.png) [@spiff](https://forum.aousd.org/u/spiff)\
**Post date:** [January 28, 2024, 10:13pm UTC](https://forum.aousd.org/t/share-indexed-point-data-among-multiple-prims/1114/2 "2024-01-28T22:13:04Z")

</div>

Ah, this is kind of an “advanced” construct, and not directly supported in the schema, though arguably it should be. However, you always have access to the full Usd software stack, so you can “manually” create the indices attributes on “mesh1” etc using UsdPrim API:

```auto
   normalIndices = prim.CreateAttribute("primvars:normals", Sdf.ValueTypeNames.IntArray)

```

Once the attributes are created, you’ll be able to use the Primvar and PrimvarsAPI schemas themselves on “mesh1”, I believe.

Also, since “mesh\_verts” is not (I think) a Mesh you actually want to be imaged, you probably either want to convert its specifier to an “over” rather than a “def”, or remove the typeName of “Mesh”. Finally, unless you will need to override the source points, normals, etc in a scene that is _referencing_ this asset/file and have it affect all of the meshes, then you can simply use a reference rather than an inherits (inherits are more expensive, because of the extra override power they provide).
