One Logo Pool Ball
USDKit · IOS API REFERENCE

USDPrim.VariantSet

struct · iOS 27.0+ · SDK 27.1

struct VariantSet

Represents a single variant set on a prim. `USDPrim.VariantSet` provides methods to add variants, query available variants, and control which variant is currently selected. Each variant set contains named variants that represent different configurations of the prim's data.

Members (11)

method · iOS 27.0+

setSelection

TypeScript
setSelection(variantName: string): void
Swift declaration
func setSelection(_ variantName: String) throws

Sets the variant selection. - Parameter variantName: The name of the variant to select. - Throws: An error if the selection cannot be set.

get · iOS 27.0+

variantNames

TypeScript
get variantNames(): Array<string>
Swift declaration
var variantNames: [String] { get }

The names of all variants in this variant set.

method · iOS 27.0+

blockSelection

TypeScript
blockSelection(): void
Swift declaration
func blockSelection() throws

Blocks the variant selection by authoring an explicit empty value on the current edit target. - Throws: An error if the selection cannot be blocked.

method · iOS 27.0+

clearSelection

TypeScript
clearSelection(): void
Swift declaration
func clearSelection() throws

Clears the variant selection. - Throws: An error if the selection cannot be cleared.

method · iOS 27.0+

withEditTarget

TypeScript
withEditTarget(layer: (USDLayer) | null, body: ((arg0: USDStage_EditTarget) => unknown)): unknown
Swift declaration
func withEditTarget<R>(layer: USDLayer? = nil, _ body: (USDStage.EditTarget) throws -> R) rethrows -> R

Performs the closure with the stage's edit target set to author into the currently selected variant. The previous edit target is restored when the closure returns. - Parameters: - layer: The layer to target, or `nil` for the current edit target's layer. - body: A closure that performs edits within the variant. - Returns: The value returned by `body`. - Throws: Errors from `body` are rethrown.

get · iOS 27.0+

authoredSelection

TypeScript
get authoredSelection(): (string) | null
Swift declaration
var authoredSelection: String? { get }

The authored variant selection, or `nil` if none is authored.

method · iOS 27.0+

add

TypeScript
add(variantName: string): void
Swift declaration
func add(_ variantName: String) throws

Adds a new variant to this variant set. - Parameter variantName: The name of the variant to add. - Throws: An error if the variant cannot be added.

get · iOS 27.0+

name

TypeScript
get name(): string
Swift declaration
var name: String { get }

The name of this variant set.

get · iOS 27.0+

prim

TypeScript
get prim(): USDPrim
Swift declaration
var prim: USDPrim { get }

The prim that owns this variant set.

get · iOS 27.0+

isValid

TypeScript
get isValid(): boolean
Swift declaration
var isValid: Bool { get }

A Boolean value indicating whether this variant set is valid.

get · iOS 27.0+

selection

TypeScript
get selection(): (string) | null
Swift declaration
var selection: String? { get }

The currently selected variant name, or `nil` if no selection composes.

Skipped declarations

No declarations were skipped in this snapshot.

All USDKit types →