Git Product home page Git Product logo

babylon-vrm-loader's Introduction

babylon-vrm-loader

npm version CircleCI semantic-release

alicia.png

VRM porting to babylon.js.

This loader is used as THE SEED ONLINE web VRM/VCI/glb viewer.

Supported version table

babylon.js version babylon-vrm-loader version
~4.1.0 <1.5.0
~4.2.0 ^1.5.0
~5.0.0 unreleased(will be ^1.6.0)

Features

  • Supports .vrm file loading
    • with extensions.VRM glTF Extension
  • Supports .vci file loading
  • Supports MToonMaterial
  • Get bone(TransformNode) from Unity Humanoid bone mapping name
  • BlendShape morphing
  • Secondary Animation
  • Supports VCI features(partial support)
    • VCAST_vci_material_unity
    • TODO: VCAST_vci_meta
    • TODO: VCAST_vci_embedded_script
    • TODO: VCAST_vci_audios
    • TODO: VCAST_vci_colliders
    • TODO: VCAST_vci_rigidbody
    • TODO: VCAST_vci_joints
    • TODO: VCAST_vci_item

Usage

on browser

example is here.

on Babylon.js Playgound

example is here.

with npm/yarn

$ npm install --save @babylonjs/core @babylonjs/loaders babylon-vrm-loader
# or
$ yarn add @babylonjs/core @babylonjs/loaders babylon-vrm-loader
import * as BABYLON from '@babylonjs/core'

// has side-effect
// ref. https://webpack.js.org/guides/tree-shaking#mark-the-file-as-side-effect-free
import 'babylon-vrm-loader'

// vrmFile is File object retrieved by <input type="file">.
const scene = await BABYLON.SceneLoader.LoadAsync('file:', vrmFile, engine);
const vrmManager = scene.metadata.vrmManagers[0];

// Update secondary animation
scene.onBeforeRenderObservable.add(() => {
    vrmManager.update(scene.getEngine().getDeltaTime());
});

// Model Transformation
vrmManager.rootMesh.translate(new BABYLON.Vector3(1, 0, 0), 1);

// Work with HumanoidBone
vrmManager.humanoidBone.leftUpperArm.addRotation(0, 1, 0);

// Work with BlendShape(MorphTarget)
vrmManager.morphing('Joy', 1.0);

Contributing

See CONTRIBUTING.md.

Build

$ yarn build

Debugging MToonMaterial

$ yarn debug

You can see inspector on http://localhost:8080/

Related Links

Licenses

see LICENSE.

This project uses babylon.js with Apache License, Version 2.0.

babylon-vrm-loader's People

Contributors

il-m-yamagishi avatar semantic-release-bot avatar dependabot[bot] avatar greenkeeper[bot] avatar flushpot1125 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.