Load and modify your Mikumikudance vmd file with js!
The Vmd file is a binary file. At present, it can only be edited by the mikumikudance.exe on windows.
read ArrayBuffer of the file, thanks
for the document of reading vmd file
The object returned by vmd.js will add a timeline attribute, which can be used to view by FrameTime
npm i vmd.js
# or
yarn add vmd.jsimport Vmd from'vmd.js'
// or
const Vmd = require('vmd')fetch('test.vmd')
.then(res => res.blob())
.then(blob => blob.arrayBuffer())
.then(arrayBuffer => new Vmd(arrayBuffer))import {saveAs} from'file-saver'
const arrayBuffer = vmd.write()
const url = URL.createObjectURL(new Blob([arrayBuffer]))
saveAs(url,'your.vmd')V1, V2 version string
The list of bone names in Japanese, like ['センター','upper body','头','头', ...]
Bone frame
- boneName
- frameTime
- translation
- rotation
- curveX
- curveY
- curveZ
- curveR
Emoticon frame
- morphName
- frameTime
- weight
Camera frame
- frameTime
- distance
- position
- rotation
- curve
- viewAngle
- orthographic
Light frame
- frameTime
- rgb
- direction
Contains all the data of the vmd file
-
version - version, there is V1 and V2
-
modelName - model name, have length limit
-
boneFrames - bone key frames
-
morphFrames - Emoji key frames
-
cameraFrames - camera key frames
-
lightFrames - light key frames
-
timeline - read-only variable, automatically sorted according to the key frame time
{frameTime: number, boneFrames: BoneFrame[], morphFrames: MorphFrame[], cameraFrames: CameraFrame[], lightFrames: LightFrame[]}[]
Regenerate the data into a binary file, you can export this ArrayBuffer as a file