---
title: BlendTreeSourceNode
framework: realitykit
role: symbol
role_heading: Structure
path: realitykit/blendtreesourcenode
---

# BlendTreeSourceNode

A blend node that contains an animation.

## Declaration

```swift
struct BlendTreeSourceNode
```

## Overview

Overview This structure adopts BlendTreeNode and adds the ability to store a single animation. A complete BlendTreeAnimation represents a mix of all the animations that its source nodes contain. Each source node defines a weight that determines how much effect the source’s animation has in the blend tree’s resulting, mixed animation. To define the source’s animation, set this structure’s source property. Access a source node of a blend tree A source may exist in any leaf-node position in the blend animation’s tree. The following code checks the root node for a source. If instead the root node is a branch, the code begins checking the branches sources. // Check if the root node is a source. if let blendNode = blendTree.root as? BlendTreeSourceNode {     // Found a source.

// Check if the root node is a branch. } else if let source = blendTree.root as? BlendTreeBlendNode {

// Check for a source in the branch's sources.         if let source = blendNode.sources[0] as? BlendTreeSourceNode {             // Found a source.         }     } }

## Topics

### Creating a blend tree animation node

- [init(source:name:weight:)](realitykit/blendtreesourcenode/init(source:name:weight:).md)

### Configuring a blend tree animation node

- [name](realitykit/blendtreesourcenode/name.md)
- [source](realitykit/blendtreesourcenode/source.md)
- [weight](realitykit/blendtreesourcenode/weight.md)

## Relationships

### Conforms To

- [BlendTreeNode](realitykit/blendtreenode.md)

## See Also

### Blend trees

- [BlendTreeAnimation](realitykit/blendtreeanimation.md)
- [BlendTreeNode](realitykit/blendtreenode.md)
- [BlendTreeBlendNode](realitykit/blendtreeblendnode.md)
- [BlendTreeInvalidNode](realitykit/blendtreeinvalidnode.md)
- [BlendWeight](realitykit/blendweight.md)
