identifier
TypeScriptget identifier(): stringSwift declarationvar identifier: String { get }The layer's identifier — typically a file path, URL, or anonymous identifier string. Identifies the layer in OpenUSD's global registry.
struct · iOS 27.0+ · SDK 27.1
struct USDLayerget identifier(): stringSwift declarationvar identifier: String { get }The layer's identifier — typically a file path, URL, or anonymous identifier string. Identifies the layer in OpenUSD's global registry.
timeSample(path: USDLayer_Path, time: USDLayer_TimeCode): (USDValue) | nullSwift declarationfunc 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 defaultPrim(): (USDToken) | nullSwift declarationvar 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 defaultPrim(value: (USDToken) | null)Swift declarationvar 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 description(): stringSwift declarationvar 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.
static init(displayName?: (string) | null): USDLayerSwift declarationinit(displayName: String? = nil) throwsCreates 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 displayName(): stringSwift declarationvar displayName: String { get }A human-readable name for the layer, derived from its identifier. Suitable for display in UI.
get endTimeCode(): (USDLayer_TimeCode) | nullSwift declarationvar endTimeCode: USDLayer.TimeCode? { get nonmutating set }The last time code in the layer's animation range. `nil` if not authored.
set endTimeCode(value: (USDLayer_TimeCode) | null)Swift declarationvar endTimeCode: USDLayer.TimeCode? { get nonmutating set }The last time code in the layer's animation range. `nil` if not authored.
get isAnonymous(): booleanSwift declarationvar isAnonymous: Bool { get }Whether the layer is anonymous (in-memory, no file backing).
timeSamples(path: USDLayer_Path): Array<USDLayer_TimeCode>Swift declarationfunc 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.
relationship(path: USDLayer_Path): (USDPrim_Relationship_Spec) | nullSwift declarationfunc 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 resolvedPath(): (_System_FilePath) | nullSwift declarationvar resolvedPath: FilePath? { get }The resolved filesystem location of the layer's source, or `nil` for anonymous layers.
setTimeSampleAtTimeValue(path: USDLayer_Path, time: USDLayer_TimeCode, value: USDValue): voidSwift declarationfunc 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.
setTimeSampleAtTimeValue99996(path: USDLayer_Path, time: USDLayer_TimeCode, value: number): voidSwift declarationfunc setTimeSample<T>(at path: USDLayer.Path, time: USDLayer.TimeCode, value: T) where T : USDValueProtocolSets 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 startTimeCode(): (USDLayer_TimeCode) | nullSwift declarationvar startTimeCode: USDLayer.TimeCode? { get nonmutating set }The first time code in the layer's animation range. `nil` if not authored.
set startTimeCode(value: (USDLayer_TimeCode) | null)Swift declarationvar startTimeCode: USDLayer.TimeCode? { get nonmutating set }The first time code in the layer's animation range. `nil` if not authored.
get subLayerPaths(): Array<USDLayer_AssetPath>Swift declarationvar subLayerPaths: [USDLayer.AssetPath] { get nonmutating set }The asset paths of the layer's sublayers, ordered from strongest to weakest opinion.
set subLayerPaths(value: Array<USDLayer_AssetPath>)Swift declarationvar subLayerPaths: [USDLayer.AssetPath] { get nonmutating set }The asset paths of the layer's sublayers, ordered from strongest to weakest opinion.
get allTimeSamples(): Array<USDLayer_TimeCode>Swift declarationvar allTimeSamples: Set<USDLayer.TimeCode> { get }All time codes for which any attribute in the layer has an authored time sample.
importContentsFrom(path: _System_FilePath): voidSwift declarationfunc importContents(from path: FilePath) throwsReplaces 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.
importContentsFrom88962(string: string): voidSwift declarationfunc importContents(from string: String) throwsReplaces the layer's contents with the USDA string. - Parameter string: The USDA source to import. - Throws: An error if the string cannot be parsed.
eraseTimeSample(path: USDLayer_Path, time: USDLayer_TimeCode): voidSwift declarationfunc 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 timeCodesPerSecond(): (number) | nullSwift declarationvar timeCodesPerSecond: Double? { get nonmutating set }The rate at which time codes advance per second. `nil` if not authored.
set timeCodesPerSecond(value: (number) | null)Swift declarationvar timeCodesPerSecond: Double? { get nonmutating set }The rate at which time codes advance per second. `nil` if not authored.
copy(srcPath: USDLayer_Path, dstPath: USDLayer_Path, dstLayer?: (USDLayer) | null): booleanSwift declaration@discardableResult func copy(from srcPath: USDLayer.Path, to dstPath: USDLayer.Path, in dstLayer: USDLayer? = nil) -> BoolCopies 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 find(identifier: string): (USDLayer) | nullSwift declarationstatic 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 open(identifier: string, options?: USDLayer_OpenOptions): USDLayerSwift declarationstatic func open(_ identifier: String, options: USDLayer.OpenOptions = []) throws -> USDLayerReturns 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.
prim(path: USDLayer_Path): (USDPrim_Spec) | nullSwift declarationfunc 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.
save(): voidSwift declarationfunc save() throwsSaves the layer to its source if it has unsaved changes. - Throws: An error if the layer cannot be saved.
spec(path: USDLayer_Path): (USDLayer_Spec) | nullSwift declarationfunc 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.
clear(): voidSwift declarationfunc clear()Removes all in-memory content from the layer. The file on disk is unaffected until ``save()`` is called.
field(path: USDLayer_Path, name: USDToken): (USDValue) | nullSwift declarationfunc 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.
exportTo(url: string): voidSwift declarationfunc export(to url: URL) throwsWrites 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.
exportTo63861(path: _System_FilePath): voidSwift declarationfunc export(to path: FilePath) throwsWrites 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.
fields(path: USDLayer_Path): Array<USDToken>Swift declarationfunc 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.
reload(): voidSwift declarationfunc reload() throwsReloads the layer from its source, discarding any unsaved changes. - Throws: An error if the layer cannot be reloaded.
get isDirty(): booleanSwift declarationvar isDirty: Bool { get }Whether the layer has unsaved changes.
get isMuted(): booleanSwift declarationvar isMuted: Bool { get nonmutating set }Whether the layer is muted from composition.
set isMuted(value: boolean)Swift declarationvar isMuted: Bool { get nonmutating set }Whether the layer is muted from composition.
get isValid(): booleanSwift declarationvar isValid: Bool { get }Whether the layer is still valid. Returns `false` if the underlying data has been released.
property(path: USDLayer_Path): (USDPrim_Property_Spec) | nullSwift declarationfunc 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`.
setFieldAtNameValue(path: USDLayer_Path, name: USDToken, value: USDValue): voidSwift declarationfunc 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.
setFieldAtNameValue77907(path: USDLayer_Path, name: USDToken, value: number): voidSwift declarationfunc setField<T>(at path: USDLayer.Path, name: USDToken, value: T) where T : USDValueProtocolSets 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.
specType(path: USDLayer_Path): (USDLayer_SpecType) | nullSwift declarationfunc 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.
traverse(path: USDLayer_Path, body: ((arg0: USDLayer_Path) => void)): voidSwift declarationfunc 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.
attribute(path: USDLayer_Path): (USDPrim_Attribute_Spec) | nullSwift declarationfunc 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`.
No declarations were skipped in this snapshot.