GithubHelp home page GithubHelp logo

triocrossing / bvh-toolbox Goto Github PK

View Code? Open in Web Editor NEW

This project forked from olafhaag/bvh-toolbox

0.0 1.0 0.0 1.23 MB

Scripts for manipulating and converting BVH files.

License: MIT License

Python 99.89% Shell 0.11%

bvh-toolbox's Introduction

This repository provides Python3 scripts for manipulating and converting BVH motion capture files.

Installation

  • This package depends on a bleeding edge version of the bvh module, that has not been pushed to pypi.org yet.
    Therefore, you need to install this package using a direkt URL link for now.
  • Make sure to have pip >= 18.1 installed for supporting PEP 508 URL dependencies.
    • On Linux/MacOS: pip install --upgrade pip
    • On Windows use python -m pip install --upgrade pip
  • To install using development mode:
    pip install -e git+https://github.com/OlafHaag/bvh-toolbox.git@master#egg=bvhtoolbox
  • To install using regular mode (building the package):
    pip install https://github.com/OlafHaag/bvh-toolbox/archive/master.zip
  • The installation creates some console scripts you can use.

Console scripts

Manipulate BVH files

Rename joints in bvh files

  • Command: bvhrenamejoints

Remove frames from BVH files

  • Command: bvhremoveframes

Offset joint angles in BVH files

  • Command: bvhoffsetjointangles
  • Can be used to additively offset joint angles in the BVH by supplying a csv table containing the mapping of joint names to euler angles.
    • The angles must be in the same order as the joint's channels in the BVH hierarchy.

Convert from or to BVH files

BVH to Cal3D XSF & XAF

  • Command: bvh2xsf
  • Command: bvh2xaf
  • Converts BVH files to the Cal3D XML skeleton (XSF) and animation (XAF) file formats.
  • The XAF files rely on the respective skeleton file.
  • XAF files have been tested to work with skeletons that were exported from 3DS Max and Blender.
  • I use the resulting xaf files in Worldviz' Vizard, so it's only been tested in this context.

BVH to Panda3D Egg animation file

  • Command: bvh2egg
  • Converts BVH files to the Panda3D animation file egg format.

BVH to CSV tables

  • Command: bvh2csv
  • Converts BVH to comma separated values tables.
  • Ouputs one file for hierarchy, one for joint rotations, and one for joint world positions.
  • Use --hierarchy to export the respective CSV file.
  • Using only the --rotation or the --position flag you can output only one of the transform tables.
  • The --out parameter only takes a directory path as an argument.
  • With the --ends flag the End Sites are included in the *_pos.csv file.

CSV tables to BVH

  • Command: csv2bvh
  • Takes 3 CSV files (hierarchy, rotation, position) previously exported using bvh2csv or created otherwise and builds a bvh file from them.

All converters have a --scale parameter taking a float as an argument. You can use it to convert between units for the position and offset values.

How to run the console batch scripts

  • Open terminal.
  • If you've installed the bvhtoolbox into a conda/virtual environment, you have to activate it first.
  • type <script_name> -h (substitute <script_name> by one of the commands above) to get more information on the usage.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.