Skip to content

Instantly share code, notes, and snippets.

@GRGSIBERIA
Created April 3, 2014 14:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GRGSIBERIA/9955863 to your computer and use it in GitHub Desktop.
Save GRGSIBERIA/9955863 to your computer and use it in GitHub Desktop.
MMD for UnityでVMDファイルの書き出しをする
using UnityEngine;
using System.Collections.Generic;
using System.Collections;
using System.IO;
public class SimpleMorphing : MonoBehaviour
{
public GameObject pmx_model;
void ExportFormat()
{
VMDFormatter formatter = new VMDFormatter(pmx_model);
formatter.InsertMorph(0);
VMDExporter exporter = new VMDExporter(formatter.Format);
var vmd_bytes = exporter.ExportMorph();
var file = File.OpenWrite("C:/test.vmd");
var bin = new BinaryWriter(file);
bin.Write(vmd_bytes);
bin.Flush();
bin.Close();
file.Close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment