Development note · Custom Component

The complete set of supported custom component field types is bounded by OpenUSD's finite type system, not Swift's infinite one.

by elkraneo · 2026-04-17

OpenUSD has a closed, enumerable set of SdfValueTypeNames. Swift's type system is open-ended and Turing-complete. RCP cannot support all Swift types — it supports the USD-serializable subset: Swift types that map directly to SdfValueTypeNames, plus special cases like enums, arrays, and optionals.

Metadata

  • Component: Custom Component
  • Status: confirmed
  • Confidence: high
  • Evidence type: inference
  • Scope: USDA authored
  • Author: elkraneo
  • Date: 2026-04-17
  • RCP version: 26.4
  • Xcode build: Xcode 26.4 (17C529)

Reproduction

  1. Enumerate all SdfValueTypeNames from the OpenUSD specification (bool, int8-uint64, half/float/double, string/token/asset, vec2-4, quat, mat2-4, timecode, rel, arrays).
  2. Enumerate Swift's type categories (primitives, standard library, user-defined, generic, function types, protocol existentials).
  3. Observe that OpenUSD types are finite (~40 base types) while Swift types are infinite.
  4. Intersect empirically: compile custom components with each Swift type in RCP and observe which ones survive codegen.
  5. Confirm that supported types correspond 1:1 with SdfValueTypeNames mappings.

Evidence

Details

OpenUSD Types: Finite and Documented

OpenUSD has a closed, well-documented set of SdfValueTypeNames. The core types are:

CategoryTypes
Boolbool
Integersint8, int16, int32, int64, uint8, uint16, uint32, uint64
Floatshalf (16-bit), float, double
Stringsstring, token, asset
Vectorsvec2h/f/d/i, vec3h/f/d/i, vec4h/f/d/i
Quaternionsquath, quatf, quatd
Matricesmat2d, mat3d, mat4d
Specialframe4d, timecode, rel, arrays of all above

Plus USD-specific concepts like path, variantset, etc.

Swift Types: Infinite

Swift has a Turing-complete type system — you can write code that generates new types at compile time:

CategoryExamples
Built-in primitivesBool, Int, Float, String, etc.
Standard libraryArray, Dictionary, Optional, URL, UUID, Date, Data
User-definedstructs, enums, classes — infinitely many
Generic typesArray<T>, Optional<T> — also infinite
Functionsclosures, function types
Existentialsprotocol existentials

The Critical Realization

This means RCP cannot support “all Swift types” — it must be doing one of these:

ApproachDescription
WhitelistOnly specific Swift types allowed, everything else rejected at compile-time
USD-serializable subsetOnly types that map to OpenUSD SdfValueTypeNames work
Codable derivationUses Swift’s Codable synthesis, but only for types whose encoded form maps to USD types

Since OpenUSD types are finite and known, the complete list of supported custom component types is bounded by OpenUSD’s type system, not Swift’s.

RCP likely supports exactly those Swift types that have a direct mapping to OpenUSD SdfValueTypeNames, plus some special cases like:

Swift TypeUSD Mapping
Custom enumstoken or string
ArraysUSD arrays
Optionalsnullable values