Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vmd.js

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vmd.js

Read and edit mmd's vmd file

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
increased by33.33%
Maintainers
1
Weekly downloads
 
Created
Source

Vmd.js

Load and modify your Mikumikudance vmd file with js!

Features

The Vmd file is a binary file. At present, it can only be edited by the mikumikudance.exe on windows.

Only javascript

read ArrayBuffer of the file, thanks

  • Official document
  • [MMD] Use python to parse VMD format to read

for the document of reading vmd file

Timeline

The object returned by vmd.js will add a timeline attribute, which can be used to view by FrameTime

Examples

Installation

npm i vmd.js
# or
yarn add vmd.js

Import it


import Vmd from'vmd.js'

// or

const Vmd = require('vmd')

Create vmd from file


fetch('test.vmd')
  .then(res => res.blob())
  .then(blob => blob.arrayBuffer())
  .then(arrayBuffer => new Vmd(arrayBuffer))

Export vmd as arrayBuffer


import {saveAs} from'file-saver'
const arrayBuffer = vmd.write()
    const url = URL.createObjectURL(new Blob([arrayBuffer]))
    saveAs(url,'your.vmd')

Some Attribute provided

VERSION

V1, V2 version string

BONE_NAME

The list of bone names in Japanese, like ['センター','upper body','头','头', ...]

BoneFrame

Bone frame

  • boneName
  • frameTime
  • translation
  • rotation
  • curveX
  • curveY
  • curveZ
  • curveR

MorphFrame

Emoticon frame

  • morphName
  • frameTime
  • weight

CameraFrame

Camera frame

  • frameTime
  • distance
  • position
  • rotation
  • curve
  • viewAngle
  • orthographic

LightFrame

Light frame

  • frameTime
  • rgb
  • direction

Vmd class

Contains all the data of the vmd file

Variable

  • 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[]}[]

Method

write

Regenerate the data into a binary file, you can export this ArrayBuffer as a file

Keywords

FAQs

Package last updated on 08 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc