Skip to content

Commit ebf7f94

Browse files
author
Roberto De Ioris
authored
Update FixingMixamoRootMotionWithPython.md
1 parent 1d52418 commit ebf7f94

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

‎tutorials/FixingMixamoRootMotionWithPython.md‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,26 @@ for uobject in ue.get_selected_assets():
122122
raise DialogException('Only Skeletal Meshes are supported')
123123
```
124124

125+
The `DialogException` class is a useful trick for generating a modal window on error. This is more UE4-friendly than simply spitting out erors in the console. Whenever you raises it, the dialog will appear.
126+
127+
The `ue.create_modal_save_asset_dialog(title, default_package_name, default_object_name)` function opens the UE4 asset manager for allowing the user to specify where to save the SkeletalMesh/Skeleton copies. Obviously, in case of massive conversions you can avoid it and simply specify an automatic file pattern in the code.
128+
129+
Pay attention to the way bones are structured. They are basically referenced as numbers, with each bone mapped to a parent index (-1 fror the first bone in the chain).
130+
131+
The last part of the script runs the `add_root_to_skeleton()` method for each selected asset in the content browser (but will raise an exception if one of the assets is not a Skeletal Mesh).
132+
133+
So, select the vampire Skeletal Mesh and run the `mixamo.py` script from the UE4 python console (or click execute in the embedded python editor):
134+
135+
```python
136+
ue.py_exec('mixamo.py')
137+
```
138+
139+
You will end with two new assets, one for the SkeletalMesh and another for the Skeleton.
140+
141+
Double click on the skeleton to open its editor and you should see the new bone hierarchy with 'root' as the parent. Now rotate the left shoulder and you should note some scary result:
142+
143+
![no influences](https://github.com/20tab/UnrealEnginePython/raw/master/tutorials/FixingMixamoRootMotionWithPython_Assets/no_influences.png)
144+
125145
## Step 3: fixing skeletal mesh bone influences
126146

127147
## Step 4: splitting 'Hips' track in animation

0 commit comments

Comments
 (0)