GithubHelp home page GithubHelp logo

jonike / rigger Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bodylabs/rigger

0.0 3.0 0.0 295 KB

Mesh rigger for BodyKit

Home Page: http://www.bodylabs.com/bodykit.html

License: BSD 2-Clause "Simplified" License

Python 100.00%

rigger's Introduction

Body Labs mesh rigger

This library enables developers to automatically rig any mesh generated by the Body Labs Instant API. The rig is Mixamo-compatible, allowing you to easily create control rigs and apply motion capture files provided by Mixamo.

from bodylabs_rigger.factory import RiggedModelFactory
from bodylabs_rigger.fbx_util import (
    create_fbx_manager,
    export_fbx_scene,
)

# Create a rigging factory.
factory = RiggedModelFactory.create_default()

fbx_manager = create_fbx_manager()

# Rig and export a mesh (which is a numpy Vx3 array of vertices).
rigged_mesh = factory.construct_rig(mesh_vertices, fbx_manager)
export_fbx_scene(fbx_manager, rigged_mesh, output_path)

# Clean up Fbx objects.
rigged_mesh.Destroy()
fbx_manager.Destroy()

We also provide a MeshGenerator library, which allows you to create riggable meshes from body measurements using BodyKit.

import os
from bodylabs_rigger.bodykit.mesh_generator import MeshGenerator

# Make sure to set BODYKIT_ACCESS_KEY and BODYKIT_SECRET
# in your execution environment.
mesh_generator = MeshGenerator(
    os.environ['BODYKIT_ACCESS_KEY'],
    os.environ['BODYKIT_SECRET']
)

mesh = mesh_generator.get_mesh_for_measurements(
    {'height': 70, 'weight': 150},
    unit_system='unitedStates',
    gender='male'
)

rigged_mesh = factory.construct_rig(mesh, fbx_manager)

examples/meshes_from_bodykit.py puts all the pieces together to randomly generate and rig a set of meshes.

python examples/meshes_from_bodykit.py \
    ~/Desktop/bodylabs_rig_examples \
    --num_meshes 5

Installation

  1. Install Python FBX
  2. pip install -e git+https://github.com/bodylabs/rigger.git#egg=bodylabs_rigger

This library has been tested on Mac OS X and Linux with Python 2.7. Windows is not officially supported at this time.

Contribute

Support

If you have questions or run into any issues, please contact us via the BodyKit developer support page.

License

This project is licensed under the BSD license.

rigger's People

Contributors

algrs avatar dlsmith avatar

Watchers

 avatar  avatar  avatar

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.