You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The final step is fixing animations. We basically need to add a new track for the root motion, and remove translation from the track of the 'Hips' bone (remember, each bone is mapped to a different track in the animation).
276
+
277
+
We will create a new empty animation for the 'rooted' skeleton, and we will copy (and eventually fix) each track from the selected animation.
278
+
279
+
This time we will ask the user to select a skeleton asset using a slate window, but we will not ask where to save the new copy, instead we will automatically generate a name (obviously feel free to add your asset save dialog).
280
+
281
+
```python
282
+
import unreal_engine as ue
283
+
from unreal_engine.classes import SkeletalMesh, Skeleton, AnimSequence, AnimSequenceFactory
284
+
from unreal_engine import FTransform, FRawAnimSequenceTrack, FQuat
285
+
from unreal_engine import SWindow, SObjectPropertyEntryBox
286
+
287
+
classRootMotionFixer:
288
+
289
+
...
290
+
defset_skeleton(self, asset_data):
291
+
"""
292
+
This hook will be called after you selected a skeleton from the slate wizard
293
+
"""
294
+
self.choosen_skeleton = asset_data.get_asset()
295
+
self.window.request_destroy()
296
+
297
+
defsplit_hips(self, animation, bone='Hips'):
298
+
"""
299
+
SObjectPropertyEntryBox is the asset selector widget (we limit it to the Skeleton class)
300
+
"""
301
+
# this will contain the user-selected skeleton (if-any)
302
+
self.choosen_skeleton =None
303
+
# first ask for which skeleton to use:
304
+
self.window = SWindow(title='Choose your new Skeleton', modal=True, sizing_rule=1)(
0 commit comments