# Primvars - do I need uo use UsdGeom.PrimvarsAPI or can I just GetAttribute?

**URL:** <https://forum.aousd.org/t/primvars-do-i-need-uo-use-usdgeom-primvarsapi-or-can-i-just-getattribute/1324>\
**Category:** USD\
**Tags:** beginner\
**Created:** [March 15, 2024, 3:29am UTC](https://forum.aousd.org/t/primvars-do-i-need-uo-use-usdgeom-primvarsapi-or-can-i-just-getattribute/1324 "2024-03-15T03:29:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SteveHwan](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@SteveHwan](https://forum.aousd.org/u/SteveHwan)\
**Post date:** [March 15, 2024, 3:29am UTC](https://forum.aousd.org/t/primvars-do-i-need-uo-use-usdgeom-primvarsapi-or-can-i-just-getattribute/1324/1 "2024-03-15T03:29:41Z")

</div>

Let’s say I only care about primvars:foo if it’s defined on the mesh prim that I’m looking at. If it exists, I want to modify it. If it doesn’t exist, I want to do nothing, and I don’t care if it was defined above me(I.e. I actually don’t want to inherit).

In this case, is it okay to just use mesh\_prim.GetAttribute(“primvars:foo”), and treat it like a normal attribute with Get and Set?  
Or is it really bad to assume the “primvars:” namespace and I have to use UsdGeomPrimvarsAPI for any access to a primvar?

(I don’t know if it matters, but I’m using python)

---

<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:** [March 15, 2024, 5:40am UTC](https://forum.aousd.org/t/primvars-do-i-need-uo-use-usdgeom-primvarsapi-or-can-i-just-getattribute/1324/2 "2024-03-15T05:40:30Z")

</div>

Hi @SteveHwan , just doing `mesh_prim.GetAttribute(“primvars:foo”)` will leave you ignorant of whether or not the primvar is “indexed”, and therefore how many values you may expect `foo` to hold, and how those values will be consumed. PrimvarsAPI will allow you to answer those questions.
