# Schema Type Introspection/Reflection

**URL:** https://forum.aousd.org/t/schema-type-introspection-reflection/1424
**Category:** USD
**Created:** [April 5, 2024, 5:14am UTC](https://forum.aousd.org/t/schema-type-introspection-reflection/1424 "2024-04-05T05:14:12Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![heeen](https://avatars.discourse-cdn.com/v4/letter/h/ce7236/32.png) [@heeen](https://forum.aousd.org/u/heeen)
#### Post date: [April 5, 2024, 5:14am UTC](https://forum.aousd.org/t/schema-type-introspection-reflection/1424/1 "2024-04-05T05:14:13Z")

</div>

Is there a way to reflect on schema types brought in from a (codeless) plugin?

it seems like UsdSchemaBase::GetSchemaAttributeNames is implemented by each specific type and as a codeless schema does not implement it, there is just no way to list its attributes?  
Also it seems like UsdSchemaBase::GetSchemaAttributeNames requires a prim instance to work with, I would have expected TfType to have a way to inspect each baseType or ancestor.

Am I missing something here?

---

<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: [April 5, 2024, 6:18am UTC](https://forum.aousd.org/t/schema-type-introspection-reflection/1424/2 "2024-04-05T06:18:34Z")

</div>

`GetSchemaAttributeNames()` is an unfortunate carryover from very early days that has a number of deficiencies, and we’d like to deprecate it at some point.

You can get much more comprehensive knowledge about _any_ single schema **or** the totality of all schemas applied to a prim – codeless or code-ful --, by using the [UsdSchemaRegistry](https://openusd.org/release/api/class_usd_schema_registry.html) to fetch a [UsdPrimDefinition](https://openusd.org/release/api/class_usd_prim_definition.html), from which you can query information about all the properties and builtin applied schemas of the schema(s).

The one thing lacking in the UsdSchemaRegistry/UsdPrimDefinition setup is the separation of immediate vs inherited properties in a schema. The SchemaRegistry does not track which properties are inherited, whereas GetSchemaAttributeNames() by default returns only the immediate attribute names, and some of our clients rely on that information.
