Contents

RetargetingConfiguration

A configuration for retargeting skeletal animations between different skeletons.

Declaration

@MainActor class RetargetingConfiguration

Overview

RetargetingConfiguration enables the transfer of animations from one skeleton to another, automatically mapping joints and adapting poses to accommodate different skeletal structures. This is particularly useful for applying animations across different character models or creatures.

Usage

Create configurations using the static factory methods for common skeleton types:

Example

do {
    // Basic biped retargeting
    let config = try RetargetingConfiguration.automatchBiped(
        sourceCharacterSkeleton,
        to: targetCharacterSkeleton
    )

    // With joint offset adjustments applied during configuration creation
    let jointOffsets: [String: simd_quatf] = [
        "LeftShoulder": simd_quatf(angle: 0.1, axis: simd_float3(0, 1, 0)),
        "RightShoulder": simd_quatf(angle: -0.1, axis: simd_float3(0, 1, 0))
    ]
    let configWithOffsets = try RetargetingConfiguration.automatchBiped(
        sourceCharacterSkeleton,
        to: targetCharacterSkeleton,
        jointOffsets: jointOffsets
    )
} catch {
    print("Failed to create retargeting configuration: \(error.localizedDescription)")
}

Performance Considerations

  • Configuration creation is computationally expensive and should be cached when possible.

  • The automatic matching algorithm analyzes skeleton hierarchies to establish joint correspondences.

  • Joint offsets are baked into the configuration during creation, not applied at runtime.

Topics

Creating a configuration

Accessing the skeletons

See Also

Skeletons and retargeting