The `Skeleton Viewer` tool can help you display all bone entities in the model, and display bone placeholders of different sizes according to the layer weight. You can also configure the size, proportion, color and other functions of the bone placeholders
npm install @galacean/engine-toolkit-skeleton-viewerThe Skeleton Viewer tool can help you display all bone entities in the model, and display bone placeholders of different sizes according to the layer weight. You can also configure the size, proportion, color and other functions of the bone placeholders.
- π midStep - Distance from connector to bone, [0~1].
- β midWidthScale -The scale of the linker.
- βΎοΈ ballSize - Ball size.
- π scaleFactor - Skeleton Decrease Factor.
- β«οΈ colorMin - The min color.
- βͺοΈ colorMax - The max color.
The Outline is published on npm with full typing support. To install, use:
``sh`
$ npm install @galacean/engine-toolkit-skeleton-viewer
This will allow you to import package entirely using:
`javascript`
import * as TOOLKIT from "@galacean/engine-toolkit-skeleton-viewer";
or individual classes using:
`javascript`
import { SkeletonViewer } from "@galacean/engine-toolkit-skeleton-viewer";
`ts
// The entity you want to show skeleton
const skeletonViewer = entity.addComponent(SkeletonViewer);
// hidden skeleton viewer
skeletonViewer.enabled = false;
// reshow skeleton viewer
skeletonViewer.enabled = true;
// destroy resource
skeletonViewer.destroy();
// some configuration
skeletonViewer.midStep = 0.2;
skeletonViewer.midWidthScale = 0.1;
skeletonViewer.ballSize = 0.1;
skeletonViewer.scaleFactor = 0.1;
skeletonViewer.colorMin.set(1, 1, 1, 1);
skeletonViewer.colorMax.set(1, 1, 1, 1);
``
- Repository
- Examples
- Documentation
- API References
The engine is released under the MIT license. See LICENSE file.