Giter Club home page Giter Club logo

maya-dem-bones's Introduction

maya-dem-bones

This repository contains Maya python bindings for DemBones an implementation of Smooth Skinning Decomposition with Rigid Bones, an automated algorithm to extract the Linear Blend Skinning (LBS) with bone transformations from a set of example meshes. Skinning Decomposition can be used in various tasks:

  • converting any animated mesh sequence, e.g. geometry cache, to LBS, which can be replayed in popular game engines,
  • solving skinning weights from shapes and skeleton poses, e.g. converting blendshapes to LBS,
  • solving bone transformations for a mesh animation given skinning weights.

Installation

Depending on the version of Maya you are using pip is either not installed or is faulty. To make sure you have the latest version of pip installed run the following commands.

Once the latest version of pip has been ensured the repository can be cloned and its submodules initialized. These submodules contain DemBones, Eigen and pybind11.

Limitations

Due to an error in the scikit-build library in a python 2.7 environment the python library cannot be found resulting in a string concatenate error. Because of this it is not possible to use the pip install method on older versions of Maya running python 2.7.

Usage

The python bindings only provide partial mapping to the full capabilities of the DemBones project. It takes a mesh with a skin cluster and compute the best possible weights and transforms for the existing skeleton. It is possible to exclude weights via a demLock color set and exclude transform calculation via a demLock boolean attribute on the influence. You can extend the functionality of the class by creating a subclass that will allow you to recreate the animation, drive the helper joints with an RBF network using the newly calculated matrices etc.

import dem_bones

db = dem_bones.DemBones()
db.compute("skinned_MESH", "deformed_MESH", start_frame=1001, end_frame=1010)

print(db.influences)
print(db.weights)
print(db.bind_matrix("jaw_JNT"))
print(db.anim_matrix("jaw_JNT", 1005))

Example

A maya and python file is provided in the /example directory. This maya file contains two meshes and a skeleton. Both meshes are the standard face taken from Apple's ARKit. One of the meshes is driven by a blend shape node which has a shape triggered at each frame. The other is default bound to a skeleton. After running the code contained in the python file the skin weights and joint transformations will be calculated and set them in the scene to match the mesh driven by the blend shape node.

Licenses

  • The source code, /src, uses MIT as detailed in LICENSE.md
  • Any build python bindings uses third party libraries: DemBones, pybind11 and Eigen with licenses in 3RDPARTYLICENSES.md

maya-dem-bones's People

Contributors

dmunix avatar robertjoosten 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.