# How to check if SdfPrimSpec is empty?

**URL:** <https://forum.aousd.org/t/how-to-check-if-sdfprimspec-is-empty/2707>\
**Category:** USD\
**Tags:** python, beginner\
**Created:** [October 1, 2025, 12:29am UTC](https://forum.aousd.org/t/how-to-check-if-sdfprimspec-is-empty/2707 "2025-10-01T00:29:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nostromo](https://avatars.discourse-cdn.com/v4/letter/n/9dc877/32.png) [@nostromo](https://forum.aousd.org/u/nostromo)\
**Post date:** [October 1, 2025, 12:29am UTC](https://forum.aousd.org/t/how-to-check-if-sdfprimspec-is-empty/2707/1 "2025-10-01T00:29:53Z")

</div>

I want to catch data that looks like this: `over “foo” {}`. That example would be considered “empty”

However these are not empty:

- `over “foo” (some=”thing”) {}` - Defines some metadata, could be anything
- `over SomeType “foo” {}` - Defines a type
- `over “foo” { over “child” { … } }` - Has a child
- `over “foo” { variantSet “thing” = { … } }` - Has a variantSet

In my case, the entry-point is a Sdf.Layer and I’m trying to delete all “empty” overs recursively until there are no empty overs left.

For example for a layer like this:  
`over “foo” { over “child” {} }`

The first iteration would detect and remove “/foo/child”, then the second iteration would detect and remove “/foo” because it no longer has anything in it. If something like that doesn’t already exist, I can handle removing the PrimSpecs but I need something to discover them.

I saw some references to “IsInert” in the code-base but so far haven’t found exactly what I’m looking for. Does anyone know an easy way to find empty-overs (Sdf, ideally)?

---

<div class="post-metadata">

**Author:** ![nostromo](https://avatars.discourse-cdn.com/v4/letter/n/9dc877/32.png) [@nostromo](https://forum.aousd.org/u/nostromo)\
**Post date:** [October 1, 2025, 1:37am UTC](https://forum.aousd.org/t/how-to-check-if-sdfprimspec-is-empty/2707/2 "2025-10-01T01:37:10Z")

</div>

Nevermind it was just prim\_spec.isInert. Not sure how I missed that one!
