One Logo Pool Ball
USDKit · IOS API REFERENCE

USDLayer

struct · iOS 27.0+ · SDK 27.1

struct USDLayer

Members (47)

get · iOS 27.0+

identifier

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

The layer's identifier — typically a file path, URL, or anonymous identifier string. Identifies the layer in OpenUSD's global registry.

method · iOS 27.0+

timeSample

TypeScript
timeSample(path: USDLayer_Path, time: USDLayer_TimeCode): (USDValue) | null
Swift declaration
func timeSample(at path: USDLayer.Path, time: USDLayer.TimeCode) -> USDValue?

Returns the time-sampled value for the attribute at the given path at the specified time, or `nil` if none is authored at that time. - Parameters: - path: The attribute path. - time: The time to query. - Returns: The authored sample, or `nil` if none exists at `time`.

get · iOS 27.0+

defaultPrim

TypeScript
get defaultPrim(): (USDToken) | null
Swift declaration
var defaultPrim: USDToken? { get nonmutating set }

The name of the layer's default prim — the prim referenced when this layer is included as a reference or payload without specifying a target. `nil` if not authored.

set · iOS 27.0+

defaultPrim

TypeScript
set defaultPrim(value: (USDToken) | null)
Swift declaration
var defaultPrim: USDToken? { get nonmutating set }

The name of the layer's default prim — the prim referenced when this layer is included as a reference or payload without specifying a target. `nil` if not authored.

get · iOS 27.0+

description

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

A textual representation of this instance. Calling this property directly is discouraged. Instead, convert an instance of any type to a string by using the `String(describing:)` initializer. This initializer works with any type, and uses the custom `description` property for types that conform to `CustomStringConvertible`: struct Point: CustomStringConvertible { let x: Int, y: Int var description: String { return "(\(x), \(y))" } } let p = Point(x: 21, y: 30) let s = String(describing: p) print(s) // Prints "(21, 30)" The conversion of `p` to a string in the assignment to `s` uses the `Point` type's `description` property.

init · iOS 27.0+

init

TypeScript
static init(displayName?: (string) | null): USDLayer
Swift declaration
init(displayName: String? = nil) throws

Creates an anonymous, in-memory layer. Anonymous layers have no file backing. - Parameter displayName: A non-unique hint shown in debug output and logs. - Throws: An error if the layer cannot be created.

get · iOS 27.0+

displayName

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

A human-readable name for the layer, derived from its identifier. Suitable for display in UI.

get · iOS 27.0+

endTimeCode

TypeScript
get endTimeCode(): (USDLayer_TimeCode) | null
Swift declaration
var endTimeCode: USDLayer.TimeCode? { get nonmutating set }

The last time code in the layer's animation range. `nil` if not authored.

set · iOS 27.0+

endTimeCode

TypeScript
set endTimeCode(value: (USDLayer_TimeCode) | null)
Swift declaration
var endTimeCode: USDLayer.TimeCode? { get nonmutating set }

The last time code in the layer's animation range. `nil` if not authored.

get · iOS 27.0+

isAnonymous

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

Whether the layer is anonymous (in-memory, no file backing).

method · iOS 27.0+

timeSamples

TypeScript
timeSamples(path: USDLayer_Path): Array<USDLayer_TimeCode>
Swift declaration
func timeSamples(at path: USDLayer.Path) -> Set<USDLayer.TimeCode>

Returns the time codes for which the attribute at the given path has authored time samples. - Parameter path: The attribute path. - Returns: The set of authored time codes.

method · iOS 27.0+

relationship

TypeScript
relationship(path: USDLayer_Path): (USDPrim_Relationship_Spec) | null
Swift declaration
func relationship(at path: USDLayer.Path) -> USDPrim.Relationship.Spec?

Returns the relationship spec at the given path. - Parameter path: The path to look up. - Returns: The relationship spec, or `nil` if none is authored at `path`.

get · iOS 27.0+

resolvedPath

TypeScript
get resolvedPath(): (_System_FilePath) | null
Swift declaration
var resolvedPath: FilePath? { get }

The resolved filesystem location of the layer's source, or `nil` for anonymous layers.

method · iOS 27.0+

setTimeSample

TypeScript
setTimeSampleAtTimeValue(path: USDLayer_Path, time: USDLayer_TimeCode, value: USDValue): void
Swift declaration
func setTimeSample(at path: USDLayer.Path, time: USDLayer.TimeCode, value: USDValue)

Sets the time-sampled value for the attribute at the given path at the specified time. - Parameters: - path: The attribute path. - time: The time at which to author. - value: The new sample value.

method · iOS 27.0+

setTimeSample

TypeScript
setTimeSampleAtTimeValue99996(path: USDLayer_Path, time: USDLayer_TimeCode, value: number): void
Swift declaration
func setTimeSample<T>(at path: USDLayer.Path, time: USDLayer.TimeCode, value: T) where T : USDValueProtocol

Sets the time-sampled value for the attribute at the given path at the specified time, wrapping the typed value in a `USDValue`. - Parameters: - path: The attribute path. - time: The time at which to author. - value: The typed sample value.

get · iOS 27.0+

startTimeCode

TypeScript
get startTimeCode(): (USDLayer_TimeCode) | null
Swift declaration
var startTimeCode: USDLayer.TimeCode? { get nonmutating set }

The first time code in the layer's animation range. `nil` if not authored.

set · iOS 27.0+

startTimeCode

TypeScript
set startTimeCode(value: (USDLayer_TimeCode) | null)
Swift declaration
var startTimeCode: USDLayer.TimeCode? { get nonmutating set }

The first time code in the layer's animation range. `nil` if not authored.

get · iOS 27.0+

subLayerPaths

TypeScript
get subLayerPaths(): Array<USDLayer_AssetPath>
Swift declaration
var subLayerPaths: [USDLayer.AssetPath] { get nonmutating set }

The asset paths of the layer's sublayers, ordered from strongest to weakest opinion.

set · iOS 27.0+

subLayerPaths

TypeScript
set subLayerPaths(value: Array<USDLayer_AssetPath>)
Swift declaration
var subLayerPaths: [USDLayer.AssetPath] { get nonmutating set }

The asset paths of the layer's sublayers, ordered from strongest to weakest opinion.

get · iOS 27.0+

allTimeSamples

TypeScript
get allTimeSamples(): Array<USDLayer_TimeCode>
Swift declaration
var allTimeSamples: Set<USDLayer.TimeCode> { get }

All time codes for which any attribute in the layer has an authored time sample.

method · iOS 27.0+

importContents

TypeScript
importContentsFrom(path: _System_FilePath): void
Swift declaration
func importContents(from path: FilePath) throws

Replaces the layer's contents with the layer file at the given path. - Parameter path: The path of the layer file to read. - Throws: An error if the file cannot be read or parsed.

method · iOS 27.0+

importContents

TypeScript
importContentsFrom88962(string: string): void
Swift declaration
func importContents(from string: String) throws

Replaces the layer's contents with the USDA string. - Parameter string: The USDA source to import. - Throws: An error if the string cannot be parsed.

method · iOS 27.0+

eraseTimeSample

TypeScript
eraseTimeSample(path: USDLayer_Path, time: USDLayer_TimeCode): void
Swift declaration
func eraseTimeSample(at path: USDLayer.Path, time: USDLayer.TimeCode)

Erases the authored time sample at the given path and time. - Parameters: - path: The attribute path. - time: The time of the sample to erase.

get · iOS 27.0+

timeCodesPerSecond

TypeScript
get timeCodesPerSecond(): (number) | null
Swift declaration
var timeCodesPerSecond: Double? { get nonmutating set }

The rate at which time codes advance per second. `nil` if not authored.

set · iOS 27.0+

timeCodesPerSecond

TypeScript
set timeCodesPerSecond(value: (number) | null)
Swift declaration
var timeCodesPerSecond: Double? { get nonmutating set }

The rate at which time codes advance per second. `nil` if not authored.

method · iOS 27.0+

copy

TypeScript
copy(srcPath: USDLayer_Path, dstPath: USDLayer_Path, dstLayer?: (USDLayer) | null): boolean
Swift declaration
@discardableResult func copy(from srcPath: USDLayer.Path, to dstPath: USDLayer.Path, in dstLayer: USDLayer? = nil) -> Bool

Copies the spec at `srcPath` in this layer (and its children) to `dstPath`. - Parameters: - srcPath: The path of the source spec to copy. - dstPath: The destination path. - dstLayer: The destination layer. Pass `nil` to copy within this layer. - Returns: `true` on success.

static · iOS 27.0+

find

TypeScript
static find(identifier: string): (USDLayer) | null
Swift declaration
static func find(identifier: String) -> USDLayer?

Returns an already-loaded layer with this identifier, or `nil` if none is loaded. Does no I/O. - Parameter identifier: The layer identifier to look up. - Returns: The matching layer, or `nil` if none is loaded.

static · iOS 27.0+

open

TypeScript
static open(identifier: string, options?: USDLayer_OpenOptions): USDLayer
Swift declaration
static func open(_ identifier: String, options: USDLayer.OpenOptions = []) throws -> USDLayer

Returns an already-loaded layer at the identifier, or opens it from the resolved asset path. - Parameters: - identifier: The layer identifier — typically a file path, URL, or anonymous identifier. - options: Pass `.createNew` to create a fresh layer, overwriting any existing file at the identifier. - Returns: The opened layer. - Throws: An error if the layer cannot be opened or created.

method · iOS 27.0+

prim

TypeScript
prim(path: USDLayer_Path): (USDPrim_Spec) | null
Swift declaration
func prim(at path: USDLayer.Path) -> USDPrim.Spec?

Returns the prim spec authored at the given path, or `nil` if no prim spec exists there. - Parameter path: The path to look up. - Returns: The prim spec at `path`, or `nil` if none exists.

method · iOS 27.0+

save

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

Saves the layer to its source if it has unsaved changes. - Throws: An error if the layer cannot be saved.

method · iOS 27.0+

spec

TypeScript
spec(path: USDLayer_Path): (USDLayer_Spec) | null
Swift declaration
func spec(at path: USDLayer.Path) -> USDLayer.Spec?

Returns the spec at the given path, or `nil` if no spec is authored there. - Parameter path: The path to look up. - Returns: The spec at `path`, or `nil` if none exists.

method · iOS 27.0+

clear

TypeScript
clear(): void
Swift declaration
func clear()

Removes all in-memory content from the layer. The file on disk is unaffected until ``save()`` is called.

method · iOS 27.0+

field

TypeScript
field(path: USDLayer_Path, name: USDToken): (USDValue) | null
Swift declaration
func field(at path: USDLayer.Path, name: USDToken) -> USDValue?

Returns the value of the named field at the given path, or `nil` if no such field is authored. - Parameters: - path: The path to look up. - name: The field name. - Returns: The field's value, or `nil` if unauthored.

method · iOS 27.0+

export

TypeScript
exportTo(url: string): void
Swift declaration
func export(to url: URL) throws

Writes the layer's contents to a file at the given URL. - Parameter url: The destination file URL. - Throws: An error if the layer cannot be written.

method · iOS 27.0+

export

TypeScript
exportTo63861(path: _System_FilePath): void
Swift declaration
func export(to path: FilePath) throws

Writes the layer's contents to a file at the given path. - Parameter path: The destination file path. - Throws: An error if the layer cannot be written.

method · iOS 27.0+

fields

TypeScript
fields(path: USDLayer_Path): Array<USDToken>
Swift declaration
func fields(at path: USDLayer.Path) -> [USDToken]

Returns the names of the fields authored at the given path. - Parameter path: The path to look up. - Returns: The names of the authored fields.

method · iOS 27.0+

reload

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

Reloads the layer from its source, discarding any unsaved changes. - Throws: An error if the layer cannot be reloaded.

get · iOS 27.0+

isDirty

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

Whether the layer has unsaved changes.

get · iOS 27.0+

isMuted

TypeScript
get isMuted(): boolean
Swift declaration
var isMuted: Bool { get nonmutating set }

Whether the layer is muted from composition.

set · iOS 27.0+

isMuted

TypeScript
set isMuted(value: boolean)
Swift declaration
var isMuted: Bool { get nonmutating set }

Whether the layer is muted from composition.

get · iOS 27.0+

isValid

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

Whether the layer is still valid. Returns `false` if the underlying data has been released.

method · iOS 27.0+

property

TypeScript
property(path: USDLayer_Path): (USDPrim_Property_Spec) | null
Swift declaration
func property(at path: USDLayer.Path) -> USDPrim.Property.Spec?

Returns the property spec at the given path. - Parameter path: The path to look up. - Returns: The property spec, or `nil` if none is authored at `path`.

method · iOS 27.0+

setField

TypeScript
setFieldAtNameValue(path: USDLayer_Path, name: USDToken, value: USDValue): void
Swift declaration
func setField(at path: USDLayer.Path, name: USDToken, value: USDValue)

Sets the value of the named field at the given path. - Parameters: - path: The path of the spec to update. - name: The field name. - value: The new field value.

method · iOS 27.0+

setField

TypeScript
setFieldAtNameValue77907(path: USDLayer_Path, name: USDToken, value: number): void
Swift declaration
func setField<T>(at path: USDLayer.Path, name: USDToken, value: T) where T : USDValueProtocol

Sets the value of the named field at the given path, wrapping the typed value in a `USDValue`. - Parameters: - path: The path of the spec to update. - name: The field name. - value: The typed value to store.

method · iOS 27.0+

specType

TypeScript
specType(path: USDLayer_Path): (USDLayer_SpecType) | null
Swift declaration
func specType(at path: USDLayer.Path) -> USDLayer.SpecType?

Returns the kind of spec authored at the given path, or `nil` if nothing is authored there. - Parameter path: The path to look up. - Returns: The spec type at `path`, or `nil` if no spec is authored.

method · iOS 27.0+

traverse

TypeScript
traverse(path: USDLayer_Path, body: ((arg0: USDLayer_Path) => void)): void
Swift declaration
func traverse(at path: USDLayer.Path, _ body: (USDLayer.Path) -> Void)

Walks the spec tree rooted at the given path, calling `body` for each spec's path. - Parameters: - path: The root path to traverse from. - body: A closure invoked once per visited path.

method · iOS 27.0+

attribute

TypeScript
attribute(path: USDLayer_Path): (USDPrim_Attribute_Spec) | null
Swift declaration
func attribute(at path: USDLayer.Path) -> USDPrim.Attribute.Spec?

Returns the attribute spec at the given path. - Parameter path: The path to look up. - Returns: The attribute spec, or `nil` if none is authored at `path`.

Skipped declarations

No declarations were skipped in this snapshot.

All USDKit types →