• R/O
  • SSH

Vmd2XML: Commit

Vmd2XMLは、3D動画制作ツール、MikuMikuDance(MMD)で用いられるモーションデータファイル(*.vmd)の内容を、XML形式のデータファイルと交換するためのアプリケーションです。


Commit MetaInfo

Revision89e86bcb809f86c2a89c1e76d9901fa885f4ea55 (tree)
Zeit2013-06-08 13:30:39
Autor <olyutorskii@user...>

Log Message

MMD Ver7.40 対応 新スキーマ開発開始

Ändern Zusammenfassung

Diff

diff -r a445d3e35036 -r 89e86bcb809f CHANGELOG.txt
--- a/CHANGELOG.txt Tue May 21 23:11:29 2013 +0900
+++ b/CHANGELOG.txt Sat Jun 08 13:30:39 2013 +0900
@@ -10,6 +10,7 @@
1010 ・ベジェ補間パラメータ冗長部がMMDの版により異なるため、検査をやめた。
1111 ・プロセス終了コードの変更。
1212 ・DOMからSAXへの移行。
13+ ・MikuMikuDance Ver7.40以降の新VMDファイルフォーマットに対応
1314
1415
1516 1.101.2 (2011-08-25)
diff -r a445d3e35036 -r 89e86bcb809f pom.xml
--- a/pom.xml Tue May 21 23:11:29 2013 +0900
+++ b/pom.xml Sat Jun 08 13:30:39 2013 +0900
@@ -112,7 +112,7 @@
112112 <dependency>
113113 <groupId>jp.sourceforge.mikutoga</groupId>
114114 <artifactId>togagem</artifactId>
115- <version>2.102.5-SNAPSHOT</version>
115+ <version>2.102.7-SNAPSHOT</version>
116116 <scope>compile</scope>
117117 </dependency>
118118
diff -r a445d3e35036 -r 89e86bcb809f src/main/java/jp/sfjp/mikutoga/vmd/model/IkSwitch.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/jp/sfjp/mikutoga/vmd/model/IkSwitch.java Sat Jun 08 13:30:39 2013 +0900
@@ -0,0 +1,81 @@
1+/*
2+ * IK ON/OFF switch
3+ *
4+ * License : The MIT License
5+ * Copyright(c) 2013 MikuToga Partners
6+ */
7+
8+package jp.sfjp.mikutoga.vmd.model;
9+
10+import java.text.MessageFormat;
11+
12+/**
13+ * IK ON/OFF の管理を行う。
14+ */
15+public class IkSwitch {
16+
17+ private static final String MSG_TXT =
18+ "IKbone {0} : {1}";
19+
20+
21+ private String boneName = "";
22+ private boolean valid = true;
23+
24+
25+ /**
26+ * コンストラクタ。
27+ */
28+ public IkSwitch(){
29+ super();
30+ return;
31+ }
32+
33+
34+ /**
35+ * ボーン名を返す。
36+ * @return ボーン名
37+ */
38+ public String getBoneName(){
39+ return this.boneName;
40+ }
41+
42+ /**
43+ * ボーン名を設定する。
44+ * @param boneNameArg ボーン名
45+ * @throws NullPointerException 引数がnull
46+ */
47+ public void setBoneName(String boneNameArg) throws NullPointerException{
48+ if(boneNameArg == null) throw new NullPointerException();
49+ this.boneName = boneNameArg;
50+ return;
51+ }
52+
53+ /**
54+ * IK処理が有効か否か返す。
55+ * @return 有効ならtrue
56+ */
57+ public boolean isValid(){
58+ return this.valid;
59+ }
60+
61+ /**
62+ * IK処理が有効か否か設定する。
63+ * @param validArg 有効ならtrue
64+ */
65+ public void setValid(boolean validArg){
66+ this.valid = validArg;
67+ return;
68+ }
69+
70+ /**
71+ * {@inheritDoc}
72+ * @return {@inheritDoc}
73+ */
74+ @Override
75+ public String toString(){
76+ String msg;
77+ msg = MessageFormat.format(MSG_TXT, this.boneName, this.valid);
78+ return msg;
79+ }
80+
81+}
diff -r a445d3e35036 -r 89e86bcb809f src/main/java/jp/sfjp/mikutoga/vmd/model/NumberedVmdFlag.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/jp/sfjp/mikutoga/vmd/model/NumberedVmdFlag.java Sat Jun 08 13:30:39 2013 +0900
@@ -0,0 +1,92 @@
1+/*
2+ * model presence switch
3+ *
4+ * License : The MIT License
5+ * Copyright(c) 2013 MikuToga Partners
6+ */
7+
8+package jp.sfjp.mikutoga.vmd.model;
9+
10+import java.text.MessageFormat;
11+import java.util.Iterator;
12+import java.util.LinkedList;
13+import java.util.List;
14+import jp.sfjp.mikutoga.vmd.AbstractNumbered;
15+
16+/**
17+ * フレーム番号が付けられた各種モーションフラグの管理を行う。
18+ */
19+public class NumberedVmdFlag
20+ extends AbstractNumbered
21+ implements Iterable<IkSwitch> {
22+
23+ private static final String MSG_TXT =
24+ "#{0} model precense : {1}";
25+
26+
27+ private boolean shown = true;
28+ private List<IkSwitch> ikSwList = new LinkedList<IkSwitch>();
29+
30+
31+ /**
32+ * コンストラクタ。
33+ * <p>モデル表示ありの状態で初期化される。
34+ */
35+ public NumberedVmdFlag(){
36+ super();
37+ return;
38+ }
39+
40+
41+ /**
42+ * モデルを表示するか否か返す。
43+ * @return 表示するならtrue
44+ */
45+ public boolean isModelShown(){
46+ return this.shown;
47+ }
48+
49+ /**
50+ * モデルを表示するか否か設定する。
51+ * @param shownArg 表示するならtrue
52+ */
53+ public void setModelShown(boolean shownArg){
54+ this.shown = shownArg;
55+ return;
56+ }
57+
58+ /**
59+ * 個別IKボーンフラグのリストを返す。
60+ * @return 個別IKボーンフラグのリスト
61+ */
62+ public List<IkSwitch> getIkSwitchList(){
63+ return this.ikSwList;
64+ }
65+
66+ /**
67+ * {@inheritDoc}
68+ * @return {@inheritDoc}
69+ */
70+ @Override
71+ public Iterator<IkSwitch> iterator(){
72+ return this.ikSwList.iterator();
73+ }
74+
75+ /**
76+ * {@inheritDoc}
77+ * @return {@inheritDoc}
78+ */
79+ @Override
80+ public String toString(){
81+ String msg;
82+ msg = MessageFormat.format(MSG_TXT, getFrameNumber(), this.shown);
83+
84+ StringBuilder submsg = new StringBuilder(msg);
85+ for(IkSwitch sw : this.ikSwList){
86+ submsg.append('\n').append("\u0020").append(sw.toString());
87+ }
88+
89+ return submsg.toString();
90+ }
91+
92+}
diff -r a445d3e35036 -r 89e86bcb809f src/main/java/jp/sfjp/mikutoga/vmd/model/VmdMotion.java
--- a/src/main/java/jp/sfjp/mikutoga/vmd/model/VmdMotion.java Tue May 21 23:11:29 2013 +0900
+++ b/src/main/java/jp/sfjp/mikutoga/vmd/model/VmdMotion.java Sat Jun 08 13:30:39 2013 +0900
@@ -22,8 +22,8 @@
2222 public class VmdMotion {
2323
2424 private static final String MSG_TXT =
25- "model name : {0}\n"
26- + "bone#{1} morph#{2} camera#{3} luminous#{4} shadow#{5}";
25+ "model name : {0}\n"
26+ + "bone#{1} morph#{2} camera#{3} luminous#{4} shadow#{5} flag#{6}";
2727
2828
2929 private String modelName = VmdUniq.MODELNAME_STAGEACT;
@@ -31,9 +31,10 @@
3131 private final Map<String, List<BoneMotion>> bonePartMap;
3232 private final Map<String, List<MorphMotion>> morphPartMap;
3333
34- private final List<CameraMotion> cameraMotionList;
35- private final List<LuminousMotion> luminousMotionList;
36- private final List<ShadowMotion> shadowMotionList;
34+ private final List<CameraMotion> cameraMotionList;
35+ private final List<LuminousMotion> luminousMotionList;
36+ private final List<ShadowMotion> shadowMotionList;
37+ private final List<NumberedVmdFlag> flagList;
3738
3839
3940 /**
@@ -48,6 +49,7 @@
4849 this.cameraMotionList = new LinkedList<CameraMotion>();
4950 this.luminousMotionList = new LinkedList<LuminousMotion>();
5051 this.shadowMotionList = new LinkedList<ShadowMotion>();
52+ this.flagList = new LinkedList<NumberedVmdFlag>();
5153
5254 return;
5355 }
@@ -132,6 +134,14 @@
132134 }
133135
134136 /**
137+ * 各種フレーム番号付きフラグのリストを返す。
138+ * @return フレーム番号付きフラグのリスト
139+ */
140+ public List<NumberedVmdFlag> getNumberedFlagList(){
141+ return this.flagList;
142+ }
143+
144+ /**
135145 * ボーンモーションを追加する。
136146 * 追加順は保持される。
137147 * @param motion ボーンモーション
@@ -186,6 +196,7 @@
186196 Collections.sort(this.cameraMotionList, FrameNumbered.COMPARATOR);
187197 Collections.sort(this.luminousMotionList, FrameNumbered.COMPARATOR);
188198 Collections.sort(this.shadowMotionList, FrameNumbered.COMPARATOR);
199+ Collections.sort(this.flagList, FrameNumbered.COMPARATOR);
189200
190201 return;
191202 }
@@ -209,11 +220,12 @@
209220 int cameraNo = this.cameraMotionList .size();
210221 int luminousNo = this.luminousMotionList.size();
211222 int shadowNo = this.shadowMotionList .size();
223+ int flagNo = this.flagList .size();
212224
213225 String msg;
214226 msg = MessageFormat.format(MSG_TXT,
215227 this.modelName,
216- boneNo, morphNo, cameraNo, luminousNo, shadowNo );
228+ boneNo, morphNo, cameraNo, luminousNo, shadowNo, flagNo );
217229
218230 return msg;
219231 }
diff -r a445d3e35036 -r 89e86bcb809f src/main/java/jp/sfjp/mikutoga/vmd/model/binio/BoolExporter.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/jp/sfjp/mikutoga/vmd/model/binio/BoolExporter.java Sat Jun 08 13:30:39 2013 +0900
@@ -0,0 +1,96 @@
1+/*
2+ * boolean information exporter
3+ *
4+ * License : The MIT License
5+ * Copyright(c) 2013 MikuToga Partners
6+ */
7+
8+package jp.sfjp.mikutoga.vmd.model.binio;
9+
10+import java.io.IOException;
11+import java.io.OutputStream;
12+import java.util.List;
13+import jp.sfjp.mikutoga.bin.export.BinaryExporter;
14+import jp.sfjp.mikutoga.bin.export.IllegalTextExportException;
15+import jp.sfjp.mikutoga.vmd.VmdConst;
16+import jp.sfjp.mikutoga.vmd.model.IkSwitch;
17+import jp.sfjp.mikutoga.vmd.model.NumberedVmdFlag;
18+import jp.sfjp.mikutoga.vmd.model.VmdMotion;
19+
20+/**
21+ * フラグ情報のエクスポーター。
22+ * <p>MikuMikuDance Ver7.40以降でサポート
23+ */
24+class BoolExporter extends BinaryExporter{
25+
26+ private static final byte[] FDFILLER =
27+ { (byte)0x00, (byte)0xfd };
28+
29+
30+ /**
31+ * コンストラクタ。
32+ * @param stream 出力ストリーム
33+ */
34+ BoolExporter(OutputStream stream){
35+ super(stream);
36+ return;
37+ }
38+
39+
40+ /**
41+ * フラグ情報を出力する。
42+ * @param motion モーションデータ
43+ * @throws IOException 出力エラー
44+ * @throws IllegalTextExportException 不正な文字列が指定された。
45+ */
46+ void dumpNumberedFlagMotion(VmdMotion motion)
47+ throws IOException, IllegalTextExportException {
48+ List<NumberedVmdFlag> list = motion.getNumberedFlagList();
49+
50+ if(list.isEmpty()) return;
51+
52+ int count = list.size();
53+ dumpLeInt(count);
54+
55+ for(NumberedVmdFlag flag : list){
56+ int frameNo = flag.getFrameNumber();
57+ dumpLeInt(frameNo);
58+
59+ byte showModel;
60+ if(flag.isModelShown()) showModel = 0x01;
61+ else showModel = 0x00;
62+ dumpByte(showModel);
63+
64+ dumpIkSwitch(flag);
65+ }
66+
67+
68+ return;
69+ }
70+
71+ /**
72+ * IK有効フラグを出力する。
73+ * @param flag フラグ情報
74+ * @throws IOException 出力エラー
75+ * @throws IllegalTextExportException 不正な文字列が指定された。
76+ */
77+ private void dumpIkSwitch(NumberedVmdFlag flag)
78+ throws IOException, IllegalTextExportException {
79+ List<IkSwitch> swList = flag.getIkSwitchList();
80+ int swNo = swList.size();
81+ dumpLeInt(swNo);
82+
83+ for(IkSwitch ikSwitch : swList){
84+ String boneName = ikSwitch.getBoneName();
85+ dumpFixedW31j(boneName, VmdConst.IKSWBONENAME_MAX, FDFILLER);
86+
87+ byte ikValid;
88+ if(ikSwitch.isValid()) ikValid = 0x01;
89+ else ikValid = 0x00;
90+ dumpByte(ikValid);
91+ }
92+
93+ return;
94+ }
95+
96+}
diff -r a445d3e35036 -r 89e86bcb809f src/main/java/jp/sfjp/mikutoga/vmd/model/binio/BoolLoader.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/jp/sfjp/mikutoga/vmd/model/binio/BoolLoader.java Sat Jun 08 13:30:39 2013 +0900
@@ -0,0 +1,126 @@
1+/*
2+ * boolean information builder
3+ *
4+ * License : The MIT License
5+ * Copyright(c) 2013 MikuToga Partners
6+ */
7+
8+package jp.sfjp.mikutoga.vmd.model.binio;
9+
10+import java.util.List;
11+import jp.sfjp.mikutoga.bin.parser.MmdFormatException;
12+import jp.sfjp.mikutoga.bin.parser.ParseStage;
13+import jp.sfjp.mikutoga.vmd.model.IkSwitch;
14+import jp.sfjp.mikutoga.vmd.model.NumberedVmdFlag;
15+import jp.sfjp.mikutoga.vmd.model.VmdMotion;
16+import jp.sfjp.mikutoga.vmd.parser.VmdBoolHandler;
17+
18+/**
19+ * フラグ情報のビルダ。
20+ * <p>MikuMikuDance Ver7.40以降でサポート
21+ */
22+public class BoolLoader implements VmdBoolHandler{
23+
24+ private final List<NumberedVmdFlag> flagList;
25+
26+ private NumberedVmdFlag currentFlag;
27+ private IkSwitch currentSwitch;
28+
29+ /**
30+ * コンストラクタ。
31+ * @param vmdMotion モーションデータの格納先。
32+ */
33+ BoolLoader(VmdMotion vmdMotion){
34+ super();
35+ this.flagList = vmdMotion.getNumberedFlagList();
36+ return;
37+ }
38+
39+
40+ /**
41+ * {@inheritDoc}
42+ * @param stage {@inheritDoc}
43+ * @param loops {@inheritDoc}
44+ * @throws MmdFormatException {@inheritDoc}
45+ */
46+ @Override
47+ public void loopStart(ParseStage stage, int loops)
48+ throws MmdFormatException{
49+ if(stage == VmdBoolHandler.MODELSIGHT_LIST){
50+ this.currentFlag = new NumberedVmdFlag();
51+ }else if(stage == VmdBoolHandler.IKSW_LIST){
52+ this.currentSwitch = new IkSwitch();
53+ }
54+
55+ return;
56+ }
57+
58+ /**
59+ * {@inheritDoc}
60+ * @param stage {@inheritDoc}
61+ * @throws MmdFormatException {@inheritDoc}
62+ */
63+ @Override
64+ public void loopNext(ParseStage stage)
65+ throws MmdFormatException{
66+ if(stage == VmdBoolHandler.MODELSIGHT_LIST){
67+ this.flagList.add(this.currentFlag);
68+ this.currentFlag = new NumberedVmdFlag();
69+ }else if(stage == VmdBoolHandler.IKSW_LIST){
70+ List<IkSwitch> swList = this.currentFlag.getIkSwitchList();
71+ swList.add(this.currentSwitch);
72+ this.currentSwitch = new IkSwitch();
73+ }
74+
75+ return;
76+ }
77+
78+ /**
79+ * {@inheritDoc}
80+ * @param stage {@inheritDoc}
81+ * @throws MmdFormatException {@inheritDoc}
82+ */
83+ @Override
84+ public void loopEnd(ParseStage stage)
85+ throws MmdFormatException{
86+ if(stage == VmdBoolHandler.MODELSIGHT_LIST){
87+ this.currentFlag = null;
88+ }else if(stage == VmdBoolHandler.IKSW_LIST){
89+ this.currentSwitch = null;
90+ }
91+
92+ return;
93+ }
94+
95+ /**
96+ * {@inheritDoc}
97+ * @param show {@inheritDoc}
98+ * @param keyFrameNo {@inheritDoc}
99+ * @throws MmdFormatException {@inheritDoc}
100+ */
101+ @Override
102+ public void vmdModelSight(boolean show, int keyFrameNo)
103+ throws MmdFormatException {
104+ this.currentFlag.setModelShown(show);
105+ this.currentFlag.setFrameNumber(keyFrameNo);
106+ return;
107+ }
108+
109+ /**
110+ * {@inheritDoc}
111+ * @param boneName {@inheritDoc}
112+ * @param validIk {@inheritDoc}
113+ * @param keyFrameNo {@inheritDoc}
114+ * @throws MmdFormatException {@inheritDoc}
115+ */
116+ @Override
117+ public void vmdIkSwitch(String boneName,
118+ boolean validIk,
119+ int keyFrameNo )
120+ throws MmdFormatException {
121+ this.currentSwitch.setBoneName(boneName);
122+ this.currentSwitch.setValid(validIk);
123+ return;
124+ }
125+
126+}
diff -r a445d3e35036 -r 89e86bcb809f src/main/java/jp/sfjp/mikutoga/vmd/model/binio/VmdExporter.java
--- a/src/main/java/jp/sfjp/mikutoga/vmd/model/binio/VmdExporter.java Tue May 21 23:11:29 2013 +0900
+++ b/src/main/java/jp/sfjp/mikutoga/vmd/model/binio/VmdExporter.java Sat Jun 08 13:30:39 2013 +0900
@@ -21,6 +21,7 @@
2121 private BasicExporter basicExporter = null;
2222 private CameraExporter cameraExporter = null;
2323 private LightingExporter lightingExporter = null;
24+ private BoolExporter boolExporter = null;
2425
2526
2627 /**
@@ -44,6 +45,7 @@
4445 this.basicExporter = new BasicExporter(ostream);
4546 this.cameraExporter = new CameraExporter(ostream);
4647 this.lightingExporter = new LightingExporter(ostream);
48+ this.boolExporter = new BoolExporter(ostream);
4749
4850 try{
4951 dumpVmdMotionImpl(motion);
@@ -76,6 +78,13 @@
7678 this.lightingExporter.dumpLuminousMotion(motion);
7779 this.lightingExporter.dumpShadowMotion(motion);
7880
81+ if(motion.getNumberedFlagList().isEmpty()) return;
82+ try{
83+ this.boolExporter.dumpNumberedFlagMotion(motion);
84+ }catch(IllegalTextExportException e){
85+ throw new IllegalVmdDataException(e);
86+ }
87+
7988 return;
8089 }
8190
diff -r a445d3e35036 -r 89e86bcb809f src/main/java/jp/sfjp/mikutoga/vmd/model/binio/VmdLoader.java
--- a/src/main/java/jp/sfjp/mikutoga/vmd/model/binio/VmdLoader.java Tue May 21 23:11:29 2013 +0900
+++ b/src/main/java/jp/sfjp/mikutoga/vmd/model/binio/VmdLoader.java Sat Jun 08 13:30:39 2013 +0900
@@ -25,7 +25,6 @@
2525 private boolean loaded = false;
2626 private boolean hasMoreData = true;
2727
28- private boolean ignoreName = true;
2928 private boolean redundantCheck = false;
3029
3130
@@ -49,23 +48,11 @@
4948 }
5049
5150 /**
52- * カメラ・ライティングデータのパースを試みるか否かの判断で、
53- * 特殊モデル名判定を無視するか否か設定する。
54- * デフォルトではモデル名を無視。
55- * <p>※MMDVer7.30前後のVMD出力不具合を回避したい場合は、
56- * オフにするとパースに成功する場合がある。
57- * @param mode モデル名を無視してパースを強行するならtrue
58- */
59- public void setIgnoreName(boolean mode){
60- this.ignoreName = mode;
61- return;
62- }
63-
64- /**
6551 * ボーンモーション補間情報冗長部のチェックを行うか否か設定する。
6652 * デフォルトではチェックを行わない。
6753 * <p>※MMDVer7.30前後のVMD出力不具合を回避したい場合は、
6854 * オフにするとパースに成功する場合がある。
55+ * <p>※MMD Ver7.39x64以降はチェック回避必須。
6956 * @param mode チェックさせたければtrue
7057 */
7158 public void setRedundantCheck(boolean mode){
@@ -92,16 +79,17 @@
9279
9380 VmdParser parser = new VmdParser(source);
9481
95- parser.setIgnoreName(this.ignoreName);
9682 parser.setRedundantCheck(this.redundantCheck);
9783
9884 BasicLoader basicBuilder = new BasicLoader(motion);
9985 CameraLoader cameraBuilder = new CameraLoader(motion);
10086 LightingLoader lightingBuilder = new LightingLoader(motion);
87+ BoolLoader boolBuilder = new BoolLoader(motion);
10188
10289 parser.setBasicHandler(basicBuilder);
10390 parser.setCameraHandler(cameraBuilder);
10491 parser.setLightingHandler(lightingBuilder);
92+ parser.setBoolHandler(boolBuilder);
10593
10694 try{
10795 parser.parseVmd();
diff -r a445d3e35036 -r 89e86bcb809f src/main/java/jp/sfjp/mikutoga/vmd/model/xml/SaxAttr.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/jp/sfjp/mikutoga/vmd/model/xml/SaxAttr.java Sat Jun 08 13:30:39 2013 +0900
@@ -0,0 +1,130 @@
1+/*
2+ * Sax 2 Xsd-types converter
3+ *
4+ * License : The MIT License
5+ * Copyright(c) 2013 MikuToga Partners
6+ */
7+
8+package jp.sfjp.mikutoga.vmd.model.xml;
9+
10+import javax.xml.bind.DatatypeConverter;
11+import org.xml.sax.Attributes;
12+
13+/**
14+ * XSD各種型のSAX属性値をJavaプリミティブ型へ変換する。
15+ */
16+public final class SaxAttr {
17+
18+ /**
19+ * 隠しコンストラクタ。
20+ */
21+ private SaxAttr(){
22+ assert false;
23+ throw new AssertionError();
24+ }
25+
26+
27+ /**
28+ * 属性名に対応する属性値があるか否か判定する。
29+ * @param attr 属性群
30+ * @param name 属性名
31+ * @return 属性名に対応する属性値がある場合はtrue
32+ */
33+ public static boolean hasAttr(Attributes attr, String name){
34+ if(attr.getValue(name) == null) return false;
35+ return true;
36+ }
37+
38+ /**
39+ * xsd:string型属性値の読み込み。
40+ * @param attr 属性群
41+ * @param name 属性名
42+ * @return 属性値。該当する属性が無ければnull。
43+ */
44+ public static String getStringAttr(Attributes attr, String name){
45+ String attrVal = attr.getValue(name);
46+ return attrVal;
47+ }
48+
49+ /**
50+ * xsd:boolean型属性値の読み込み。
51+ * @param attr 属性群
52+ * @param name 属性名
53+ * @return 属性値。
54+ * @throws IllegalArgumentException boolean型表記ではない
55+ */
56+ public static boolean getBooleanAttr(Attributes attr, String name)
57+ throws IllegalArgumentException{
58+ String attrVal = attr.getValue(name);
59+ boolean bVal;
60+ bVal = DatatypeConverter.parseBoolean(attrVal);
61+ return bVal;
62+ }
63+
64+ /**
65+ * xsd:boolean型属性値の読み込み。
66+ * @param attr 属性群
67+ * @param name 属性名
68+ * @param def 属性が無い場合のデフォルト値
69+ * @return 属性値。
70+ * @throws IllegalArgumentException boolean型表記ではない
71+ */
72+ public static boolean getBooleanAttr(Attributes attr,
73+ String name,
74+ boolean def )
75+ throws IllegalArgumentException{
76+ String attrVal = attr.getValue(name);
77+ if(attrVal == null) return def;
78+
79+ boolean bVal;
80+ bVal = DatatypeConverter.parseBoolean(attrVal);
81+
82+ return bVal;
83+ }
84+
85+ /**
86+ * xsd:byte型属性の読み込み。
87+ * @param attr 属性群
88+ * @param name 属性名
89+ * @return 属性値。
90+ * @throws NumberFormatException byte型表記ではない
91+ */
92+ public static byte getByteAttr(Attributes attr, String name)
93+ throws NumberFormatException{
94+ String attrVal = attr.getValue(name);
95+ byte bVal;
96+ bVal = DatatypeConverter.parseByte(attrVal);
97+ return bVal;
98+ }
99+
100+ /**
101+ * xsd:float型属性値の読み込み。
102+ * @param attr 属性群
103+ * @param name 属性名
104+ * @return 属性値。
105+ * @throws NumberFormatException float型表記ではない
106+ */
107+ public static float getFloatAttr(Attributes attr, String name)
108+ throws NumberFormatException {
109+ String attrVal = attr.getValue(name);
110+ float fVal;
111+ fVal = DatatypeConverter.parseFloat(attrVal);
112+ return fVal;
113+ }
114+
115+ /**
116+ * xsd:int型属性値の読み込み。
117+ * @param attr 属性群
118+ * @param name 属性名
119+ * @return 属性値。
120+ * @throws NumberFormatException int型表記ではない
121+ */
122+ public static int getIntAttr(Attributes attr, String name)
123+ throws NumberFormatException {
124+ String attrVal = attr.getValue(name);
125+ int iVal;
126+ iVal = DatatypeConverter.parseInt(attrVal);
127+ return iVal;
128+ }
129+
130+}
diff -r a445d3e35036 -r 89e86bcb809f src/main/java/jp/sfjp/mikutoga/vmd/model/xml/SaxCameraListener.java
--- a/src/main/java/jp/sfjp/mikutoga/vmd/model/xml/SaxCameraListener.java Tue May 21 23:11:29 2013 +0900
+++ b/src/main/java/jp/sfjp/mikutoga/vmd/model/xml/SaxCameraListener.java Sat Jun 08 13:30:39 2013 +0900
@@ -98,13 +98,13 @@
9898 private void openCameraMotion(Attributes attr){
9999 this.currentCamera = new CameraMotion();
100100
101- int frameNo = SaxXsdUtil.getIntAttr(attr, XmlAttr.ATTR_FRAME);
101+ int frameNo = SaxAttr.getIntAttr(attr, XmlAttr.ATTR_FRAME);
102102 this.currentCamera.setFrameNumber(frameNo);
103103
104104 boolean hasPerspective =
105- SaxXsdUtil.getBooleanAttr(attr,
106- XmlAttr.ATTR_HAS_PERSPECTIVE,
107- true );
105+ SaxAttr.getBooleanAttr(attr,
106+ XmlAttr.ATTR_HAS_PERSPECTIVE,
107+ true );
108108 this.currentCamera.setPerspectiveMode(hasPerspective);
109109
110110 return;
@@ -130,9 +130,9 @@
130130 private void openCameraTarget(Attributes attr){
131131 MkPos3D targetPos = this.currentCamera.getCameraTarget();
132132
133- float xPos = SaxXsdUtil.getFloatAttr(attr, XmlAttr.ATTR_X_POS);
134- float yPos = SaxXsdUtil.getFloatAttr(attr, XmlAttr.ATTR_Y_POS);
135- float zPos = SaxXsdUtil.getFloatAttr(attr, XmlAttr.ATTR_Z_POS);
133+ float xPos = SaxAttr.getFloatAttr(attr, XmlAttr.ATTR_X_POS);
134+ float yPos = SaxAttr.getFloatAttr(attr, XmlAttr.ATTR_Y_POS);
135+ float zPos = SaxAttr.getFloatAttr(attr, XmlAttr.ATTR_Z_POS);
136136
137137 targetPos.setPosition(xPos, yPos, zPos);
138138
@@ -150,9 +150,9 @@
150150 CameraRotation cameraRotation =
151151 this.currentCamera.getCameraRotation();
152152
153- float latitude = SaxXsdUtil.getFloatAttr(attr, XmlAttr.ATTR_X_RAD);
154- float longitude = SaxXsdUtil.getFloatAttr(attr, XmlAttr.ATTR_Y_RAD);
155- float roll = SaxXsdUtil.getFloatAttr(attr, XmlAttr.ATTR_Z_RAD);
153+ float latitude = SaxAttr.getFloatAttr(attr, XmlAttr.ATTR_X_RAD);
154+ float longitude = SaxAttr.getFloatAttr(attr, XmlAttr.ATTR_Y_RAD);
155+ float roll = SaxAttr.getFloatAttr(attr, XmlAttr.ATTR_Z_RAD);
156156
157157 cameraRotation.setLatitude(latitude);
158158 cameraRotation.setLongitude(longitude);
@@ -169,7 +169,7 @@
169169 * @param attr 属性群
170170 */
171171 private void openCameraRange(Attributes attr){
172- float range = SaxXsdUtil.getFloatAttr(attr, XmlAttr.ATTR_RANGE);
172+ float range = SaxAttr.getFloatAttr(attr, XmlAttr.ATTR_RANGE);
173173 this.currentCamera.setRange(range);
174174
175175 BezierParam bez = this.currentCamera.getIntpltRange();
@@ -183,7 +183,7 @@
183183 * @param attr 属性群
184184 */
185185 private void openProjection(Attributes attr){
186- int vertDeg = SaxXsdUtil.getIntAttr(attr, XmlAttr.ATTR_VERT_DEG);
186+ int vertDeg = SaxAttr.getIntAttr(attr, XmlAttr.ATTR_VERT_DEG);
187187 this.currentCamera.setProjectionAngle(vertDeg);
188188
189189 BezierParam bez = this.currentCamera.getIntpltProjection();
diff -r a445d3e35036 -r 89e86bcb809f src/main/java/jp/sfjp/mikutoga/vmd/model/xml/SaxLightingListener.java
--- a/src/main/java/jp/sfjp/mikutoga/vmd/model/xml/SaxLightingListener.java Tue May 21 23:11:29 2013 +0900
+++ b/src/main/java/jp/sfjp/mikutoga/vmd/model/xml/SaxLightingListener.java Sat Jun 08 13:30:39 2013 +0900
@@ -79,7 +79,7 @@
7979 private void openLumiAct(Attributes attr){
8080 this.currentLuminous = new LuminousMotion();
8181
82- int frameNo = SaxXsdUtil.getIntAttr(attr, XmlAttr.ATTR_FRAME);
82+ int frameNo = SaxAttr.getIntAttr(attr, XmlAttr.ATTR_FRAME);
8383 this.currentLuminous.setFrameNumber(frameNo);
8484
8585 return;
@@ -105,9 +105,9 @@
105105 private void openLumiColor(Attributes attr){
106106 LuminousColor color = this.currentLuminous.getColor();
107107
108- float rCol = SaxXsdUtil.getFloatAttr(attr, XmlAttr.ATTR_R_COL);
109- float gCol = SaxXsdUtil.getFloatAttr(attr, XmlAttr.ATTR_G_COL);
110- float bCol = SaxXsdUtil.getFloatAttr(attr, XmlAttr.ATTR_B_COL);
108+ float rCol = SaxAttr.getFloatAttr(attr, XmlAttr.ATTR_R_COL);
109+ float gCol = SaxAttr.getFloatAttr(attr, XmlAttr.ATTR_G_COL);
110+ float bCol = SaxAttr.getFloatAttr(attr, XmlAttr.ATTR_B_COL);
111111
112112 color.setColR(rCol);
113113 color.setColG(gCol);
@@ -123,9 +123,9 @@
123123 private void openLumiDirection(Attributes attr){
124124 MkVec3D vec = this.currentLuminous.getDirection();
125125
126- float xVec = SaxXsdUtil.getFloatAttr(attr, XmlAttr.ATTR_X_VEC);
127- float yVec = SaxXsdUtil.getFloatAttr(attr, XmlAttr.ATTR_Y_VEC);
128- float zVec = SaxXsdUtil.getFloatAttr(attr, XmlAttr.ATTR_Z_VEC);
126+ float xVec = SaxAttr.getFloatAttr(attr, XmlAttr.ATTR_X_VEC);
127+ float yVec = SaxAttr.getFloatAttr(attr, XmlAttr.ATTR_Y_VEC);
128+ float zVec = SaxAttr.getFloatAttr(attr, XmlAttr.ATTR_Z_VEC);
129129
130130 vec.setXVal(xVec);
131131 vec.setYVal(yVec);
@@ -141,15 +141,15 @@
141141 private void openShadowAct(Attributes attr){
142142 ShadowMotion shadowMotion = new ShadowMotion();
143143
144- int frameNo = SaxXsdUtil.getIntAttr(attr, XmlAttr.ATTR_FRAME);
144+ int frameNo = SaxAttr.getIntAttr(attr, XmlAttr.ATTR_FRAME);
145145 shadowMotion.setFrameNumber(frameNo);
146146
147147 float rawParam =
148- SaxXsdUtil.getFloatAttr(attr, XmlAttr.ATTR_RAW_PARAM);
148+ SaxAttr.getFloatAttr(attr, XmlAttr.ATTR_RAW_PARAM);
149149 shadowMotion.setRawScopeParam(rawParam);
150150
151151 String modeAttr =
152- SaxXsdUtil.getStringAttr(attr, XmlAttr.ATTR_MODE);
152+ SaxAttr.getStringAttr(attr, XmlAttr.ATTR_MODE);
153153 ShadowMode mode = ShadowMode.valueOf(modeAttr);
154154 shadowMotion.setShadowMode(mode);
155155
diff -r a445d3e35036 -r 89e86bcb809f src/main/java/jp/sfjp/mikutoga/vmd/model/xml/SaxMotionListener.java
--- a/src/main/java/jp/sfjp/mikutoga/vmd/model/xml/SaxMotionListener.java Tue May 21 23:11:29 2013 +0900
+++ b/src/main/java/jp/sfjp/mikutoga/vmd/model/xml/SaxMotionListener.java Sat Jun 08 13:30:39 2013 +0900
@@ -104,7 +104,7 @@
104104 * @param attr 属性群
105105 */
106106 private void openBonePart(Attributes attr){
107- this.boneName = SaxXsdUtil.getStringAttr(attr, XmlAttr.ATTR_NAME);
107+ this.boneName = SaxAttr.getStringAttr(attr, XmlAttr.ATTR_NAME);
108108 return;
109109 }
110110
@@ -116,7 +116,7 @@
116116 this.boneMotion = new BoneMotion();
117117 this.boneMotion.setBoneName(this.boneName);
118118
119- int frameNo = SaxXsdUtil.getIntAttr(attr, XmlAttr.ATTR_FRAME);
119+ int frameNo = SaxAttr.getIntAttr(attr, XmlAttr.ATTR_FRAME);
120120 this.boneMotion.setFrameNumber(frameNo);
121121
122122 return;
@@ -138,9 +138,9 @@
138138 private void openBonePosition(Attributes attr){
139139 MkPos3D position = this.boneMotion.getPosition();
140140
141- float xPos = SaxXsdUtil.getFloatAttr(attr, XmlAttr.ATTR_X_POS);
142- float yPos = SaxXsdUtil.getFloatAttr(attr, XmlAttr.ATTR_Y_POS);
143- float zPos = SaxXsdUtil.getFloatAttr(attr, XmlAttr.ATTR_Z_POS);
141+ float xPos = SaxAttr.getFloatAttr(attr, XmlAttr.ATTR_X_POS);
142+ float yPos = SaxAttr.getFloatAttr(attr, XmlAttr.ATTR_Y_POS);
143+ float zPos = SaxAttr.getFloatAttr(attr, XmlAttr.ATTR_Z_POS);
144144
145145 position.setXpos(xPos);
146146 position.setYpos(yPos);
@@ -159,10 +159,10 @@
159159 private void openBoneRotQuat(Attributes attr){
160160 MkQuat rotation = this.boneMotion.getRotation();
161161
162- float qx = SaxXsdUtil.getFloatAttr(attr, XmlAttr.ATTR_QX);
163- float qy = SaxXsdUtil.getFloatAttr(attr, XmlAttr.ATTR_QY);
164- float qz = SaxXsdUtil.getFloatAttr(attr, XmlAttr.ATTR_QZ);
165- float qw = SaxXsdUtil.getFloatAttr(attr, XmlAttr.ATTR_QW);
162+ float qx = SaxAttr.getFloatAttr(attr, XmlAttr.ATTR_QX);
163+ float qy = SaxAttr.getFloatAttr(attr, XmlAttr.ATTR_QY);
164+ float qz = SaxAttr.getFloatAttr(attr, XmlAttr.ATTR_QZ);
165+ float qw = SaxAttr.getFloatAttr(attr, XmlAttr.ATTR_QW);
166166
167167 rotation.setQ1(qx);
168168 rotation.setQ2(qy);
@@ -182,9 +182,9 @@
182182 private void openBoneRotEyxz(Attributes attr){
183183 MkQuat rotation = this.boneMotion.getRotation();
184184
185- float xDeg = SaxXsdUtil.getFloatAttr(attr, XmlAttr.ATTR_X_DEG);
186- float yDeg = SaxXsdUtil.getFloatAttr(attr, XmlAttr.ATTR_Y_DEG);
187- float zDeg = SaxXsdUtil.getFloatAttr(attr, XmlAttr.ATTR_Z_DEG);
185+ float xDeg = SaxAttr.getFloatAttr(attr, XmlAttr.ATTR_X_DEG);
186+ float yDeg = SaxAttr.getFloatAttr(attr, XmlAttr.ATTR_Y_DEG);
187+ float zDeg = SaxAttr.getFloatAttr(attr, XmlAttr.ATTR_Z_DEG);
188188
189189 float xRad = (float)StrictMath.toRadians(xDeg);
190190 float yRad = (float)StrictMath.toRadians(yDeg);
@@ -203,7 +203,7 @@
203203 * @param attr 属性群
204204 */
205205 private void openMorphPart(Attributes attr){
206- this.morphName = SaxXsdUtil.getStringAttr(attr, XmlAttr.ATTR_NAME);
206+ this.morphName = SaxAttr.getStringAttr(attr, XmlAttr.ATTR_NAME);
207207 return;
208208 }
209209
@@ -214,8 +214,8 @@
214214 private void openMorphMotion(Attributes attr){
215215 MorphMotion morphMotion = new MorphMotion();
216216
217- int frameNo = SaxXsdUtil.getIntAttr(attr, XmlAttr.ATTR_FRAME);
218- float flex = SaxXsdUtil.getFloatAttr(attr, XmlAttr.ATTR_FLEX);
217+ int frameNo = SaxAttr.getIntAttr(attr, XmlAttr.ATTR_FRAME);
218+ float flex = SaxAttr.getFloatAttr(attr, XmlAttr.ATTR_FLEX);
219219
220220 morphMotion.setMorphName(this.morphName);
221221 morphMotion.setFrameNumber(frameNo);
diff -r a445d3e35036 -r 89e86bcb809f src/main/java/jp/sfjp/mikutoga/vmd/model/xml/SaxVmdListener.java
--- a/src/main/java/jp/sfjp/mikutoga/vmd/model/xml/SaxVmdListener.java Tue May 21 23:11:29 2013 +0900
+++ b/src/main/java/jp/sfjp/mikutoga/vmd/model/xml/SaxVmdListener.java Sat Jun 08 13:30:39 2013 +0900
@@ -175,10 +175,10 @@
175175 * @param attr 属性群
176176 */
177177 protected void openBezier(Attributes attr){
178- byte p1x = SaxXsdUtil.getByteAttr(attr, XmlAttr.ATTR_P1X);
179- byte p1y = SaxXsdUtil.getByteAttr(attr, XmlAttr.ATTR_P1Y);
180- byte p2x = SaxXsdUtil.getByteAttr(attr, XmlAttr.ATTR_P2X);
181- byte p2y = SaxXsdUtil.getByteAttr(attr, XmlAttr.ATTR_P2Y);
178+ byte p1x = SaxAttr.getByteAttr(attr, XmlAttr.ATTR_P1X);
179+ byte p1y = SaxAttr.getByteAttr(attr, XmlAttr.ATTR_P1Y);
180+ byte p2x = SaxAttr.getByteAttr(attr, XmlAttr.ATTR_P2X);
181+ byte p2y = SaxAttr.getByteAttr(attr, XmlAttr.ATTR_P2Y);
182182
183183 putBezier(p1x, p1y, p2x, p2y);
184184
diff -r a445d3e35036 -r 89e86bcb809f src/main/java/jp/sfjp/mikutoga/vmd/model/xml/SaxXsdUtil.java
--- a/src/main/java/jp/sfjp/mikutoga/vmd/model/xml/SaxXsdUtil.java Tue May 21 23:11:29 2013 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +0,0 @@
1-/*
2- * Sax 2 Xsd-types converter
3- *
4- * License : The MIT License
5- * Copyright(c) 2013 MikuToga Partners
6- */
7-
8-package jp.sfjp.mikutoga.vmd.model.xml;
9-
10-import javax.xml.bind.DatatypeConverter;
11-import org.xml.sax.Attributes;
12-
13-/**
14- * XSD各種型のSAX属性値をJavaプリミティブ型へ変換する。
15- */
16-final class SaxXsdUtil {
17-
18- /**
19- * 隠しコンストラクタ。
20- */
21- private SaxXsdUtil(){
22- assert false;
23- throw new AssertionError();
24- }
25-
26-
27- /**
28- * xsd:string型属性値の読み込み。
29- * @param attr 属性群
30- * @param name 属性名
31- * @return 属性値。該当する属性が無ければnull。
32- */
33- static String getStringAttr(Attributes attr, String name){
34- String attrVal = attr.getValue(name);
35- return attrVal;
36- }
37-
38- /**
39- * xsd:boolean型属性値の読み込み。
40- * @param attr 属性群
41- * @param name 属性名
42- * @return 属性値。
43- * @throws IllegalArgumentException boolean型表記ではない
44- */
45- static boolean getBooleanAttr(Attributes attr, String name)
46- throws IllegalArgumentException{
47- String attrVal = attr.getValue(name);
48- boolean bVal;
49- bVal = DatatypeConverter.parseBoolean(attrVal);
50- return bVal;
51- }
52-
53- /**
54- * xsd:boolean型属性値の読み込み。
55- * @param attr 属性群
56- * @param name 属性名
57- * @param def 属性が無い場合のデフォルト値
58- * @return 属性値。
59- * @throws IllegalArgumentException boolean型表記ではない
60- */
61- static boolean getBooleanAttr(Attributes attr, String name, boolean def)
62- throws IllegalArgumentException{
63- String attrVal = attr.getValue(name);
64- if(attrVal == null) return def;
65-
66- boolean bVal;
67- bVal = DatatypeConverter.parseBoolean(attrVal);
68-
69- return bVal;
70- }
71-
72- /**
73- * xsd:byte型属性の読み込み。
74- * @param attr 属性群
75- * @param name 属性名
76- * @return 属性値。
77- * @throws NumberFormatException byte型表記ではない
78- */
79- static byte getByteAttr(Attributes attr, String name)
80- throws NumberFormatException{
81- String attrVal = attr.getValue(name);
82- byte bVal;
83- bVal = DatatypeConverter.parseByte(attrVal);
84- return bVal;
85- }
86-
87- /**
88- * xsd:float型属性値の読み込み。
89- * @param attr 属性群
90- * @param name 属性名
91- * @return 属性値。
92- * @throws NumberFormatException float型表記ではない
93- */
94- static float getFloatAttr(Attributes attr, String name)
95- throws NumberFormatException {
96- String attrVal = attr.getValue(name);
97- float fVal;
98- fVal = DatatypeConverter.parseFloat(attrVal);
99- return fVal;
100- }
101-
102- /**
103- * xsd:int型属性値の読み込み。
104- * @param attr 属性群
105- * @param name 属性名
106- * @return 属性値。
107- * @throws NumberFormatException int型表記ではない
108- */
109- static int getIntAttr(Attributes attr, String name)
110- throws NumberFormatException {
111- String attrVal = attr.getValue(name);
112- int iVal;
113- iVal = DatatypeConverter.parseInt(attrVal);
114- return iVal;
115- }
116-
117-}
diff -r a445d3e35036 -r 89e86bcb809f src/main/java/jp/sfjp/mikutoga/vmd/model/xml/XmlHandler.java
--- a/src/main/java/jp/sfjp/mikutoga/vmd/model/xml/XmlHandler.java Tue May 21 23:11:29 2013 +0900
+++ b/src/main/java/jp/sfjp/mikutoga/vmd/model/xml/XmlHandler.java Sat Jun 08 13:30:39 2013 +0900
@@ -129,7 +129,7 @@
129129
130130 if(tag == VmdTag.MODEL_NAME){
131131 String modelName =
132- SaxXsdUtil.getStringAttr(attr, XmlAttr.ATTR_NAME);
132+ SaxAttr.getStringAttr(attr, XmlAttr.ATTR_NAME);
133133 this.vmdMotion.setModelName(modelName);
134134 return;
135135 }
diff -r a445d3e35036 -r 89e86bcb809f src/main/java/jp/sfjp/mikutoga/vmd2xml/Vmd2XmlConv.java
--- a/src/main/java/jp/sfjp/mikutoga/vmd2xml/Vmd2XmlConv.java Tue May 21 23:11:29 2013 +0900
+++ b/src/main/java/jp/sfjp/mikutoga/vmd2xml/Vmd2XmlConv.java Sat Jun 08 13:30:39 2013 +0900
@@ -401,7 +401,6 @@
401401 throws IOException, MmdFormatException{
402402 VmdLoader loader = new VmdLoader();
403403
404- loader.setIgnoreName(true);
405404 loader.setRedundantCheck(false);
406405
407406 VmdMotion motion = loader.load(is);
diff -r a445d3e35036 -r 89e86bcb809f src/main/resources/jp/sfjp/mikutoga/vmd/model/xml/resources/vmdxml-130609A.xsd
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/resources/jp/sfjp/mikutoga/vmd/model/xml/resources/vmdxml-130609A.xsd Sat Jun 08 13:30:39 2013 +0900
@@ -0,0 +1,944 @@
1+<?xml version="1.0" encoding="UTF-8" ?>
2+
3+<!--
4+ MikuMikuDance
5+ motion-data(*.vmd) on XML
6+ schema definition
7+
8+ License : The MIT License
9+ Copyright(c) 2013 MikuToga Partners
10+-->
11+
12+
13+<!DOCTYPE xsd:schema [
14+ <!ENTITY schemaVer "130609A" >
15+ <!ENTITY schemaNS "http://mikutoga.sourceforge.jp/xml/ns/vmdxml/130609A" >
16+]>
17+
18+
19+<xsd:schema
20+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
21+
22+ targetNamespace="&schemaNS;"
23+ xmlns:tns ="&schemaNS;"
24+
25+ elementFormDefault="qualified"
26+ version="&schemaVer;"
27+>
28+
29+ <xsd:annotation>
30+ <xsd:documentation>
31+ MikuMikuDance motion-data(*.vmd) on XML.
32+ License : The MIT License
33+ Copyright(c) 2013 MikuToga Partners
34+ </xsd:documentation>
35+ </xsd:annotation>
36+
37+
38+ <!-- ROOT element for motion -->
39+ <xsd:element name="vmdMotion" >
40+ <xsd:annotation>
41+ <xsd:documentation>
42+ Root element.
43+ </xsd:documentation>
44+ </xsd:annotation>
45+
46+ <xsd:complexType>
47+ <xsd:sequence>
48+ <xsd:element
49+ ref="tns:meta"
50+ minOccurs="0" maxOccurs="unbounded" />
51+ <xsd:choice>
52+ <xsd:sequence> <!-- model motion -->
53+ <xsd:element ref="tns:modelName" />
54+ <xsd:element ref="tns:boneMotionSequence" />
55+ <xsd:element ref="tns:morphSequence" />
56+ <xsd:element ref="tns:flagSequence" />
57+ </xsd:sequence>
58+ <xsd:sequence> <!-- stage act -->
59+ <xsd:element ref="tns:cameraSequence" />
60+ <xsd:element ref="tns:luminousSequence" />
61+ <xsd:element ref="tns:shadowSequence" />
62+ </xsd:sequence>
63+ </xsd:choice>
64+ </xsd:sequence>
65+ <xsd:attribute
66+ name="version"
67+ type="xsd:token"
68+ use="required"
69+ fixed="&schemaVer;" />
70+ </xsd:complexType>
71+
72+ </xsd:element>
73+
74+
75+ <xsd:simpleType name="FrameNo" >
76+ <xsd:annotation>
77+ <xsd:documentation>
78+ frame No.
79+ </xsd:documentation>
80+ </xsd:annotation>
81+
82+ <xsd:restriction base="xsd:int" >
83+<!--
84+ <xsd:minInclusive value="0" />
85+-->
86+ </xsd:restriction>
87+
88+ </xsd:simpleType>
89+
90+
91+ <xsd:simpleType name="MorphFlex" >
92+ <xsd:annotation>
93+ <xsd:documentation>
94+ morph flexible value. [0.0-1.0]
95+ </xsd:documentation>
96+ </xsd:annotation>
97+
98+ <xsd:restriction base="xsd:float" >
99+ <xsd:minInclusive value="-0.0" />
100+<!--
101+ <xsd:maxInclusive value="1.0" />
102+-->
103+ </xsd:restriction>
104+
105+ </xsd:simpleType>
106+
107+
108+ <xsd:simpleType name="ProjectionAngle" >
109+ <xsd:annotation>
110+ <xsd:documentation>
111+ screen-projection angle(degree).
112+ </xsd:documentation>
113+ </xsd:annotation>
114+
115+ <xsd:restriction base="xsd:int" >
116+<!--
117+ <xsd:minInclusive value="-0" />
118+ <xsd:maxInclusive value="+180" />
119+-->
120+ </xsd:restriction>
121+
122+ </xsd:simpleType>
123+
124+
125+ <xsd:simpleType name="ColorComponent" >
126+ <xsd:annotation>
127+ <xsd:documentation>
128+ color component value.
129+ </xsd:documentation>
130+ </xsd:annotation>
131+
132+ <xsd:restriction base="xsd:float" >
133+<!--
134+ <xsd:minInclusive value="-0.0" />
135+ <xsd:maxInclusive value="1.0" />
136+-->
137+ </xsd:restriction>
138+
139+ </xsd:simpleType>
140+
141+
142+ <xsd:simpleType name="DirVecComponent" >
143+ <xsd:annotation>
144+ <xsd:documentation>
145+ direction vector component value.
146+ </xsd:documentation>
147+ </xsd:annotation>
148+
149+ <xsd:restriction base="xsd:float" >
150+<!--
151+ <xsd:minInclusive value="-1.0" />
152+ <xsd:maxInclusive value="+1.0" />
153+-->
154+ </xsd:restriction>
155+
156+ </xsd:simpleType>
157+
158+
159+ <xsd:simpleType name="ShadowType" >
160+ <xsd:annotation>
161+ <xsd:documentation>
162+ type of shadow
163+ + NONE : no self-shadow
164+ + MODE_1 : reduce shadow-quality suddenly at range
165+ + MODE_2 : reduce shadow-quality gradually with range
166+ </xsd:documentation>
167+ </xsd:annotation>
168+
169+ <xsd:restriction base="xsd:string" >
170+ <xsd:enumeration value="NONE" />
171+ <xsd:enumeration value="MODE_1" />
172+ <xsd:enumeration value="MODE_2" />
173+ </xsd:restriction>
174+
175+ </xsd:simpleType>
176+
177+
178+ <xsd:simpleType name="ShadowRawParam" >
179+ <xsd:annotation>
180+ <xsd:documentation>
181+ shadow range raw value.
182+
183+ UI_VALUE = EFFECTIVE_RANGE * 100 ???
184+ rawParam = 0.1 - (UI_VALUE / 1.0E+5)
185+
186+ UI_VALUE:0 => rawParam:0.1
187+ UI_VALUE:8875 => rawParam:0.01125
188+ UI_VALUE:9999 => rawParam:1.0E-5
189+ </xsd:documentation>
190+ </xsd:annotation>
191+
192+ <xsd:restriction base="xsd:float" >
193+<!--
194+ <xsd:minInclusive value="-0.0" />
195+ <xsd:maxInclusive value="0.1" />
196+-->
197+ </xsd:restriction>
198+
199+ </xsd:simpleType>
200+
201+
202+ <xsd:simpleType name="BezPt" >
203+ <xsd:annotation>
204+ <xsd:documentation>
205+ Bezier points coordinates value. [XY:0-127]
206+ </xsd:documentation>
207+ </xsd:annotation>
208+
209+ <xsd:restriction base="xsd:byte" >
210+ <xsd:minInclusive value= "0" />
211+ <xsd:maxInclusive value="127" />
212+ </xsd:restriction>
213+
214+ </xsd:simpleType>
215+
216+
217+ <xsd:complexType name="FrameNumbered" >
218+ <xsd:annotation>
219+ <xsd:documentation>
220+ frame numbered type.
221+ </xsd:documentation>
222+ </xsd:annotation>
223+
224+ <xsd:attribute name="frame" type="tns:FrameNo" use="required" />
225+
226+ </xsd:complexType>
227+
228+
229+ <xsd:complexType name="BezParam" >
230+ <xsd:annotation>
231+ <xsd:documentation>
232+ bezier cubic curve parameters.
233+ p0=(0, 0) p3=(127, 127) [implicit points]
234+ </xsd:documentation>
235+ </xsd:annotation>
236+
237+ <xsd:attribute name="p1x" type="tns:BezPt" use="optional" />
238+ <xsd:attribute name="p1y" type="tns:BezPt" use="optional" />
239+ <xsd:attribute name="p2x" type="tns:BezPt" use="optional" />
240+ <xsd:attribute name="p2y" type="tns:BezPt" use="optional" />
241+
242+ </xsd:complexType>
243+
244+
245+ <xsd:element name="bezier" >
246+ <xsd:annotation>
247+ <xsd:documentation>
248+ bezier cubic curve parameters.
249+ p0=(0, 0) p3=(127, 127) [implicit points]
250+ P1 and P2 points are required.
251+ </xsd:documentation>
252+ </xsd:annotation>
253+
254+ <xsd:complexType>
255+ <xsd:complexContent>
256+ <xsd:restriction base="tns:BezParam" >
257+ <xsd:attribute name="p1x" type="tns:BezPt" use="required" />
258+ <xsd:attribute name="p1y" type="tns:BezPt" use="required" />
259+ <xsd:attribute name="p2x" type="tns:BezPt" use="required" />
260+ <xsd:attribute name="p2y" type="tns:BezPt" use="required" />
261+ </xsd:restriction>
262+ </xsd:complexContent>
263+ </xsd:complexType>
264+
265+ </xsd:element>
266+
267+
268+ <xsd:element name="defLinear" >
269+ <xsd:annotation>
270+ <xsd:documentation>
271+ default linear bezier curve.
272+ p0=(0, 0) p1=(20, 20) p2=(107, 107) p3=(127, 127)
273+ </xsd:documentation>
274+ </xsd:annotation>
275+
276+ <xsd:complexType>
277+ <xsd:complexContent>
278+ <xsd:restriction base="tns:BezParam" >
279+ <xsd:attribute name="p1x" use="prohibited" fixed= "20" />
280+ <xsd:attribute name="p1y" use="prohibited" fixed= "20" />
281+ <xsd:attribute name="p2x" use="prohibited" fixed="107" />
282+ <xsd:attribute name="p2y" use="prohibited" fixed="107" />
283+ </xsd:restriction>
284+ </xsd:complexContent>
285+ </xsd:complexType>
286+
287+ </xsd:element>
288+
289+
290+ <xsd:element name="defEaseInOut" >
291+ <xsd:annotation>
292+ <xsd:documentation>
293+ default ease-in-out bezier curve.
294+ p0=(0, 0) p1=(64, 0) p2=(64, 127) p3=(127, 127)
295+ </xsd:documentation>
296+ </xsd:annotation>
297+
298+ <xsd:complexType>
299+ <xsd:complexContent>
300+ <xsd:restriction base="tns:BezParam" >
301+ <xsd:attribute name="p1x" use="prohibited" fixed= "64" />
302+ <xsd:attribute name="p1y" use="prohibited" fixed= "0" />
303+ <xsd:attribute name="p2x" use="prohibited" fixed= "64" />
304+ <xsd:attribute name="p2y" use="prohibited" fixed="127" />
305+ </xsd:restriction>
306+ </xsd:complexContent>
307+ </xsd:complexType>
308+
309+ </xsd:element>
310+
311+
312+ <xsd:complexType name="InterpolationSingle" >
313+ <xsd:annotation>
314+ <xsd:documentation>
315+ has single interpolation curve.
316+ If omitted, it means default linear curve.
317+ </xsd:documentation>
318+ </xsd:annotation>
319+
320+ <xsd:choice minOccurs="0" >
321+ <xsd:element ref="tns:bezier" />
322+ <xsd:element ref="tns:defLinear" />
323+ <xsd:element ref="tns:defEaseInOut" />
324+ </xsd:choice>
325+
326+ </xsd:complexType>
327+
328+
329+ <xsd:complexType name="PosWithInterpolation" >
330+ <xsd:annotation>
331+ <xsd:documentation>
332+ 3D-position with XYZ-interpolation curve.
333+ If omitted, it means default linear curve *3 [XYZ].
334+ </xsd:documentation>
335+ </xsd:annotation>
336+
337+ <xsd:sequence minOccurs="0" maxOccurs="1" >
338+ <xsd:choice minOccurs="3" maxOccurs="3" >
339+ <xsd:element ref="tns:bezier" />
340+ <xsd:element ref="tns:defLinear" />
341+ <xsd:element ref="tns:defEaseInOut" />
342+ </xsd:choice>
343+ </xsd:sequence>
344+
345+ <xsd:attribute name="xPos" type="xsd:float" use="required" />
346+ <xsd:attribute name="yPos" type="xsd:float" use="required" />
347+ <xsd:attribute name="zPos" type="xsd:float" use="required" />
348+
349+ </xsd:complexType>
350+
351+
352+ <xsd:element name="meta" >
353+ <xsd:annotation>
354+ <xsd:documentation>
355+ Meta-information of motion.
356+ Use free.
357+ but, some meta-name has recommended usage.
358+ + "generator" (Generator application name)
359+ + "siteURL" (about motion creator)
360+ </xsd:documentation>
361+ </xsd:annotation>
362+
363+ <xsd:complexType>
364+ <xsd:attribute
365+ name="name"
366+ type="xsd:NCName"
367+ use="required" />
368+ <xsd:attribute
369+ name="content"
370+ type="xsd:string"
371+ use="required" />
372+ </xsd:complexType>
373+
374+ </xsd:element>
375+
376+
377+ <xsd:element name="modelName" >
378+ <xsd:annotation>
379+ <xsd:documentation>
380+ name of motion-model.
381+ </xsd:documentation>
382+ </xsd:annotation>
383+
384+ <xsd:complexType>
385+ <xsd:attribute
386+ name="name"
387+ type="xsd:string"
388+ use="required" />
389+ </xsd:complexType>
390+
391+ </xsd:element>
392+
393+
394+ <xsd:element name="boneMotionSequence" >
395+ <xsd:annotation>
396+ <xsd:documentation>
397+ bone motion data sequence.
398+ </xsd:documentation>
399+ </xsd:annotation>
400+
401+ <xsd:complexType>
402+ <xsd:sequence>
403+ <xsd:element
404+ ref="tns:bonePart"
405+ minOccurs="0" maxOccurs="unbounded" />
406+ </xsd:sequence>
407+ </xsd:complexType>
408+
409+ <xsd:unique name="BoneName" >
410+ <xsd:selector xpath="./tns:bonePart" />
411+ <xsd:field xpath="@name" />
412+ </xsd:unique>
413+
414+ </xsd:element>
415+
416+
417+ <xsd:element name="bonePart" >
418+ <xsd:annotation>
419+ <xsd:documentation>
420+ bone motion data group by bone-name.
421+ </xsd:documentation>
422+ </xsd:annotation>
423+
424+ <xsd:complexType>
425+ <xsd:sequence>
426+ <xsd:element
427+ ref="tns:boneMotion"
428+ minOccurs="0" maxOccurs="unbounded" />
429+ </xsd:sequence>
430+
431+ <xsd:attribute
432+ name="name"
433+ type="xsd:string"
434+ use="required" />
435+ </xsd:complexType>
436+
437+ <xsd:unique name="BoneFrameNo" >
438+ <xsd:selector xpath="./tns:boneMotion" />
439+ <xsd:field xpath="@frame" />
440+ </xsd:unique>
441+
442+ </xsd:element>
443+
444+
445+ <xsd:element name="boneMotion" >
446+ <xsd:annotation>
447+ <xsd:documentation>
448+ bone motion data.
449+ </xsd:documentation>
450+ </xsd:annotation>
451+
452+ <xsd:complexType>
453+ <xsd:complexContent>
454+ <xsd:extension base="tns:FrameNumbered" >
455+ <xsd:sequence>
456+ <xsd:element
457+ ref="tns:bonePosition"
458+ minOccurs="0" maxOccurs="1" />
459+ <xsd:choice>
460+ <xsd:element ref="tns:boneRotQuat" />
461+ <xsd:element ref="tns:boneRotEyxz" />
462+ </xsd:choice>
463+ </xsd:sequence>
464+ </xsd:extension>
465+ </xsd:complexContent>
466+ </xsd:complexType>
467+
468+ </xsd:element>
469+
470+
471+ <xsd:element name="bonePosition" type="tns:PosWithInterpolation" >
472+ <xsd:annotation>
473+ <xsd:documentation>
474+ bone position.
475+ </xsd:documentation>
476+ </xsd:annotation>
477+
478+ </xsd:element>
479+
480+
481+ <xsd:element name="boneRotQuat" >
482+ <xsd:annotation>
483+ <xsd:documentation>
484+ bone rotation. (Quaternion parameters)
485+ </xsd:documentation>
486+ </xsd:annotation>
487+
488+ <xsd:complexType>
489+ <xsd:complexContent>
490+ <xsd:extension base="tns:InterpolationSingle" >
491+ <xsd:attribute name="qx" type="xsd:float" use="required" />
492+ <xsd:attribute name="qy" type="xsd:float" use="required" />
493+ <xsd:attribute name="qz" type="xsd:float" use="required" />
494+ <xsd:attribute name="qw" type="xsd:float" use="required" />
495+ </xsd:extension>
496+ </xsd:complexContent>
497+ </xsd:complexType>
498+
499+ </xsd:element>
500+
501+
502+ <xsd:element name="boneRotEyxz" >
503+ <xsd:annotation>
504+ <xsd:documentation>
505+ bone rotation. (YXZ-Euler rotation parameters)
506+ </xsd:documentation>
507+ </xsd:annotation>
508+
509+ <xsd:complexType>
510+ <xsd:complexContent>
511+ <xsd:extension base="tns:InterpolationSingle" >
512+ <xsd:attribute name="xDeg" type="xsd:float" use="required" />
513+ <xsd:attribute name="yDeg" type="xsd:float" use="required" />
514+ <xsd:attribute name="zDeg" type="xsd:float" use="required" />
515+ </xsd:extension>
516+ </xsd:complexContent>
517+ </xsd:complexType>
518+
519+ </xsd:element>
520+
521+
522+ <xsd:element name="morphSequence" >
523+ <xsd:annotation>
524+ <xsd:documentation>
525+ morphing data sequence.
526+ </xsd:documentation>
527+ </xsd:annotation>
528+
529+ <xsd:complexType>
530+ <xsd:sequence>
531+ <xsd:element
532+ ref="tns:morphPart"
533+ minOccurs="0" maxOccurs="unbounded" />
534+ </xsd:sequence>
535+ </xsd:complexType>
536+
537+ <xsd:unique name="MorphName" >
538+ <xsd:selector xpath="./tns:morphPart" />
539+ <xsd:field xpath="@name" />
540+ </xsd:unique>
541+
542+ </xsd:element>
543+
544+
545+ <xsd:element name="morphPart" >
546+ <xsd:annotation>
547+ <xsd:documentation>
548+ morphing data group by morph-name.
549+ </xsd:documentation>
550+ </xsd:annotation>
551+
552+ <xsd:complexType>
553+ <xsd:sequence>
554+ <xsd:element
555+ ref="tns:morphMotion"
556+ minOccurs="0" maxOccurs="unbounded" />
557+ </xsd:sequence>
558+
559+ <xsd:attribute
560+ name="name"
561+ type="xsd:string"
562+ use="required" />
563+ </xsd:complexType>
564+
565+ <xsd:unique name="MorphFrameNo" >
566+ <xsd:selector xpath="./tns:morphMotion" />
567+ <xsd:field xpath="@frame" />
568+ </xsd:unique>
569+
570+ </xsd:element>
571+
572+
573+ <xsd:element name="morphMotion" >
574+ <xsd:annotation>
575+ <xsd:documentation>
576+ morphing data.
577+ </xsd:documentation>
578+ </xsd:annotation>
579+
580+ <xsd:complexType>
581+ <xsd:complexContent>
582+ <xsd:extension base="tns:FrameNumbered" >
583+ <xsd:attribute
584+ name="flex"
585+ type="tns:MorphFlex"
586+ use="required" />
587+ </xsd:extension>
588+ </xsd:complexContent>
589+ </xsd:complexType>
590+
591+ </xsd:element>
592+
593+
594+ <xsd:element name="cameraSequence" >
595+ <xsd:annotation>
596+ <xsd:documentation>
597+ camera sequence.
598+ </xsd:documentation>
599+ </xsd:annotation>
600+
601+ <xsd:complexType>
602+ <xsd:sequence>
603+ <xsd:element
604+ ref="tns:cameraMotion"
605+ minOccurs="0" maxOccurs="unbounded" />
606+ </xsd:sequence>
607+ </xsd:complexType>
608+
609+ <xsd:unique name="CameraFrameNo" >
610+ <xsd:selector xpath="./tns:cameraMotion" />
611+ <xsd:field xpath="@frame" />
612+ </xsd:unique>
613+
614+ </xsd:element>
615+
616+
617+ <xsd:element name="cameraMotion" >
618+ <xsd:annotation>
619+ <xsd:documentation>
620+ camera data.
621+ </xsd:documentation>
622+ </xsd:annotation>
623+
624+ <xsd:complexType>
625+ <xsd:complexContent>
626+ <xsd:extension base="tns:FrameNumbered" >
627+ <xsd:sequence>
628+ <xsd:element ref="tns:cameraTarget" />
629+ <xsd:element ref="tns:cameraRotation" />
630+ <xsd:element ref="tns:cameraRange" />
631+ <xsd:element ref="tns:projection" />
632+ </xsd:sequence>
633+ <xsd:attribute
634+ name="hasPerspective"
635+ type="xsd:boolean"
636+ use="optional"
637+ default="true" />
638+ </xsd:extension>
639+ </xsd:complexContent>
640+ </xsd:complexType>
641+
642+ </xsd:element>
643+
644+
645+ <xsd:element name="cameraTarget" type="tns:PosWithInterpolation" >
646+ <xsd:annotation>
647+ <xsd:documentation>
648+ camera target.
649+ </xsd:documentation>
650+ </xsd:annotation>
651+
652+ </xsd:element>
653+
654+
655+ <xsd:element name="cameraRotation" >
656+ <xsd:annotation>
657+ <xsd:documentation>
658+ camera-rotation around camera-target
659+ with polar-coordinates parameters.
660+
661+ xRad = -radian(UI_X) [latitude]
662+ yRad = radian(UI_Y) [longitude]
663+ zRad = radian(UI_Z) [roll]
664+ </xsd:documentation>
665+ </xsd:annotation>
666+
667+ <xsd:complexType>
668+ <xsd:complexContent>
669+ <xsd:extension base="tns:InterpolationSingle" >
670+ <xsd:attribute name="xRad" type="xsd:float" use="required" />
671+ <xsd:attribute name="yRad" type="xsd:float" use="required" />
672+ <xsd:attribute name="zRad" type="xsd:float" use="required" />
673+ </xsd:extension>
674+ </xsd:complexContent>
675+ </xsd:complexType>
676+
677+ </xsd:element>
678+
679+
680+ <xsd:element name="cameraRange" >
681+ <xsd:annotation>
682+ <xsd:documentation>
683+ camera range.
684+ sign was negated from UI_RANGE.
685+ </xsd:documentation>
686+ </xsd:annotation>
687+
688+ <xsd:complexType>
689+ <xsd:complexContent>
690+ <xsd:extension base="tns:InterpolationSingle" >
691+ <xsd:attribute
692+ name="range"
693+ type="xsd:float"
694+ use="required" />
695+ </xsd:extension>
696+ </xsd:complexContent>
697+ </xsd:complexType>
698+
699+ </xsd:element>
700+
701+
702+ <xsd:element name="projection" >
703+ <xsd:annotation>
704+ <xsd:documentation>
705+ projection data.
706+ vertDeg : vertical screen-projection angle by degree.
707+ </xsd:documentation>
708+ </xsd:annotation>
709+
710+ <xsd:complexType>
711+ <xsd:complexContent>
712+ <xsd:extension base="tns:InterpolationSingle" >
713+ <xsd:attribute
714+ name="vertDeg"
715+ type="tns:ProjectionAngle"
716+ use="required" />
717+ </xsd:extension>
718+ </xsd:complexContent>
719+ </xsd:complexType>
720+
721+ </xsd:element>
722+
723+
724+ <xsd:element name="luminousSequence" >
725+ <xsd:annotation>
726+ <xsd:documentation>
727+ luminous sequence.
728+ </xsd:documentation>
729+ </xsd:annotation>
730+
731+ <xsd:complexType>
732+ <xsd:sequence>
733+ <xsd:element
734+ ref="tns:luminousAct"
735+ minOccurs="0" maxOccurs="unbounded" />
736+ </xsd:sequence>
737+ </xsd:complexType>
738+
739+ <xsd:unique name="LuminousFrameNo" >
740+ <xsd:selector xpath="./tns:luminousAct" />
741+ <xsd:field xpath="@frame" />
742+ </xsd:unique>
743+
744+ </xsd:element>
745+
746+
747+ <xsd:element name="luminousAct" >
748+ <xsd:annotation>
749+ <xsd:documentation>
750+ luminous data.
751+ </xsd:documentation>
752+ </xsd:annotation>
753+
754+ <xsd:complexType>
755+ <xsd:complexContent>
756+ <xsd:extension base="tns:FrameNumbered" >
757+ <xsd:sequence>
758+ <xsd:element ref="tns:lumiColor" />
759+ <xsd:element ref="tns:lumiDirection" />
760+ </xsd:sequence>
761+ </xsd:extension>
762+ </xsd:complexContent>
763+ </xsd:complexType>
764+
765+ </xsd:element>
766+
767+
768+ <xsd:element name="lumiColor" >
769+ <xsd:annotation>
770+ <xsd:documentation>
771+ luminous color by RGB color space.
772+ </xsd:documentation>
773+ </xsd:annotation>
774+
775+ <xsd:complexType>
776+ <xsd:attribute
777+ name="rCol"
778+ type="tns:ColorComponent"
779+ use="required" />
780+ <xsd:attribute
781+ name="gCol"
782+ type="tns:ColorComponent"
783+ use="required" />
784+ <xsd:attribute
785+ name="bCol"
786+ type="tns:ColorComponent"
787+ use="required" />
788+ </xsd:complexType>
789+
790+ </xsd:element>
791+
792+
793+ <xsd:element name="lumiDirection" >
794+ <xsd:annotation>
795+ <xsd:documentation>
796+ luminous direction by vector.
797+ </xsd:documentation>
798+ </xsd:annotation>
799+
800+ <xsd:complexType>
801+ <xsd:attribute
802+ name="xVec"
803+ type="tns:DirVecComponent"
804+ use="required" />
805+ <xsd:attribute
806+ name="yVec"
807+ type="tns:DirVecComponent"
808+ use="required" />
809+ <xsd:attribute
810+ name="zVec"
811+ type="tns:DirVecComponent"
812+ use="required" />
813+ </xsd:complexType>
814+
815+ </xsd:element>
816+
817+
818+ <xsd:element name="shadowSequence" >
819+ <xsd:annotation>
820+ <xsd:documentation>
821+ shadow sequence.
822+ </xsd:documentation>
823+ </xsd:annotation>
824+
825+ <xsd:complexType>
826+ <xsd:sequence>
827+ <xsd:element
828+ ref="tns:shadowAct"
829+ minOccurs="0" maxOccurs="unbounded" />
830+ </xsd:sequence>
831+ </xsd:complexType>
832+
833+ <xsd:unique name="ShadowFrameNo" >
834+ <xsd:selector xpath="./tns:shadowAct" />
835+ <xsd:field xpath="@frame" />
836+ </xsd:unique>
837+
838+ </xsd:element>
839+
840+
841+ <xsd:element name="shadowAct" >
842+ <xsd:annotation>
843+ <xsd:documentation>
844+ shadow data.
845+ </xsd:documentation>
846+ </xsd:annotation>
847+
848+ <xsd:complexType>
849+ <xsd:complexContent>
850+ <xsd:extension base="tns:FrameNumbered" >
851+ <xsd:attribute
852+ name="mode"
853+ type="tns:ShadowType"
854+ use="required" />
855+ <xsd:attribute
856+ name="rawParam"
857+ type="tns:ShadowRawParam"
858+ use="required" />
859+ </xsd:extension>
860+ </xsd:complexContent>
861+ </xsd:complexType>
862+
863+ </xsd:element>
864+
865+
866+ <xsd:element name="flagSequence" >
867+ <xsd:annotation>
868+ <xsd:documentation>
869+ numbered flag sequence.
870+ </xsd:documentation>
871+ </xsd:annotation>
872+
873+ <xsd:complexType>
874+ <xsd:sequence>
875+ <xsd:element
876+ ref="tns:flagMotion"
877+ minOccurs="0" maxOccurs="unbounded" />
878+ </xsd:sequence>
879+ </xsd:complexType>
880+
881+ <xsd:unique name="FlagFrameNo" >
882+ <xsd:selector xpath="./tns:flagMotion" />
883+ <xsd:field xpath="@frame" />
884+ </xsd:unique>
885+
886+ </xsd:element>
887+
888+
889+ <xsd:element name="flagMotion" >
890+ <xsd:annotation>
891+ <xsd:documentation>
892+ numbered motion flags.
893+ </xsd:documentation>
894+ </xsd:annotation>
895+
896+ <xsd:complexType>
897+ <xsd:complexContent>
898+ <xsd:extension base="tns:FrameNumbered" >
899+ <xsd:sequence>
900+ <xsd:element
901+ ref="tns:ikSwitch"
902+ minOccurs="0" maxOccurs="unbounded" />
903+ </xsd:sequence>
904+ <xsd:attribute
905+ name="showModel"
906+ type="xsd:boolean"
907+ use="required" />
908+ </xsd:extension>
909+ </xsd:complexContent>
910+ </xsd:complexType>
911+
912+ <xsd:unique name="IkBoneName" >
913+ <xsd:selector xpath="./tns:ikSwitch" />
914+ <xsd:field xpath="@name" />
915+ </xsd:unique>
916+
917+ </xsd:element>
918+
919+
920+ <xsd:element name="ikSwitch" >
921+ <xsd:annotation>
922+ <xsd:documentation>
923+ IK ON/OFF switch for each IK-Bone.
924+ </xsd:documentation>
925+ </xsd:annotation>
926+
927+ <xsd:complexType>
928+ <xsd:attribute
929+ name="name"
930+ type="xsd:string"
931+ use="required" />
932+ <xsd:attribute
933+ name="valid"
934+ type="xsd:boolean"
935+ use="required" />
936+ </xsd:complexType>
937+
938+ </xsd:element>
939+
940+
941+</xsd:schema>
942+
943+
944+<!-- EOF -->
diff -r a445d3e35036 -r 89e86bcb809f src/test/java/jp/sfjp/mikutoga/vmd/model/VmdMotionTest.java
--- a/src/test/java/jp/sfjp/mikutoga/vmd/model/VmdMotionTest.java Tue May 21 23:11:29 2013 +0900
+++ b/src/test/java/jp/sfjp/mikutoga/vmd/model/VmdMotionTest.java Sat Jun 08 13:30:39 2013 +0900
@@ -395,7 +395,7 @@
395395
396396 assertEquals(
397397 "model name : カメラ・照明\n"
398- +"bone#0 morph#0 camera#0 luminous#0 shadow#0",
398+ +"bone#0 morph#0 camera#0 luminous#0 shadow#0 flag#0",
399399 motion.toString());
400400
401401 motion.setModelName("model");
@@ -414,10 +414,15 @@
414414 motion.getShadowMotionList().add(new ShadowMotion());
415415 motion.getShadowMotionList().add(new ShadowMotion());
416416 motion.getShadowMotionList().add(new ShadowMotion());
417+ motion.getNumberedFlagList().add(new NumberedVmdFlag());
418+ motion.getNumberedFlagList().add(new NumberedVmdFlag());
419+ motion.getNumberedFlagList().add(new NumberedVmdFlag());
420+ motion.getNumberedFlagList().add(new NumberedVmdFlag());
421+ motion.getNumberedFlagList().add(new NumberedVmdFlag());
417422
418423 assertEquals(
419424 "model name : model\n"
420- +"bone#1 morph#2 camera#3 luminous#4 shadow#5",
425+ +"bone#1 morph#2 camera#3 luminous#4 shadow#5 flag#5",
421426 motion.toString());
422427
423428 return;
diff -r a445d3e35036 -r 89e86bcb809f src/test/resources/testdata/vmd130609/minimum/minmotion.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/test/resources/testdata/vmd130609/minimum/minmotion.xml Sat Jun 08 13:30:39 2013 +0900
@@ -0,0 +1,31 @@
1+<?xml version="1.0" encoding="UTF-8" ?>
2+
3+<!--
4+ MikuMikuDance
5+ motion-data(*.vmd) on XML
6+-->
7+
8+
9+<vmdMotion
10+ xmlns="http://mikutoga.sourceforge.jp/xml/ns/vmdxml/130609A"
11+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
12+ xsi:schemaLocation="http://mikutoga.sourceforge.jp/xml/ns/vmdxml/130609A
13+ http://mikutoga.sourceforge.jp/xml/xsd/vmdxml-130609A.xsd"
14+ version="130609A"
15+>
16+
17+<!-- [NAMELESS] -->
18+<modelName name="" />
19+
20+<boneMotionSequence>
21+</boneMotionSequence>
22+
23+<morphSequence>
24+</morphSequence>
25+
26+<flagSequence>
27+</flagSequence>
28+
29+</vmdMotion>
30+
31+<!-- EOF -->
diff -r a445d3e35036 -r 89e86bcb809f src/test/resources/testdata/vmd130609/small/onlyFlag.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/test/resources/testdata/vmd130609/small/onlyFlag.xml Sat Jun 08 13:30:39 2013 +0900
@@ -0,0 +1,36 @@
1+<?xml version="1.0" encoding="UTF-8" ?>
2+
3+<!--
4+ MikuMikuDance
5+ motion-data(*.vmd) on XML
6+-->
7+
8+
9+<vmdMotion
10+ xmlns="http://mikutoga.sourceforge.jp/xml/ns/vmdxml/130609A"
11+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
12+ xsi:schemaLocation="http://mikutoga.sourceforge.jp/xml/ns/vmdxml/130609A
13+ http://mikutoga.sourceforge.jp/xml/xsd/vmdxml-130609A.xsd"
14+ version="130609A"
15+>
16+
17+<!-- [NAMELESS] -->
18+<modelName name="" />
19+
20+<boneMotionSequence>
21+</boneMotionSequence>
22+
23+<morphSequence>
24+</morphSequence>
25+
26+<flagSequence>
27+ <flagMotion frame="9" showModel="true" />
28+ <flagMotion frame="99" showModel="false">
29+ <ikSwitch name="IKBONE1" valid="true" />
30+ <ikSwitch name="IKBONE2" valid="false" />
31+ </flagMotion>
32+</flagSequence>
33+
34+</vmdMotion>
35+
36+<!-- EOF -->
Show on old repository browser