Installations
npm install @pixiv/three-vrm-core
Developer
pixiv
Developer Guide
Module System
ESM
Min. Node Version
Typescript Support
Yes
Node Version
20.13.1
NPM Version
lerna/8.1.9/node@v20.13.1+x64 (linux)
Statistics
1,305 Stars
2,544 Commits
110 Forks
85 Watching
21 Branches
29 Contributors
Updated on 28 Nov 2024
Languages
TypeScript (67.6%)
HTML (24.68%)
GLSL (4.1%)
JavaScript (3.58%)
Shell (0.03%)
Total Downloads
Cumulative downloads
Total Downloads
219,971
Last day
-4.7%
744
Compared to previous day
Last week
-8.2%
3,942
Compared to previous week
Last month
20.3%
17,086
Compared to previous month
Last year
76.7%
118,179
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
2
Peer Dependencies
1
Dev Dependencies
2
@pixiv/three-vrm
How to Use
from HTML
You will need:
- Three.js build
- GLTFLoader
- A build of @pixiv/three-vrm
.module
ones are ESM, otherwise it's UMD and injects its modules into globalTHREE
.min
ones are minified (for production), otherwise it's not minified and it comes with source maps
You can import all the dependencies via CDN like jsDelivr.
1<script type="importmap"> 2 { 3 "imports": { 4 "three": "https://cdn.jsdelivr.net/npm/three@0.169.0/build/three.module.js", 5 "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.169.0/examples/jsm/", 6 "@pixiv/three-vrm": "https://cdn.jsdelivr.net/npm/@pixiv/three-vrm@3/lib/three-vrm.module.min.js" 7 } 8 } 9</script> 10 11<script type="module"> 12 import * as THREE from 'three'; 13 import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js'; 14 import { VRMLoaderPlugin } from '@pixiv/three-vrm'; 15 16 // ... Setup renderer, camera, scene ... 17 18 // Create a GLTFLoader - The loader for loading VRM models 19 const loader = new GLTFLoader(); 20 21 // Install a GLTFLoader plugin that enables VRM support 22 loader.register((parser) => { 23 return new VRMLoaderPlugin(parser); 24 }); 25 26 loader.load( 27 // URL of the VRM you want to load 28 '/models/VRM1_Constraint_Twist_Sample.vrm', 29 30 // called when the resource is loaded 31 (gltf) => { 32 // retrieve a VRM instance from gltf 33 const vrm = gltf.userData.vrm; 34 35 // add the loaded vrm to the scene 36 scene.add(vrm.scene); 37 38 // deal with vrm features 39 console.log(vrm); 40 }, 41 42 // called while loading is progressing 43 (progress) => console.log('Loading model...', 100.0 * (progress.loaded / progress.total), '%'), 44 45 // called when loading has errors 46 (error) => console.error(error), 47 ); 48 49 // ... Perform the render loop ... 50</script>
See the Three.js document if you are not familiar with Three.js yet: https://threejs.org/docs/#manual/en/introduction/Creating-a-scene
See the example for the complete code: https://github.com/pixiv/three-vrm/blob/release/packages/three-vrm/examples/basic.html
via npm
Install three
and @pixiv/three-vrm
:
1npm install three @pixiv/three-vrm
Use with WebGPURenderer
Starting from v3, we provide WebGPURenderer compatibility.
To use three-vrm with WebGPURenderer, specify the WebGPU-compatible MToonNodeMaterial
for the materialType
option of MToonMaterialLoaderPlugin
.
MToonNodeMaterial
only supports Three.js r167 or later.
The NodeMaterial system of Three.js is still under development, so we may break compatibility with older versions of Three.js more frequently than other parts of three-vrm.
1import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js'; 2import { MToonMaterialLoaderPlugin, VRMLoaderPlugin } from '@pixiv/three-vrm'; 3import { MToonNodeMaterial } from '@pixiv/three-vrm/nodes'; 4 5// ... Setup renderer, camera, scene ... 6 7// Create a GLTFLoader 8const loader = new GLTFLoader(); 9 10// Register a VRMLoaderPlugin 11loader.register((parser) => { 12 13 // create a WebGPU compatible MToonMaterialLoaderPlugin 14 const mtoonMaterialPlugin = new MToonMaterialLoaderPlugin(parser, { 15 16 // set the material type to MToonNodeMaterial 17 materialType: MToonNodeMaterial, 18 19 }); 20 21 return new VRMLoaderPlugin(parser, { 22 23 // Specify the MToonMaterialLoaderPlugin to use in the VRMLoaderPlugin instance 24 mtoonMaterialPlugin, 25 26 }); 27 28}); 29 30// ... Load the VRM and perform the render loop ...
See the example for the complete code: https://github.com/pixiv/three-vrm/blob/release/packages/three-vrm/examples/webgpu-dnd.html
Contributing
See: CONTRIBUTING.md
LICENSE
No vulnerabilities found.
Reason
30 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
0 existing vulnerabilities detected
Reason
Found 5/11 approved changesets -- score normalized to 4
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: jobLevel 'contents' permission set to 'write': .github/workflows/publish.yml:21
- Warn: no topLevel permission defined: .github/workflows/inspect.yml:1
- Warn: no topLevel permission defined: .github/workflows/publish.yml:1
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/inspect.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/pixiv/three-vrm/inspect.yml/dev?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/inspect.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/pixiv/three-vrm/inspect.yml/dev?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/inspect.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/pixiv/three-vrm/inspect.yml/dev?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/inspect.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/pixiv/three-vrm/inspect.yml/dev?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/inspect.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/pixiv/three-vrm/inspect.yml/dev?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/inspect.yml:47: update your workflow using https://app.stepsecurity.io/secureworkflow/pixiv/three-vrm/inspect.yml/dev?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/inspect.yml:51: update your workflow using https://app.stepsecurity.io/secureworkflow/pixiv/three-vrm/inspect.yml/dev?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/inspect.yml:62: update your workflow using https://app.stepsecurity.io/secureworkflow/pixiv/three-vrm/inspect.yml/dev?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/inspect.yml:74: update your workflow using https://app.stepsecurity.io/secureworkflow/pixiv/three-vrm/inspect.yml/dev?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/inspect.yml:76: update your workflow using https://app.stepsecurity.io/secureworkflow/pixiv/three-vrm/inspect.yml/dev?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/inspect.yml:80: update your workflow using https://app.stepsecurity.io/secureworkflow/pixiv/three-vrm/inspect.yml/dev?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/inspect.yml:91: update your workflow using https://app.stepsecurity.io/secureworkflow/pixiv/three-vrm/inspect.yml/dev?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/inspect.yml:103: update your workflow using https://app.stepsecurity.io/secureworkflow/pixiv/three-vrm/inspect.yml/dev?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/inspect.yml:105: update your workflow using https://app.stepsecurity.io/secureworkflow/pixiv/three-vrm/inspect.yml/dev?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/inspect.yml:109: update your workflow using https://app.stepsecurity.io/secureworkflow/pixiv/three-vrm/inspect.yml/dev?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/inspect.yml:120: update your workflow using https://app.stepsecurity.io/secureworkflow/pixiv/three-vrm/inspect.yml/dev?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/inspect.yml:127: update your workflow using https://app.stepsecurity.io/secureworkflow/pixiv/three-vrm/inspect.yml/dev?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/inspect.yml:141: update your workflow using https://app.stepsecurity.io/secureworkflow/pixiv/three-vrm/inspect.yml/dev?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/inspect.yml:143: update your workflow using https://app.stepsecurity.io/secureworkflow/pixiv/three-vrm/inspect.yml/dev?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/inspect.yml:147: update your workflow using https://app.stepsecurity.io/secureworkflow/pixiv/three-vrm/inspect.yml/dev?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/inspect.yml:158: update your workflow using https://app.stepsecurity.io/secureworkflow/pixiv/three-vrm/inspect.yml/dev?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/inspect.yml:163: update your workflow using https://app.stepsecurity.io/secureworkflow/pixiv/three-vrm/inspect.yml/dev?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/inspect.yml:176: update your workflow using https://app.stepsecurity.io/secureworkflow/pixiv/three-vrm/inspect.yml/dev?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/pixiv/three-vrm/publish.yml/dev?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/pixiv/three-vrm/publish.yml/dev?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/pixiv/three-vrm/publish.yml/dev?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:62: update your workflow using https://app.stepsecurity.io/secureworkflow/pixiv/three-vrm/publish.yml/dev?enable=pin
- Info: 0 out of 26 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 third-party GitHubAction dependencies pinned
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 28 are checked with a SAST tool
Score
5.2
/10
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to @pixiv/three-vrm-core
@pixiv/three-vrm
VRM file loader for three.js.
@pixiv/three-vrm-materials-hdr-emissive-multiplier
Support VRMC_hdr_emissiveMultiplier for @pixiv/three-vrm
@pixiv/three-vrm-materials-v0compat
VRM0.0 materials compatibility layer plugin for @pixiv/three-vrm
@pixiv/three-vrm-springbone
Spring bone module for @pixiv/three-vrm