Mqo Importer Patch
Patch Reference; memory. memory. Search this site: How to Install Custom Patches; Forums. Feature Requests; Mesh importer: Vertice count on Get Mesh Component.
On Thu, Nov 13, 2008 at PM, George Toledo email hidden wrote: When you open up the qtz., highlight/grab the MQO Importer patch, go to Path Inspector, then.
YuhaOh/Mqo-Importer-for-Unity
The problem is, the only way I ve been able to get them is in. MQO format. do you know of an MQO importer that may be out there somewhere.
Cannot retrieve contributors at this time
using System.Collections.Generic;
public class Format : IComparable
protected string ConvertByteToString byte bytes
buf Encoding.Convert Encoding.GetEncoding 0, Encoding.UTF8, buf ;
return Encoding.UTF8.GetString buf ;
protected float ReadSingles BinaryReader bin, uint count
float result new float count ;
protected Vector3 ReadSinglesToVector3 BinaryReader bin
return new Vector3 result 0, result 1, result 2 ;
protected Vector2 ReadSinglesToVector2 BinaryReader bin
return new Vector2 result 0, result 1 ;
protected Color ReadSinglesToColor BinaryReader bin
return new Color result 0, result 1, result 2, result 3 ;
protected Color ReadSinglesToColor BinaryReader bin, float fix_alpha
return new Color result 0, result 1, result 2, fix_alpha ;
protected uint ReadUInt32s BinaryReader bin, uint count
protected ushort ReadUInt16s BinaryReader bin, uint count
ushort result new ushort count ;
protected Quaternion ReadSinglesToQuaternion BinaryReader bin
return new Quaternion result 0, result 1, result 2, result 3 ;
//Read Single from String Format
protected float ReadStringsingle String str, char splitIdentifier
brokenString str.Split splitIdentifier,50 ;
result Convert.ToSingle brokenString 1 ;
protected int ReadStringInt32 String str, char splitIdentifier
result Convert.ToInt32 brokenString 1 ;
//Read Uint32 from String Format
protected uint ReadStringUInt32 String str, char splitIdentifier
result Convert.ToUInt32 brokenString 1 ;
//Read Uint 32s from String Format
protected uint ReadStringUInt32s String str, char splitIdentifier,int count
result i Convert.ToUInt32 brokenString i 1 ;
//Read Vector2 from String Format
protected Vector2 ReadStringVector2s string str, char splitIdentifier,int count
Vector2 result new Vector2 count 2 ;
x_result Convert.ToSingle brokenString ReadAdd ;
y_result Convert.ToSingle brokenString ReadAdd 1 ;
result i new Vector2 x_result,y_result ;
//Read Vector3 from String Format
protected Vector3 ReadStringVector3 string str, char splitIdentifier
result i Convert.ToSingle brokenString i ;
//Read Color from String Format
protected Color ReadStringRGB string str, char splitIdentifier
result i Convert.ToSingle brokenString i 1 ;
return new Color result 0, result 1, result 2 ;
//Read RGBA from String Format
protected Color ReadStringRGBA string str, char splitIdentifier
return new Color result 0, result 1, result 2 , result 3 ;
//Read Vertex Color from String Format with MQO
protected Color32 ReadStringColor32s string str, char splitIdentifier,int count
Color32 result new Color32 count ;
keeper Convert.ToUInt32 brokenString i 1 ;
result i. r byte 0x000000ff keeper ;
result i. g byte 0x0000ff00 keeper 8 ;
result i. b byte 0x00ff0000 keeper 16 ;
result i. a byte 0xff000000 keeper 24 ;
public int CompareTo object obj
return count - Format obj. count;
public static MQOFormat Load StreamReader stream, GameObject caller, string path
return new MQOFormat stream, caller, path ;
public class MQOFormat : Root.Format
public string path; //Full pass
public string name; //pass name . ___
public string folder; // pass without filename
public GameObject caller; //MQO Loader script object
public bool haveMaterial false;
public MaterialList material_list;
public ObjectList object_list;
public Vector3 GetVPos int obj_id, int face_add,int vart_add
return object_list.obj obj_id. vertex_list.vertex
object_list.obj obj_id. face_list.face face_add. face_vert_index vart_add . pos;
public Vector2 GetVUV int obj_id, int face_add, int vart_add
return object_list.obj obj_id. face_list.face face_add. uv vart_add ;
public uint GetVIndex int obj_id, int face_add, int vart_add
return object_list.obj obj_id. face_list.face face_add. face_vert_index vart_add ;
this.name name.Split. 0 ; //without. mqo
public MQOFormat StreamReader stream, GameObject caller, string path //MQO独自フォーマットクラス
//textDate Load with StreamReader
string entireText stream.ReadToEnd ;
StringReader sreader new StringReader entireText ;
string currenttext sreader.ReadLine ;
if currenttext.StartsWith Metasequoia Document
this.head new Header sreader,currenttext ;
while currenttext sreader.ReadLine . null
if currenttext.StartsWith Scene
this.scene new Scene sreader ;
else if currenttext.StartsWith Material
this.material_list new MaterialList sreader,currenttext ;
else if currenttext.StartsWith Object
this.object_list new ObjectList sreader,currenttext,entireText ;
Debug.Log Don t read full format ;
public class Header : Root.Format
public string magic; // Metasequoia Document
public bool datatype; // false:Binary true:Text
public Header StringReader sreader,String code
currentText sreader.ReadLine ;
currentText currentText.Trim ;
brokenString currentText.Split splitIdentifier, 50 ;
this.version Convert.ToSingle brokenString 3 ;
Debug.Log Datatype: this.datatype ;
Debug.Log Version: this.version ;
public class Scene : Root.Format
public Scene StringReader sreader
string currentText sreader.ReadLine ;
this.position ReadStringVector3 currentText.Substring 5, splitIdentifier ;
//Debug.Log Pos: this.position ;
else if currentText.StartsWith lookat
this.lookat ReadStringVector3 currentText.Substring 8, splitIdentifier ;
//Debug.Log Lookat: this.Lookat ;
else if currentText.StartsWith head
this.head ReadStringsingle currentText,splitIdentifier ;
else if currentText.StartsWith pich
this.pich ReadStringsingle currentText,splitIdentifier ;
else if currentText.StartsWith bank
this.bank ReadStringsingle currentText,splitIdentifier ;
else if currentText.StartsWith ortho
this.ortho ReadStringsingle currentText,splitIdentifier ;
else if currentText.StartsWith zoom2
this.zoom2 ReadStringsingle currentText,splitIdentifier ;
else if currentText.StartsWith amb
this.amb ReadStringRGB currentText,splitIdentifier ;
else if currentText.StartsWith dirlights
this.dirlights_count ReadStringUInt32 currentText,splitIdentifier ;
this.dir new Vector3 this.dirlights_count ;
this.color new Color this.dirlights_count ;
currentText sreader.ReadLine ; //
this.dir i ReadStringVector3 currentText.Substring 7, splitIdentifier ;
else if currentText.StartsWith color
this.color i ReadStringRGB currentText,splitIdentifier ;
currentText sreader.ReadLine ; // break
currentText.TrimStart trimIdentifier ;
Debug.Log position: this.position ;
Debug.Log lookat: this.lookat ;
Debug.Log amb Color: this.amb ;
Debug.Log dirlights_count: this.dirlights_count ;
Debug.Log i dir_Vector: this.dir i ;
Debug.Log i dir_color: this.color i ;
public class MaterialList : Root.Format
public uint material_count; //
public MaterialList StringReader sreader,String beforeCode
this.material_count ReadStringUInt32 beforeCode,splitIdentifier ;
//Debug.Log MaterialCount: material_count ;
this.material new Material this.material_count ;
for int i 0; i this.material_count; i
this.material i new Material currentText ;
public class Material : Root.Format
public string materialName; //Write with s
public uint vcol; // 0:nothing 1:Use
public Color col; // RGBA . 3f, . 3f, . 3f, . 3f 0-1 float
public float dif; // diffuse . 3f 0-1 float
public float amb; // ambient . 3f 0-1 float
public float emi; // emissive . 3f 0-1 float
public float spc; // specula . 3f 0-1 float
public float power; // specula power . 2f 0-100 float
public string tex ; // texture path
public string aplane ; // aplane alpha texture path
public uint proj_type;// Mapping Type 0:UV 1:flat 2:entou 3:sphere
//Warning : There material chank will change material2
// : so if change material2 you can search this chank
public Material String currentText
char secondSplitIdentifier , ;
int firstDC currentText.IndexOf 1;
int length currentText.IndexOf, firstDC - firstDC ;
this.materialName currentText.Substring firstDC,length ;
//Debug.Log MatName: this.materialName ;
currentText currentText.Remove firstDC-2,length 3 ;
firstDC currentText.IndexOf 1;
length currentText.IndexOf, firstDC - firstDC ;
this.tex currentText.Substring firstDC,length ;
//Debug.Log TexName: this.tex ;
currentText currentText.Remove firstDC-5,length 7 ;
if currentText.Contains aplane
firstDC currentText.IndexOf, length 1;
this.aplane currentText.Substring firstDC,length ;
//Debug.Log AlphaName: this.aplane ;
currentText currentText.Remove firstDC-8,length 10 ;
this.bump currentText.Substring firstDC,length ;
//Debug.Log BumpName: this.bump ;
currentText currentText.Remove firstDC-6,length 8 ;
brokenString currentText.Split splitIdentifier,50 ;
foreach string str in brokenString
this.shader ReadStringUInt32 str.Trim, secondSplitIdentifier ;
//Debug.Log shader: this.shader ;
this.vcol ReadStringUInt32 str.Trim, secondSplitIdentifier ;
this.col ReadStringRGBA str.Trim, secondSplitIdentifier ;
this.dif ReadStringsingle str.Trim, secondSplitIdentifier ;
//Debug.Log Diffuse: this.dif ;
this.amb ReadStringsingle str.Trim, secondSplitIdentifier ;
this.emi ReadStringsingle str.Trim, secondSplitIdentifier ;
this.spc ReadStringsingle str.Trim, secondSplitIdentifier ;
this.power ReadStringsingle str.Trim, secondSplitIdentifier ;
//Debug.Log power: this.power ;
//Debug.Log Read Materiar/////// ;
public class ObjectList : Root.Format
public ObjectList StringReader sreader,String FirstCode,String entireText
string namecontena FirstCode.Split splitIdentifier ;
StringReader count new StringReader entireText ;
string countstr count.ReadLine ;
while. countstr.StartsWith Eof
//Debug.Log ObjectCount: obj_count ;
this.obj new Obj this.obj_count ;
for int i 0; i this.obj_count; i
currenttext sreader.ReadLine ;
namecontena currenttext.Split splitIdentifier ;
//Debug.Log Object i : obj_name Now reading ;
this.obj i new Obj sreader,obj_name ;
//Debug.Log Object i : obj_name Now readout ;
public class Obj : Root.Format
public VertexList vertex_list;
public Obj StringReader sreader,string name
String currentText sreader.ReadLine ;
if currentText.StartsWith visible
this.visible ReadStringUInt32 currentText,split_space ;
else if currentText.StartsWith shading
this.shading ReadStringUInt32 currentText,split_space ;
else if currentText.StartsWith facet
this.facet ReadStringsingle currentText,split_space ;
else if currentText.StartsWith vertex . currentText.StartsWith vertexattr
vartex_count ReadStringUInt32 currentText,split_space ;
this.vertex_list new VertexList sreader,vartex_count ;
else if currentText.StartsWith face . currentText.StartsWith facet
face_count ReadStringUInt32 currentText,split_space ;
this.face_list new FaceList sreader,face_count,polygon_count ;
public class VertexList : Root.Format
public VertexList StringReader sreader,uint count
this.vertex new Vertex vert_count ;
//Debug.Log Vert_count: this.vert_count ;
for int i 0; i this.vert_count; i
this.vertex i new Vertex sreader ;
public class Vertex : Root.Format
public Vertex StringReader sreader
currencttext sreader.ReadLine ;
//Debug.Log V ct: currencttext ;
this.pos ReadStringVector3 currencttext,split_space ;
//Debug.Log Vert_Pos : this.pos ;
public class FaceList : Root.Format
public int face_vartex_count 0;
public FaceList StringReader sreader,uint count,uint p_count
this.face new Face this.face_count ;
for int i 0; i this.face_count; i
this.face i new Face sreader ;
this.face_vartex_count this.face i. vartex_count;
//Debug.Log this.face_vartex_count ;
public class Face : Root.Format
public Face StringReader sreader
String currenttext sreader.ReadLine ;
//Debug.Log read: currenttext ;
brokenstring currenttext.Split splitIdentifier,50 ;
foreach string str in brokenstring
this.face_vert_index new uint this.vartex_count ;
this.face_vert_index ReadStringUInt32s str.Substring 4, secondSplitIdentifier,this.vartex_count ;
this.uv new Vector2 this.vartex_count ;
//Debug.Log readed 3 Index: this.face_vert_index 0 this.face_vert_index 1 this.face_vert_index 2 ;
this.mat ReadStringInt32 str.Trim, secondSplitIdentifier ;
//Debug.Log readed MatNum: this.mat ;
this.uv ReadStringVector2s str.Substring 4, secondSplitIdentifier,this.vartex_count ;
//format System.String.Format read: 0:F5 1:F5, this.uv 0. x, this.uv 0. y ;
//Debug.Log readed 3 UV: this.uv 0 this.uv 1 this.uv 2 ;
this.vcol new Color32 this.vartex_count ;
this.vcol ReadStringColor32s str.Trim, secondSplitIdentifier,this.vartex_count ;
else if currenttext.StartsWith 4
//Debug.Log readed 4 UV: this.uv 0 this.uv 1 this.uv 2 this.uv 3 ;
TUTORIAL: Importing Metasequoia . MQO files into 3DS Max. I did a quick little video tutorial on how to install a. MQO importer plugin to import Metasequoia.
README.md blender.io_mqo : Blender importer and exporter for Metasequia files . mqo feature for exporter. Export vertices; Export all edges in near future I want to.
追記 2010/05/27 : FYI ARToolKit Coordinate Correction in Quartz Composer
Don t forget that the ARToolKit is distributed under the GPL for non-commercial user. So, this Single Marker Detector is distributed under the GPL for non-commercial user./If you want to use for professional and commercial, you can t use this patch.
I try to write in English version, but it is not good. If you want to read them, you brave the blog entries. 1. how to build the patchs. 2. how to use the patchs. If you used other model rendering path, you could use this patch with Single Marker Detector.
edit 2008/11/18: I made new patch. the patch disassemble the 4x4 homogenous transformation matrix to each paramators. The patch name is MatrixToParams.
1 同封のARToolKit/etc/pattSample1.pdfを印刷しておく
2 Quartz Composerを開き MQO Importerをまず配置
4 MQO ImporterのInspector/Input ParametersでScaleを調整する 後で変換行列が変換してしまうので大きめで良い
5 Video Input, Single Marker Detecor, MQO ImportとなるようにImageとMatrixをつなぐ Single Marker Detectorはデフォルトでsample1のマーカーを検出する
6 Video Input, BillboardとなるようにImageをつなぐ
7 Billboardの方がLayerが下 若い番号 になるように右上の番号をクリックして調整する
8 とりあえずMQO ImporterのEnableにチェックを入れておく
9 重なった画像がでたらカメラの前でマーカーを動かしてみる うまくmqoモデルが動くまであれこれがんばる 光量 光源などがたいせつみたいだけどよくわからない
10 Single Marker DetectorのouptutFoundとMQOImporterのenbaleをつなぐ
なんかもっと安定して反応するようにならんもんかのぉ こちらを参考にすべきでしょうかね
間違いやお気づきの点がありましたらコメントもらえるとうれしいです
The Current Status of FFXIV Patch 3.1 and How to Address it Moving Forward A couple years ago there was a plugin for Blender that allowed you to import MQO.
Single Marker DetectorとMQO Importerを連携する時のコツ. you can t use this patch. I try to write in English version, but it is not good.