# Animation Swapping

{% hint style="warning" %}
**Note:** You should already be familiar with creating & modifying .pak files, extracting assets with Fmodel, and working within Unreal Engine 4.26.
{% endhint %}

### Required tools

#### **Fmodel (Latest version)**

* **Installation**: Download from [Fmodel website](https://fmodel.app/).
* **Usage**: Browse and export game assets for further use.
* **Important:** In the settings ("Models"), Socket format should be set to "Don't Export Bone Sockets"

#### **Blender (3.5.0)**

* **Installation**: Download from [Blender website](https://download.blender.org/release/Blender3.5/).
* **Usage**: Model, animate, and export assets for Unreal Engine. Export models and animations in formats like FBX for compatibility with Unreal Engine.

#### **Unreal Engine (4.26)**

* **Installation**: Download via Epic Games Launcher from Unreal Engine website.
* **Usage**: Import or replace assets, use Blueprints or C++ for game logic.

### Required files

#### Unreal Engine 4 Animation Project Template

{% file src="<https://2113171739-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYk8wH56PJnY0Bbtn6Jyi%2Fuploads%2FgL5euiHLWwNYPnz8toHN%2FSifu_Unreal_Project_Animation.zip?alt=media&token=25f096c5-506b-47c6-a34d-46123293c826>" %}

* **Installation**: Download and save it somewhere on your pc
* **Usage**: To cook the custom animations

#### Blender Import PSK/PSA addon

{% file src="<https://2113171739-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYk8wH56PJnY0Bbtn6Jyi%2Fuploads%2F5g6c0m8XGWqDw3DlFErL%2Fio_import_scene_unreal_psa_psk_280.zip?alt=media&token=cf0ef6a0-6702-4e3e-969d-0ac2850a7191>" %}

* **Installation**: Download the zip file, in Blender go to "Preferences" => "Addons" => "Install Addon" and select the zip file.
* **Usage**: To import psk and psa animations that you exported through fmodel

#### Skeletal Mesh of the main character in Sifu.

{% file src="<https://2113171739-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYk8wH56PJnY0Bbtn6Jyi%2Fuploads%2FYrdyvsZOXIooiMy64C8M%2FSK_M_MainChar_01.psk?alt=media&token=974bd895-61cf-40ed-a610-50b4f706e21f>" %}

* **Installation**: Download the psk and save it somewhere that you can easily access on your pc
* **Usage**: Needed to be used in blender when importing animations

### Step 1. Export an animation

In our case, we will be using Absolver as this pretty much matches with Sifu.

Open Fmodel and go to the animations folder. In there look for an animation that you want to use.

I'll be using "emote\_seeYa.uasset". Right click and click on "Save Animation"

<div align="left"><figure><img src="https://2113171739-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYk8wH56PJnY0Bbtn6Jyi%2Fuploads%2F92Y7sO8st9QqYVyCgmxl%2Fimage.png?alt=media&#x26;token=d8ad2b67-cb83-484f-a64c-cb7b67ec6c17" alt=""><figcaption><p>"emote_seeYa.uasset"</p></figcaption></figure></div>

### Step 2. Import custom animation in Blender

Now that we exported an animation from absolver, it is time to import it into blender. You should already have blender with the addon installed.

First, we will remove everything on the top right panel. Only the scene collection should stay.

<figure><img src="https://2113171739-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYk8wH56PJnY0Bbtn6Jyi%2Fuploads%2F9Sv7d8CdHZn68yQFNDsH%2Fimage.png?alt=media&#x26;token=7601702d-6bad-4ad9-a276-8ea44049c36c" alt=""><figcaption><p>Remove Collection, Camera, Cube and Light</p></figcaption></figure>

It should look like this:

<div align="left"><figure><img src="https://2113171739-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYk8wH56PJnY0Bbtn6Jyi%2Fuploads%2FFBbTb2V28l6QGiApArXF%2Fimage.png?alt=media&#x26;token=b37879d0-84a1-4fca-9b16-0ee2db6da6c1" alt=""><figcaption></figcaption></figure></div>

Now that this is done, we can import our skeletal mesh of the main character in Sifu.&#x20;

Go to "File" => "Import" => "Skeleton Mesh" and select the psk in the folder that you saved it.

It should look like this:

<div align="left"><figure><img src="https://2113171739-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYk8wH56PJnY0Bbtn6Jyi%2Fuploads%2FlOy34hQWkEgxfKhaR9GW%2Fimage.png?alt=media&#x26;token=d6a712c4-9501-48c6-a3e5-98ddb4e89929" alt=""><figcaption></figcaption></figure></div>

Now we will import our custom animation from absolver. This can be done through the same method but instead of importing a skeleton Mesh we will be importing a "Skeleton Anim". Click on that and select the custom animation.&#x20;

This is what you should see in Blender:&#x20;

<div align="left"><figure><img src="https://2113171739-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYk8wH56PJnY0Bbtn6Jyi%2Fuploads%2Fw3q65yDATTmEVWKPWJOP%2Fimage.png?alt=media&#x26;token=3cdc2962-9add-4e21-9f47-f3acfb934311" alt=""><figcaption></figcaption></figure></div>

The yellow icons below are the keymarkers from the custom animation. You can also play it to see how it looks.

### Step 3. Export custom animation to UE4

Now that we have our custom animation in Blender, you can do any modifications or instanly export it so that it can be imported into ue4. We will not be doing any modifications in this tutorial.&#x20;

#### Export as FBX

To export to ue4, we will need a fbx file. To that, you can go to file => export => fbx. Before saving you should keep note of a few options.

On the right side you will have a panel where you can select or deselect some options

"Selected Objects" should be selected

<div align="left"><figure><img src="https://2113171739-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYk8wH56PJnY0Bbtn6Jyi%2Fuploads%2Fhg3U8xZwaUNx6YNXWaq2%2FselectedObjects.PNG?alt=media&#x26;token=dc3a0756-fd0b-4716-8b96-ab42483ed76d" alt=""><figcaption></figcaption></figure></div>

Under Armature => Add leaf bones should be Deselected.

![](https://2113171739-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYk8wH56PJnY0Bbtn6Jyi%2Fuploads%2FoGi0r36TDLx9pV8dBfTu%2Fleafbones.PNG?alt=media\&token=2c217569-2616-4270-8674-0acbf4f89c75)

Bake animation should be selected

<div align="left"><figure><img src="https://2113171739-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYk8wH56PJnY0Bbtn6Jyi%2Fuploads%2FkCjwtcEYpAvAcUT9akiS%2Fbakeanim.PNG?alt=media&#x26;token=0c4039a9-ac3a-4cf2-8708-4e2f2ba3987a" alt=""><figcaption></figcaption></figure></div>

Now give your fbx the name of the current sifu animation that you want to replace. In my case I'm going to replace a taunt called "Bring it" so my filename is:

<div align="left"><figure><img src="https://2113171739-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYk8wH56PJnY0Bbtn6Jyi%2Fuploads%2F3AdXLclxY6BqHZZ6BY4b%2Fimage.png?alt=media&#x26;token=569ec3e1-68e7-4a2c-bc27-bade2ff1c943" alt=""><figcaption></figcaption></figure></div>

Now click on "Export FBX" and you have sucessfully exported the FBX.

#### Import into UE4.

Open the custom animation unreal engine 4 template that you can find up top. My content folder in the ue4 project looks like this:

<div align="left"><figure><img src="https://2113171739-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYk8wH56PJnY0Bbtn6Jyi%2Fuploads%2FdL8MOHfVXwJyUuXU6LAh%2Fimage.png?alt=media&#x26;token=11eed09d-08c9-4a98-b844-7c390609132b" alt=""><figcaption></figcaption></figure></div>

We only need to be in the animations folder. Recreate the correct folder path to where the original sifu animation was stored in. In my case it is the "Taunts" folder.

In my Taunts folder I drag the fbx file into it. This will open an import panel. you need to deselect the import mesh option and select the base skeleton as the Skeleton. AFter that click on Import.

<div align="left"><figure><img src="https://2113171739-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYk8wH56PJnY0Bbtn6Jyi%2Fuploads%2F9RJZAMVccEjrvJD07Fnb%2Fimage.png?alt=media&#x26;token=861bf342-63fa-4620-bd2e-95d351b17fbd" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}
You will get a warning about bone transform being different. You can ignore that.
{% endhint %}

Open the animation, it will look weird and there is currently no way of fixing this. But trust the process.

Very important it to select "EnableRootMotion" this is also being used for attacks!&#x20;

<figure><img src="https://2113171739-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYk8wH56PJnY0Bbtn6Jyi%2Fuploads%2FlFkgzs11hsx3dnQf3zsO%2Fimage.png?alt=media&#x26;token=327eee2b-e99a-4859-bc63-4e30fbc577c2" alt=""><figcaption></figcaption></figure>

### Step 4. Cook custom animation

Now you only need to save it and cook the animation. You can do this by going to File => "Cook Content For Windows". Wait a bit and you can find the custom animation under the "Saved\Cooked\WindowsNoEditor\\" folder in your UE4 project.

Now you only need to create the .pak file and put the custom animation in there. Put it under the \~mods folder and it should look like this:

<figure><img src="https://2113171739-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYk8wH56PJnY0Bbtn6Jyi%2Fuploads%2FYBJ6pbc2pvkJcd4oxJIC%2FSifu_Custom_Animation-ezgif.com-optimize.gif?alt=media&#x26;token=74c7dfea-89f4-47bb-bee2-af7461ba2b19" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sifu-modding.gitbook.io/sifu-modding-wiki/modding-tutorials/animation-swapping.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
