
VRM porting to babylon.js.
This loader is used as VirtualCast web VRM/VCI/glb viewer.
| babylon.js version | babylon-vrm-loader version |
|---|---|
| ~4.1.0 | <1.5.0 |
| ~4.2.0 | ^1.5.0 |
| ^5.19.0 | ^2.0.0 |
| ^6.0.0 | will be ^3.0.0 |
.vrm v0.x file loading
extensions.VRM glTF Extension.vci file loadingVCAST_vci_material_unityVCAST_vci_metaVCAST_vci_embedded_scriptVCAST_vci_audiosVCAST_vci_collidersVCAST_vci_rigidbodyVCAST_vci_jointsVCAST_vci_itemexample is here.
example is here.
$ 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);
See CONTRIBUTING.md.
$ yarn build
$ yarn debug
You can see inspector on http://localhost:8080/
see LICENSE.
This project uses babylon.js with Apache License, Version 2.0.