# UAR51SkeletonMapping

<Badge tone="type">UCLASS · UDataAsset</Badge> <Badge>BlueprintType</Badge> <Badge>data asset</Badge>

```cpp
UCLASS(BlueprintType)
class AR51SDK_API UAR51SkeletonMapping : public UDataAsset
```

**Inherits:** [`UDataAsset`](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/Engine/UDataAsset) *(Unreal Engine)*

A reusable per-skeleton bone mapping, authored in the AR 51 humanoid mapping editor. It maps each **canonical AR 51 bone name** to a bone on your target skeleton, plus the forearm twist chains. One asset is shared by every [`UAR51Character`](/docs/sdk-api/unreal-api/classes/uar51character) that drives the same skeleton, and it replaces the legacy `UNodeMappingContainer` workflow.

:::tip[How-to]
This page is **reference** (facts only). For the step-by-step *author a mapping asset → drive a character* walkthrough, see the [How-to guide](/docs/sdk-api/unreal-api/skeletons-and-characters#walkthrough).
:::

## Properties

All `EditAnywhere, BlueprintReadWrite`, Category `"AR51 Mapping"` (except where noted).

<div className="apiPropTable">

| Property | Type | Default | Description |
|---|---|---|---|
| **Mapping** | | | |
| `TargetSkeleton` | [`TSoftObjectPtr<USkeleton>`](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/Animation/USkeleton) | — | the skeleton this mapping targets; drives the editor bone picker |
| `BoneMap` | `TMap<FName,FName>` | — | canonical AR 51 bone name → target skeleton bone name |
| **Twist** | | | |
| `LeftForearmTwistBones` | [`TArray<FBoneWeight>`](/docs/sdk-api/unreal-api/skeletons-and-characters#fboneweight) | — | left forearm twist bones + blend weights (Category `…\|Twist`) |
| `RightForearmTwistBones` | [`TArray<FBoneWeight>`](/docs/sdk-api/unreal-api/skeletons-and-characters#fboneweight) | — | right forearm twist bones + blend weights (Category `…\|Twist`) |
| **Editor** | | | |
| `EditorSelectedBone` | `FName` | `NAME_None` | `Transient` — editor-only selection channel; not serialized |

</div>

## Method summary

**Instance** — all plain C++ (no `UFUNCTION`).

| Method | Returns | |
|---|---|---|
| [`GetTargetToSourceMappingTable`](#gettargettosourcemappingtable) | `void` | <Badge>C++ only</Badge> |
| [`GetMappedBone`](#getmappedbone) | `FName` | <Badge>C++ only</Badge> |
| [`IsBoneMapped`](#isbonemapped) | `bool` | <Badge>C++ only</Badge> |
| [`AutoMap`](#automap) | `void` | <Badge>C++ only</Badge> |
| [`GuessBone` / `GuessTwistBone`](#guessbone) | `FName` | <Badge>C++ only</Badge> |
| [`ClearMapping`](#clearmapping) | `void` | <Badge>C++ only</Badge> |
| [`GetValidationSummary`](#getvalidationsummary) | `void` | <Badge>C++ only</Badge> |

→ Full descriptions in [Method details](#method-details) below.

## Events

:::note[Editor only — not for game runtime]
`FOnAR51EditorBoneSelected OnEditorBoneSelected` is a multicast delegate with signature `(FName)` that syncs bone selection across mapping-editor panels. It is **not serialized** and exists only to drive the in-editor mapping UI. Do not bind it from gameplay code.
:::

## Method details

### GetTargetToSourceMappingTable

<ApiBody kind="method" tags="C++ only">

```cpp
void GetTargetToSourceMappingTable(TMap<FName, FName>& Out) const;
```

Fills `Out` with the canonical AR 51 → target skeleton bone table. Mirrors the old `UNodeMappingContainer` API, so existing retarget code can read the mapping the same way.

<Params>
<Param name="Out" type="TMap<FName, FName>&">receives the canonical → target bone pairs (cleared/overwritten by the call)</Param>
</Params>

</ApiBody>

### GetMappedBone

<ApiBody kind="method" tags="C++ only">

```cpp
FName GetMappedBone(FName CanonicalBone) const;
```

Resolves one canonical AR 51 bone to its target skeleton bone.

<Params>
<Param name="CanonicalBone" type="FName">a canonical AR 51 bone name</Param>
</Params>

<Returns type="FName">the mapped target bone, or `NAME_None` if that canonical bone is not mapped</Returns>

</ApiBody>

### IsBoneMapped

<ApiBody kind="method" tags="C++ only">

```cpp
bool IsBoneMapped(FName CanonicalBone) const;
```

<Params>
<Param name="CanonicalBone" type="FName">a canonical AR 51 bone name</Param>
</Params>

<Returns type="bool">`true` if `CanonicalBone` has a target bone in `BoneMap`</Returns>

</ApiBody>

### AutoMap

<ApiBody kind="method" tags="C++ only">

```cpp
void AutoMap();
```

Auto-fills `BoneMap` and the forearm twist arrays from `TargetSkeleton`, using bone-name and hierarchy heuristics. This is the same action the mapping editor's auto-map button runs. Set `TargetSkeleton` first; `AutoMap` overwrites the existing mapping. After running it, confirm the result with [`GetValidationSummary`](#getvalidationsummary) — heuristics will miss non-standard bone names, which you then fix by hand.

<Example inferred>

```cpp
// Build a mapping for a skeleton from C++ (e.g. an editor utility)
UAR51SkeletonMapping* Mapping = NewObject<UAR51SkeletonMapping>();
Mapping->TargetSkeleton = MySkeleton;          // TSoftObjectPtr<USkeleton>
Mapping->AutoMap();                            // best-effort fill from bone names + hierarchy

int32 Mapped, Missing, Invalid;
Mapping->GetValidationSummary(Mapped, Missing, Invalid);
if (Missing > 0 || Invalid > 0)
    UE_LOG(LogTemp, Warning,
        TEXT("AutoMap left %d missing / %d invalid bones — finish in the mapping editor"),
        Missing, Invalid);
```

</Example>

</ApiBody>

### GuessBone

<ApiBody kind="method" tags="C++ only">

```cpp
FName GuessBone(FName CanonicalBone) const;
FName GuessTwistBone(bool bLeft, int32 Index) const;
```

Best-guess helpers that the mapping editor uses to pre-fill a single field — they return a *candidate* target bone without modifying `BoneMap`. `GuessBone` proposes a target bone for one canonical bone; `GuessTwistBone` proposes the `Index`-th forearm twist bone for the left (`bLeft = true`) or right arm. Both return `NAME_None` if no plausible match is found.

<Params>
<Param name="CanonicalBone" type="FName">canonical AR 51 bone to find a candidate for (`GuessBone`)</Param>
<Param name="bLeft" type="bool">`true` for the left forearm, `false` for the right (`GuessTwistBone`)</Param>
<Param name="Index" type="int32">twist-chain position, from base outward (`GuessTwistBone`)</Param>
</Params>

<Returns type="FName">the guessed target bone, or `NAME_None`</Returns>

</ApiBody>

### ClearMapping

<ApiBody kind="method" tags="C++ only">

```cpp
void ClearMapping();
```

Empties `BoneMap` and the forearm twist arrays. `TargetSkeleton` is left untouched, so you can re-run [`AutoMap`](#automap) or re-author from scratch against the same skeleton.

</ApiBody>

### GetValidationSummary

<ApiBody kind="method" tags="C++ only">

```cpp
void GetValidationSummary(int32& OutMapped, int32& OutMissing, int32& OutInvalid) const;
```

Reports mapping health as three counts, so tooling can show a status badge or block use of a broken asset. A mapping is ready when `OutMissing` and `OutInvalid` are both `0`.

<Params>
<Param name="OutMapped" type="int32&">canonical bones with a valid target bone</Param>
<Param name="OutMissing" type="int32&">canonical bones with no target assigned</Param>
<Param name="OutInvalid" type="int32&">entries whose target bone is not present on `TargetSkeleton`</Param>
</Params>

<Example inferred>

```cpp
int32 Mapped, Missing, Invalid;
Mapping->GetValidationSummary(Mapped, Missing, Invalid);

const bool bReady = (Missing == 0 && Invalid == 0);
UE_LOG(LogTemp, Log, TEXT("Mapping %s: %d mapped, %d missing, %d invalid"),
    bReady ? TEXT("OK") : TEXT("INCOMPLETE"), Mapped, Missing, Invalid);
```

</Example>

</ApiBody>

## See also

- [`UAR51Character`](/docs/sdk-api/unreal-api/classes/uar51character) — the mocap-driven mesh that consumes this mapping to retarget its skeleton
- [`AAR51CharacterActor`](/docs/sdk-api/unreal-api/classes/aar51characteractor) — the character actor whose `UAR51Character` uses the mapping
- [`FBoneWeight`](/docs/sdk-api/unreal-api/skeletons-and-characters#fboneweight) — the bone + blend-weight entry stored in the twist arrays
- [Class index](/docs/sdk-api/unreal-api/classes) — all Unreal SDK types
- How-to: [author a mapping asset → drive a character](/docs/sdk-api/unreal-api/skeletons-and-characters#walkthrough)
