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
Copy file name to clipboardExpand all lines: tutorials/SnippetsForStaticAndSkeletalMeshes.md
+105Lines changed: 105 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1265,3 +1265,108 @@ Remember, you can use the same approach with quaternions, but NOT with rotators
1265
1265
## Animations: Getting curves from BVH files
1266
1266
1267
1267
BVH files are interesting for lot of reasons. First of all, BVH is basically the de-facto standard for motion capture devices. It is a textual human-readable format. And, maybe more important for this page, will heavily push your linear-algebra skills...
1268
+
1269
+
The BVH specs are described in this old document: https://research.cs.wisc.edu/graphics/Courses/cs-838-1999/Jeff/BVH.html
1270
+
1271
+
Lucky enough, here in 20tab we built a python module for parsing bvh files: https://github.com/20tab/bvh-python
1272
+
1273
+
```
1274
+
pip install bvh
1275
+
```
1276
+
1277
+
It is a simple parser that returns simple float lists/tuples that we can use to build vectors and quaternions.
1278
+
1279
+
BVH files only contain a skeleton definition (by specifying joint positions) and an animation.
1280
+
1281
+
This script will parse a bvh file and will return a transient skeleton (with an empty skeletal mesh associated) and an animation:
1282
+
1283
+
```python
1284
+
import unreal_engine as ue
1285
+
from unreal_engine.classes import Skeleton, SkeletalMesh, AnimSequence
1286
+
from unreal_engine import FTransform, FVector, FRotator, FQuat, FRawAnimSequenceTrack
Again, dealing with different convention here is the most complex part. In this example we do not swap axis, instead we rotate the root bone in the animation itelf:
0 commit comments