uts

utsuroi

The plugin makes it easy to control model animation when use Three.js :)

Showing:

Popularity

Downloads/wk

13

GitHub Stars

1

Maintenance

Last Commit

2yrs ago

Contributors

0

Package

Dependencies

3

Size (min+gzip)

4.1KB

License

MIT

Type Definitions

Built-In

Tree-Shakeable

Yes?

Categories

Readme

Utsuroi

The plugin makes it easy to control model animation when use Three.js :)

MIT License

Setup

NPM Install

$ npm install utsuroi

Script Install

<script src="utsuroi.js"></script>

Basic Usage Example

// esm
import { Manipulator } from './manipulator'

let manipulator: Manipulator | undefined;
// Load asset
var loader = new THREE.GLTFLoader();
loader.load('assets/model.gltf', (gltf) {
  // Add scene
  scene.add(gltf.scene)

  // Create Manipulator
  // new Manipulator(THREE.Scene, THREE.AnimationClip[])
  manipulator = new Manipulator(gltf.scene, gltf.animations);

  // start motion
  // manipulator.play(actionName, loop)
  manipulator.play('Rest Pose', true);
});

How to update animation

Execute the update method every frame.

function tick() {
  requestAnimationFrame(tick);
  if(manipulator) {
    manipulator.update();
  }
}

tick();

How to change action

If you want to change the action, simply pass the action name, loop and duration to the to method and execute it :)

// to(ActionName[, duration, loop])
manipulator.to('Walk', 300, true);

How to pause animation

manipulator.pause();

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100