<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/AnimationResource/generate(with:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation17AnimationResourceC8generate4withAcA0C10Definition_p_tKFZ"
  },
  "title" : "generate(with:)"
}
-->

# generate(with:)

Creates an animation resource from a definition.

```
@MainActor @preconcurrency static func generate(with definition: any AnimationDefinition) throws -> AnimationResource
```

## Parameters

`definition`

The configuration of a timeframe and visual semantics from
which to generate an animation resource.

## Return Value

An animation resource that shares the configuration of the definition.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)