• Stars
    star
    615
  • Rank 72,947 (Top 2 %)
  • Language
    C++
  • License
    MIT License
  • Created about 3 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Learned Motion Matching example implementation and source code for the article "Code vs Data Driven Displacement"

Motion Matching & Code vs Data Driven Displacement

This repo contains the source code for all the demos from this article.

It also contains basic example implementations of Motion Matching and Learned Motion Matching in the style of this paper.

Installation

This demo uses raylib and raygui so you will need to first install those. Once installed, the demo itself is a pretty straight forward to make - just compile controller.cpp.

I've included a basic Makefile which you can use if you are using raylib on Windows. You may need to edit the paths in the Makefile but assuming default installation locations you can just run Make.

If you are on Linux or another platform you will probably have to hack this Makefile a bit.

Web Demo

If you want to compile the web demo you will need to first install emscripten. Then you should be able to (on Windows) run emsdk_env followed by make PLATFORM=PLATFORM_WEB. You then need to run wasm-server.py, and from there will be able to access localhost:8080/controller.html in your web browser which should contain the demo.

Learned Motion Matching

Most of the code and logic you can find in controller.cpp, with the Motion Matching search itself in database.h. The structure of the code is very similar to the previously mentioned paper but not identical in all respects. For example, it does not contain some of the briefly mentioned optimizations to the animation database storage and there are no tags used to disambiguate walking and running.

If you want to re-train the networks you need to look in the resources folder. First you will need to run train_decompressor.py. This will use database.bin and features.bin to produce decompressor.bin, which represents the trained decompressor network, and latent.bin, which represents the additional features learned for each frame in the database. It will dump also out some images and .bvh files you can use to examine the progress (as well a write Tensorboard logs to the resources/runs directory). Once the decompressor is trained and you have a well trained network and corresponding latent.bin, you can then train the stepper and the projector (at the same time) using train_stepper.py and train_projector.py. Both of these will also output networks (stepper.bin and projector.bin) as well as some images you can use to get a rough sense of the progress and accuracy.

The data required if you want to regenerate the animation database is from this dataset which is licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License (unlike the code, which is licensed under MIT).

If you re-generate the database you will also need to re-generate the matching database features.bin, which is done every time you re-run the demo. Similarly if you change the weights or any other properties that affect the matching the database will need to be re-generated and the networks re-trained.

More Repositories

1

Cello

Higher level programming in C
C
6,212
star
2

BuildYourOwnLisp

Learn C and build your own programming language in under 1000 lines of code!
HTML
2,792
star
3

mpc

A Parser Combinator library for C
C
2,648
star
4

Corange

Pure C Game Engine
C
1,720
star
5

tgc

A Tiny Garbage Collector for C
C
902
star
6

LuaAutoC

Automagically use C Functions and Structs with the Lua API
C
257
star
7

CPP_COMPLETE

Brainfuck interpreter written in the C preprocessor
C++
226
star
8

BVHView

A simple viewer for the .bvh animation file format written using raylib.
C
202
star
9

json2c

Convert JSON to C data literals
C
122
star
10

imgcurses

ncurses Image Viewer
C
114
star
11

Spring-It-On

Code for the article Spring-It-On
C
86
star
12

ptest

DRY Microtesting Framework for C
C
79
star
13

Joint-Limits

Source code for the article "Joint Limits"
C++
76
star
14

PyAutoC

Automatically wrap C functions & structs at run time for the Python/C API
Python
70
star
15

Python-xNormal

Python Wrapper for xNormal
Python
65
star
16

GenoView

An example raylib application for viewing animation on the Geno character
C
62
star
17

Animation-Looping

Source code for the article "Creating Looping Animations from Motion Capture"
C++
52
star
18

Animation-Velocities

Source code for the article Propagating Velocities through Animation Systems
C++
32
star
19

QuaternionAverage

Source code for the article "Quaternion Weighted Average"
C++
20
star
20

PyMark

Python flavoured object markup.
C++
17
star
21

Ranges

Source code for the article Tags, Ranges and Masks
C++
17
star
22

zeroeggs-retarget

Retargeting of the ZeroEGGs dataset onto a common character
Python
2
star
23

Cello-Website

libCello Website
JavaScript
1
star
24

lafan1-resolved

Resolving of the Ubisoft La Forge Animation dataset onto a common skeleton
Python
1
star
25

motorica-retarget

Retargeting of the Motorica Dance dataset onto a common skeleton
Python
1
star