• R/O
  • SSH

Vmd2XML: Commit

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


Commit MetaInfo

Revisione104d146ef83edeb786f10a0440569eec6c0f073 (tree)
Zeit2013-01-28 07:16:57
Autor <olyutorskii@user...>

Log Message

TogaGem対応

Ändern Zusammenfassung

Diff

diff -r 09bb9e37e402 -r e104d146ef83 src/main/java/jp/sourceforge/mikutoga/vmd/model/xml/VmdXmlExporter.java
--- a/src/main/java/jp/sourceforge/mikutoga/vmd/model/xml/VmdXmlExporter.java Fri Dec 28 12:28:50 2012 +0900
+++ b/src/main/java/jp/sourceforge/mikutoga/vmd/model/xml/VmdXmlExporter.java Mon Jan 28 07:16:57 2013 +0900
@@ -134,28 +134,32 @@
134134 */
135135 private void putVmdXmlImpl(VmdMotion vmdMotion)
136136 throws IOException, IllegalVmdDataException{
137- ind().put("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>").ln(2);
137+ ind().putRawText("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>")
138+ .ln(2);
138139
139140 ind().putBlockComment(TOP_COMMENT).ln(2);
140141
141- ind().put("<vmdMotion").ln();
142+ ind().putRawText("<vmdMotion").ln();
142143 pushNest();
143144 ind().putAttr("xmlns", VmdXmlResources.NS_VMDXML).ln();
144145 ind().putAttr("xmlns:" + XSINS, XmlResourceResolver.NS_XSD).ln();
145146
146- ind().put(XSINS).put(":schemaLocation=").put('"');
147- put(VmdXmlResources.NS_VMDXML).ln();
148- ind().sp(2).put(VmdXmlResources.SCHEMAURI_VMDXML).put('"').ln();
147+ ind().putRawText(XSINS).putRawText(":schemaLocation=")
148+ .putRawCh('"');
149+ putRawText(VmdXmlResources.NS_VMDXML).ln();
150+ ind().sp(2).putRawText(VmdXmlResources.SCHEMAURI_VMDXML)
151+ .putRawCh('"')
152+ .ln();
149153
150154 ind().putAttr("version", VmdXmlResources.VER_VMDXML).ln();
151155 popNest();
152- put(">").ln(2);
156+ putRawText(">").ln(2);
153157
154158 if(this.generator != null && this.generator.length() > 0){
155- ind().put("<meta ");
156- putAttr("name", "generator").put(' ');
159+ ind().putRawText("<meta ");
160+ putAttr("name", "generator").putRawCh(' ');
157161 putAttr("content", this.generator);
158- put(" />").ln(2);
162+ putRawText(" />").ln(2);
159163 }
160164
161165 if(vmdMotion.isModelMotion()){
@@ -168,8 +172,8 @@
168172 putShadowSequence(vmdMotion);
169173 }
170174
171- ind().put("</vmdMotion>").ln(2);
172- ind().put("<!-- EOF -->").ln();
175+ ind().putRawText("</vmdMotion>").ln(2);
176+ ind().putRawText("<!-- EOF -->").ln();
173177
174178 return;
175179 }
@@ -210,16 +214,16 @@
210214 private void putBezierCurve(BezierParam bezier)
211215 throws IOException{
212216 if(bezier.isDefaultLinear()){
213- put("<defLinear />");
217+ putRawText("<defLinear />");
214218 }else if(bezier.isDefaultEaseInOut()){
215- put("<defEaseInOut />");
219+ putRawText("<defEaseInOut />");
216220 }else{
217- put("<bezier ");
221+ putRawText("<bezier ");
218222 putIntAttr("p1x", bezier.getP1x()).sp();
219223 putIntAttr("p1y", bezier.getP1y()).sp();
220224 putIntAttr("p2x", bezier.getP2x()).sp();
221225 putIntAttr("p2y", bezier.getP2y()).sp();
222- put("/>");
226+ putRawText("/>");
223227 }
224228 return;
225229 }
@@ -234,9 +238,9 @@
234238 String modelName = vmdMotion.getModelName();
235239
236240 ind().putLineComment(modelName).ln();
237- ind().put("<modelName ");
241+ ind().putRawText("<modelName ");
238242 putAttr("name", modelName).sp();
239- put("/>").ln(2);
243+ putRawText("/>").ln(2);
240244
241245 return;
242246 }
@@ -251,7 +255,7 @@
251255 ind().putBlockComment(QUATERNION_COMMENT);
252256 ind().putBlockComment(BEZIER_COMMENT);
253257
254- ind().put("<boneMotionSequence>").ln();
258+ ind().putRawText("<boneMotionSequence>").ln();
255259
256260 pushNest();
257261 NamedListMap<BoneMotion> listmap = vmdMotion.getBonePartMap();
@@ -262,7 +266,7 @@
262266 }
263267 popNest();
264268
265- ind().put("</boneMotionSequence>").ln(2);
269+ ind().putRawText("</boneMotionSequence>").ln(2);
266270
267271 return;
268272 }
@@ -282,9 +286,9 @@
282286 }
283287 ln();
284288
285- ind().put("<bonePart ");
289+ ind().putRawText("<bonePart ");
286290 putAttr("name", boneName).sp();
287- put(">").ln(2);
291+ putRawText(">").ln(2);
288292
289293 pushNest();
290294 for(BoneMotion bone : list){
@@ -292,7 +296,7 @@
292296 }
293297 popNest();
294298
295- ind().put("</bonePart>").ln(2);
299+ ind().putRawText("</bonePart>").ln(2);
296300
297301 return;
298302 }
@@ -304,10 +308,10 @@
304308 */
305309 private void putBoneMotion(BoneMotion boneMotion)
306310 throws IOException{
307- ind().put("<boneMotion ");
311+ ind().putRawText("<boneMotion ");
308312 int frameNo = boneMotion.getFrameNumber();
309313 putIntAttr("frame", frameNo).sp();
310- put(">").ln();
314+ putRawText(">").ln();
311315
312316 pushNest();
313317 putBonePosition(boneMotion);
@@ -318,7 +322,7 @@
318322 }
319323 popNest();
320324
321- ind().put("</boneMotion>").ln(2);
325+ ind().putRawText("</boneMotion>").ln(2);
322326
323327 return;
324328 }
@@ -334,7 +338,7 @@
334338 return;
335339 }
336340
337- ind().put("<bonePosition ");
341+ ind().putRawText("<bonePosition ");
338342 MkPos3D position = boneMotion.getPosition();
339343 float xPos = (float) position.getXpos();
340344 float yPos = (float) position.getYpos();
@@ -345,15 +349,15 @@
345349
346350 PosCurve posCurve = boneMotion.getPosCurve();
347351 if(posCurve.isDefaultLinear()){
348- put("/>").ln();
352+ putRawText("/>").ln();
349353 }else{
350- put(">").ln();
354+ putRawText(">").ln();
351355
352356 pushNest();
353357 putPositionCurve(posCurve);
354358 popNest();
355359
356- ind().put("</bonePosition>").ln();
360+ ind().putRawText("</bonePosition>").ln();
357361 }
358362
359363 return;
@@ -369,7 +373,7 @@
369373 MkQuat rotation = boneMotion.getRotation();
370374 BezierParam rotCurve = boneMotion.getIntpltRotation();
371375
372- ind().put("<boneRotQuat").ln();
376+ ind().putRawText("<boneRotQuat").ln();
373377 pushNest();
374378 ind().putFloatAttr("qx", (float) rotation.getQ1()).ln();
375379 ind().putFloatAttr("qy", (float) rotation.getQ2()).ln();
@@ -379,15 +383,15 @@
379383 ind();
380384
381385 if(rotCurve.isDefaultLinear()){
382- put("/>").ln();
386+ putRawText("/>").ln();
383387 }else{
384- put(">").ln();
388+ putRawText(">").ln();
385389 pushNest();
386390 ind();
387391 putBezierCurve(rotCurve);
388392 ln();
389393 popNest();
390- ind().put("</boneRotQuat>").ln();
394+ ind().putRawText("</boneRotQuat>").ln();
391395 }
392396
393397 return;
@@ -409,7 +413,7 @@
409413 float yDeg = (float)StrictMath.toDegrees(euler.getYRot());
410414 float zDeg = (float)StrictMath.toDegrees(euler.getZRot());
411415
412- ind().put("<boneRotEyxz").ln();
416+ ind().putRawText("<boneRotEyxz").ln();
413417 pushNest();
414418 ind().putFloatAttr("xDeg", xDeg).ln();
415419 ind().putFloatAttr("yDeg", yDeg).ln();
@@ -418,15 +422,15 @@
418422 ind();
419423
420424 if(rotCurve.isDefaultLinear()){
421- put("/>").ln();
425+ putRawText("/>").ln();
422426 }else{
423- put(">").ln();
427+ putRawText(">").ln();
424428 pushNest();
425429 ind();
426430 putBezierCurve(rotCurve);
427431 ln();
428432 popNest();
429- ind().put("</boneRotEyxz>").ln();
433+ ind().putRawText("</boneRotEyxz>").ln();
430434 }
431435
432436 return;
@@ -439,7 +443,7 @@
439443 */
440444 private void putMorphSequence(VmdMotion vmdMotion)
441445 throws IOException{
442- ind().put("<morphSequence>").ln();
446+ ind().putRawText("<morphSequence>").ln();
443447
444448 pushNest();
445449 NamedListMap<MorphMotion> listmap = vmdMotion.getMorphPartMap();
@@ -447,7 +451,7 @@
447451 putMorphPartList(listmap);
448452 popNest();
449453
450- ind().put("</morphSequence>").ln(2);
454+ ind().putRawText("</morphSequence>").ln(2);
451455
452456 return;
453457 }
@@ -469,9 +473,9 @@
469473 }
470474 ln();
471475
472- ind().put("<morphPart ");
476+ ind().putRawText("<morphPart ");
473477 putAttr("name", morphName).sp();
474- put(">").ln();
478+ putRawText(">").ln();
475479
476480 pushNest();
477481 List<MorphMotion> list = listmap.getNamedList(morphName);
@@ -480,7 +484,7 @@
480484 }
481485 popNest();
482486
483- ind().put("</morphPart>").ln(2);
487+ ind().putRawText("</morphPart>").ln(2);
484488 }
485489
486490 return;
@@ -493,7 +497,7 @@
493497 */
494498 private void putMorphMotion(MorphMotion morphMotion)
495499 throws IOException{
496- ind().put("<morphMotion ");
500+ ind().putRawText("<morphMotion ");
497501
498502 int frameNo = morphMotion.getFrameNumber();
499503 float flex = morphMotion.getFlex();
@@ -501,7 +505,7 @@
501505 putIntAttr("frame", frameNo).sp();
502506 putFloatAttr("flex", flex).sp();
503507
504- put("/>").ln();
508+ putRawText("/>").ln();
505509
506510 return;
507511 }
@@ -516,7 +520,7 @@
516520 ind().putBlockComment(BEZIER_COMMENT);
517521 ind().putBlockComment(CAMERA_COMMENT);
518522
519- ind().put("<cameraSequence>").ln();
523+ ind().putRawText("<cameraSequence>").ln();
520524
521525 pushNest();
522526 List<CameraMotion> list = vmdMotion.getCameraMotionList();
@@ -526,7 +530,7 @@
526530 }
527531 popNest();
528532
529- ind().put("</cameraSequence>").ln(2);
533+ ind().putRawText("</cameraSequence>").ln(2);
530534
531535 return;
532536 }
@@ -538,13 +542,13 @@
538542 */
539543 private void putCameraMotion(CameraMotion cameraMotion)
540544 throws IOException{
541- ind().put("<cameraMotion ");
545+ ind().putRawText("<cameraMotion ");
542546 int frameNo = cameraMotion.getFrameNumber();
543547 putIntAttr("frame", frameNo).sp();
544548 if( ! cameraMotion.hasPerspective() ){
545549 putAttr("hasPerspective", "false").sp();
546550 }
547- put(">").ln();
551+ putRawText(">").ln();
548552
549553 pushNest();
550554 putCameraTarget(cameraMotion);
@@ -553,7 +557,7 @@
553557 putProjection(cameraMotion);
554558 popNest();
555559
556- ind().put("</cameraMotion>").ln(2);
560+ ind().putRawText("</cameraMotion>").ln(2);
557561
558562 return;
559563 }
@@ -565,7 +569,7 @@
565569 */
566570 private void putCameraTarget(CameraMotion cameraMotion)
567571 throws IOException{
568- ind().put("<cameraTarget ");
572+ ind().putRawText("<cameraTarget ");
569573 MkPos3D position = cameraMotion.getCameraTarget();
570574 putFloatAttr("xPos", (float) position.getXpos()).sp();
571575 putFloatAttr("yPos", (float) position.getYpos()).sp();
@@ -573,15 +577,15 @@
573577
574578 PosCurve posCurve = cameraMotion.getTargetPosCurve();
575579 if(posCurve.isDefaultLinear()){
576- put("/>").ln();
580+ putRawText("/>").ln();
577581 }else{
578- put(">").ln();
582+ putRawText(">").ln();
579583
580584 pushNest();
581585 putPositionCurve(posCurve);
582586 popNest();
583587
584- ind().put("</cameraTarget>").ln();
588+ ind().putRawText("</cameraTarget>").ln();
585589 }
586590
587591 return;
@@ -594,7 +598,7 @@
594598 */
595599 private void putCameraRotation(CameraMotion cameraMotion)
596600 throws IOException{
597- ind().put("<cameraRotation ");
601+ ind().putRawText("<cameraRotation ");
598602 CameraRotation rotation = cameraMotion.getCameraRotation();
599603 putFloatAttr("xRad", rotation.getLatitude()).sp();
600604 putFloatAttr("yRad", rotation.getLongitude()).sp();
@@ -602,15 +606,15 @@
602606
603607 BezierParam rotCurve = cameraMotion.getIntpltRotation();
604608 if(rotCurve.isDefaultLinear()){
605- put("/>").ln();
609+ putRawText("/>").ln();
606610 }else{
607- put(">").ln();
611+ putRawText(">").ln();
608612 pushNest();
609613 ind();
610614 putBezierCurve(rotCurve);
611615 ln();
612616 popNest();
613- ind().put("</cameraRotation>").ln();
617+ ind().putRawText("</cameraRotation>").ln();
614618 }
615619
616620 return;
@@ -623,21 +627,21 @@
623627 */
624628 private void putCameraRange(CameraMotion cameraMotion)
625629 throws IOException{
626- ind().put("<cameraRange ");
630+ ind().putRawText("<cameraRange ");
627631 float range = cameraMotion.getRange();
628632 putFloatAttr("range", range).sp();
629633
630634 BezierParam rangeCurve = cameraMotion.getIntpltRange();
631635 if(rangeCurve.isDefaultLinear()){
632- put("/>").ln();
636+ putRawText("/>").ln();
633637 }else{
634- put(">").ln();
638+ putRawText(">").ln();
635639 pushNest();
636640 ind();
637641 putBezierCurve(rangeCurve);
638642 ln();
639643 popNest();
640- ind().put("</cameraRange>").ln();
644+ ind().putRawText("</cameraRange>").ln();
641645 }
642646
643647 return;
@@ -650,20 +654,20 @@
650654 */
651655 private void putProjection(CameraMotion cameraMotion)
652656 throws IOException{
653- ind().put("<projection ");
657+ ind().putRawText("<projection ");
654658 putIntAttr("vertDeg", cameraMotion.getProjectionAngle()).sp();
655659
656660 BezierParam projCurve = cameraMotion.getIntpltProjection();
657661 if(projCurve.isDefaultLinear()){
658- put("/>").ln();
662+ putRawText("/>").ln();
659663 }else{
660- put(">").ln();
664+ putRawText(">").ln();
661665 pushNest();
662666 ind();
663667 putBezierCurve(projCurve);
664668 ln();
665669 popNest();
666- ind().put("</projection>").ln();
670+ ind().putRawText("</projection>").ln();
667671 }
668672
669673 return;
@@ -676,7 +680,7 @@
676680 */
677681 private void putLuminousSequence(VmdMotion vmdMotion)
678682 throws IOException{
679- ind().put("<luminousSequence>").ln();
683+ ind().putRawText("<luminousSequence>").ln();
680684
681685 pushNest();
682686 List<LuminousMotion> list = vmdMotion.getLuminousMotionList();
@@ -686,7 +690,7 @@
686690 }
687691 popNest();
688692
689- ind().put("</luminousSequence>").ln(2);
693+ ind().putRawText("</luminousSequence>").ln(2);
690694
691695 return;
692696 }
@@ -698,10 +702,10 @@
698702 */
699703 private void putLuminousMotion(LuminousMotion luminousMotion)
700704 throws IOException{
701- ind().put("<luminousAct ");
705+ ind().putRawText("<luminousAct ");
702706 int frameNo = luminousMotion.getFrameNumber();
703707 putIntAttr("frame", frameNo);
704- put(" >").ln();
708+ putRawText(" >").ln();
705709
706710 LuminousColor color = luminousMotion.getColor();
707711 LuminousVector vector = luminousMotion.getDirection();
@@ -711,7 +715,7 @@
711715 putLuminousDirection(vector);
712716 popNest();
713717
714- ind().put("</luminousAct>").ln(2);
718+ ind().putRawText("</luminousAct>").ln(2);
715719
716720 return;
717721 }
@@ -723,11 +727,11 @@
723727 */
724728 private void putLuminousColor(LuminousColor color)
725729 throws IOException{
726- ind().put("<lumiColor ");
730+ ind().putRawText("<lumiColor ");
727731 putFloatAttr("rCol", color.getColR()).sp();
728732 putFloatAttr("gCol", color.getColG()).sp();
729733 putFloatAttr("bCol", color.getColB()).sp();
730- put("/>").ln();
734+ putRawText("/>").ln();
731735
732736 return;
733737 }
@@ -739,11 +743,11 @@
739743 */
740744 private void putLuminousDirection(LuminousVector vector)
741745 throws IOException{
742- ind().put("<lumiDirection ");
746+ ind().putRawText("<lumiDirection ");
743747 putFloatAttr("xVec", vector.getVecX()).sp();
744748 putFloatAttr("yVec", vector.getVecY()).sp();
745749 putFloatAttr("zVec", vector.getVecZ()).sp();
746- put("/>").ln();
750+ putRawText("/>").ln();
747751
748752 return;
749753 }
@@ -757,7 +761,7 @@
757761 throws IOException{
758762 ind().putBlockComment(SHADOW_COMMENT);
759763
760- ind().put("<shadowSequence>").ln();
764+ ind().putRawText("<shadowSequence>").ln();
761765
762766 pushNest();
763767 List<ShadowMotion> list = vmdMotion.getShadowMotionList();
@@ -766,7 +770,7 @@
766770 }
767771 popNest();
768772
769- ind().put("</shadowSequence>").ln(2);
773+ ind().putRawText("</shadowSequence>").ln(2);
770774
771775 return;
772776 }
@@ -778,7 +782,7 @@
778782 */
779783 private void putShadowMotion(ShadowMotion shadowMotion)
780784 throws IOException{
781- ind().put("<shadowAct ");
785+ ind().putRawText("<shadowAct ");
782786
783787 int frameNo = shadowMotion.getFrameNumber();
784788 ShadowMode mode = shadowMotion.getShadowMode();
@@ -788,7 +792,7 @@
788792 putAttr("mode", mode.name()).sp();
789793 putFloatAttr("rawParam", rawParam).sp();
790794
791- put("/>");
795+ putRawText("/>");
792796
793797 double uiVal = ShadowMotion.rawParamToScope(rawParam);
794798 long lVal = Math.round(uiVal);
Show on old repository browser