Fork of BVHView by Daniel Holden, adapted for the GENEA Leaderboard research project.
Feature list focuses on command-line usage. Proper GUI support is not guaranteed, even for completed features.
- Add textured mesh load support (.gltf)
- Add GENEA avatar mesh
- Playback BVH animation onto target mesh
- Add scrubber-synchronized WAV audio
- Load BVH and WAV via command line args
- Add SMPL-X meshes for the BEAT dataset
- Add .mp4 video recording using FFMPEG
- Add audio recording to .mp4 videos
- Add support for multiple animated models in the same scene
Low-prio features:
- Model shadows
- Orthographic camera
- Dockerized setup, .devcontainer
(The list could change with time.)
The repository is entirely Dockerized. You must have these installed:
- Docker
- VSCode
- Dev Containers plugin for VSCode
To build the container, open VSCode in the cloned repository folder, and run:
- Ctrl+Shift+P >
Rebuild and Reopen in Container
When in the Docker container, run either of these to build for Linux, Windows, or WebGL:
make OUTDIR=build/linux PLATFORM=PLATFORM_LINUX
make OUTDIR=build/windows PLATFORM=PLATFORM_WINDOWS
make OUTDIR=build/webgl PLATFORM=PLATFORM_WEB
This creates folders ./build/linux, ./build/windows, or ./build/webgl. The executables can be found inside these folders. The repository also has ready builds uploaded in the Releases tab.
If you get errors, please create an Issue.
You are enocuraged to use the command line interface (CLI), as some features (such as .wav loading) are only supported via command line arguments.
CLI example:
cd "[...]/BVHView/"./bvhview.exe --bvh="./assets/bvh/genea/trn_2023_v0_000_main-agent.bvh" --wav="./assets/wav/genea/trn_2023_v0_000_main-agent.wav"(Remove.exeon Linux)
You can find example files in assets folder.
All arguments are optional. Some additional undocumented options exist in the original source.
Data
--bvh: Path to a.bvhanimation data file.--wav: Path to a.wavaudio file.--mesh: Path to a.gltfmesh. If not specified, capsules will be drawn instead. If.bvhis not specified, the mesh will be loaded with a default pose, otherwise it will be animated.
Recording
--record: Toggle recording of the 3D scene (this hides the window and UI). Default is disabled.--recordFps: Toggle the FPS at which to record. Default is 30.--recordDirectory: Specify an absolute or relative path where recordings will be saved. Default isoutput/videoin the working directory.--recordName: Specify the name of the recording. Default is the name of the.bvhfile.
Camera
--cameraTrack(boolean) : Forces the camera to track a bone.--cameraTrackBone(int) : Specifies which bone ID to track if--cameraTrackis specified.
Ground
--groundGridX(int) : The number of grid cells along the X axis. Default=11--groundGridZ(int) : The number of grid cells along the Z axis. Default=11--groundCellWidth(float) : The size of each grid cell. Default=2.0
BVHView (specifically raylib) supports .gltf, not .fbx meshes. Read below how you can obtain those.
There is provided compatibility with SMPLX for the BEAT2 dataset.
- Download the SMPLX meshes from TBD.
- Extract the
.zipto a location of your choice. - Setup the smpl2bvh fork for the GENEA Leaderboard.
- Convert BEAT2
.npzfiles with:python smpl2bvh.py --gender NEUTRAL --poses "[...]/1_wayne_0_2_2.npz" --output "[...]/output.bvh" - Load the bvh with BVHView (Linux):
./bvhview --bvh="[...]/output.bvh" --mesh="[...]/smplx_neutral.gltf"- Make sure to export with the same gender (smpl2bvh) as the mesh you want to load:
- For
smplx_male.gltf:--gender MALE - For
smplx_female.gltf:--gender FEMALE - For
smplx_neutral.gltf:--gender NEUTRAL - If you don't do this, you can still load
.bvhfiles on all meshes, but the angles may be wrong.
- For
- Make sure to export with the same gender (smpl2bvh) as the mesh you want to load:
Convert fbx meshes with Blender:
Note: BVHView is a small software written in C and bvh-mesh compatibility is not polished. The instructions may be different for you based on your character specification.
- Setup
- Install
Blender(Official website, Steam) - Start
Blender - Delete all scene objects (Camera, Cube, Light...)
- Install
- Import
File > Import > FBX (.fbx)- Select your
.fbxmesh - Import settings:
- Reset settings via
Restore Operator Defaults - Disable
Animation
- Reset settings via
- Press
Import FBX
- Configure model
- In
Object Modeselect your armature and thenObject > Apply > All transforms - In
Object Modeselect your mesh and thenObject > Apply > All transforms
- In
- Export
File > Export > glTF 2.0 (.glb/.gltf)- Choose export directory
- Example:
[...]/BVHView/assets/models/<your_model_folder/>
- Example:
- Choose a file name
- Warning: you should update the contents of the exported
.gltffile if you rename any files after the export
- Warning: you should update the contents of the exported
- Export settings:
- Reset settings via
Restore Operator Defaults Format > glTF Separate (.gltf + .bin + textures)- Disable
Animation
- Reset settings via
- Press
Export glTF 2.0 - Test export by running
./bvhview --mesh="<path_to_gltf>"
If textures are not loaded correctly or visible, it could be due to texture files not being .png or .jpg -- only .png and .jpg are supported currently. For other formats, you should uncomment the corresponding lines in /raylib/raylib/src/config.h, rebuild raylib, then rebuild BVHView.
If your mesh or animation looks broken, it is likely because the BVH animation and model are incompatible. Diagnosing these issues is tricky, but you can try the following:
- Ensure your BVH and model have the same bone hierarchy. Different hierarchies can cause bone rotations to be loaded for the wrong bones.
- You may need to enable
Add Leaf Boneswhen exporting.gltffrom Blender.
- You may need to enable
- Ensure ZXY rotation order in your BVH files.
- Ensure your model's
rootbone is exported as aboneand not amodel / object. - Ensure you use the same naming scheme in the model and BVH.
- Namespaces shouldn't cause issues, but they could be used for data validation in the future.
BVHView is a simple .bvh animation file format viewer built using raylib.
bvhview_low.mp4
Download and install MinGW in some form. Perhaps w64devkit or MSYS2.
Download raylib into C:/raylib/raylib.
Download raygui into C:/raylib/raygui.
Build raylib by going to C:/raylib/raylib/src and running make.
Download this repo and run make in the main directory to build bvhview.exe.
To build a release version with optimizations enabled and no console window run make BUILD_MODE=RELEASE in the main directory instead.
Download raylib into ~/raylib/raylib.
Download raygui into ~/raylib/raygui.
Follow this guide to install any dependencies.
Build raylib by going to ~/raylib/raylib/src and running make.
Download this repo and run make in the main directory to build bvhview.
To build a release version with optimizations enabled run make BUILD_MODE=RELEASE in the main directory instead.
For other platforms you should be able to build BVHView by hacking the Makefile a bit. Contributions here welcome.