Skip to content

shinyoshiaki/babylon-vrm-loader

 
 

Repository files navigation

babylon-vrm-loader

npm version Greenkeeper badge CircleCI semantic-release

alicia.png

VRM porting to babylon.js.

This is Work In Progress.

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

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
  • TODO: BlendShape morphing
  • TODO: Secondary Animation
  • TODO: WebXR sample with First Person
  • 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.

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];
const hips = vrmManager.getBone('hips'); // returns Nullable<TransformNode>
hips.translate(BABYLON.Vector3.Right(), 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.

Packages

No packages published

Languages

  • TypeScript 92.2%
  • JavaScript 6.0%
  • HTML 1.4%
  • CSS 0.4%