Skip to content

Commit e5aa660

Browse files
author
Roberto De Ioris
authored
Update FixingMixamoRootMotionWithPython.md
1 parent 4fa7d95 commit e5aa660

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tutorials/FixingMixamoRootMotionWithPython.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,29 @@ class RootMotionFixer:
245245
return len(new_bone_map)-1
246246
```
247247

248+
Note the calls to `skeletal_mesh_set_active_bone_indices()` and `skeletal_mesh_set_required_bones()`: they are required to complete the build of the new mapping.
249+
250+
Now just add the following two lines at the end of the `add_root_to_skeleton()` method:
251+
252+
```python
253+
class RootMotionFixer:
254+
255+
def add_root_to_skeleton(self, mesh, bone='root'):
256+
...
257+
# assign the new skeleton to the new mesh
258+
new_mesh.skeletal_mesh_set_skeleton(new_skel)
259+
260+
new_skel.save_package()
261+
262+
...
263+
```
264+
265+
You can now delete the previous generated assets (the SeletalMesh and the Skeleton) and re-run the script (rememebr to select at least a Skeletal Mesh asset).
266+
267+
If all goes well, open the new skeleton and rotate again the left shoulder. Now it should work flawlessly:
268+
269+
![fixed influences](https://github.com/20tab/UnrealEnginePython/raw/master/tutorials/FixingMixamoRootMotionWithPython_Assets/fixed_influences.png)
270+
248271
## Step 4: splitting 'Hips' track in animation
249272

250273
## Adding a context menu

0 commit comments

Comments
 (0)