ThreeJsExportScript.mel 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. // ThreeJsExportScript.mel
  2. // Author: Sean Griffin
  3. // Email: [email protected]
  4. global proc int ThreeJsExportScript(string $parent, string $action, string $settings, string $callback)
  5. {
  6. if ($action == "post")
  7. {
  8. setParent $parent;
  9. columnLayout -adj true;
  10. frameLayout -cll true -cl false -bv true -bs "etchedIn" -l "General Export Options";
  11. columnLayout -adj true;
  12. checkBox -v true -l "Vertices" vertsCb;
  13. checkBox -v true -l "Faces" facesCb;
  14. checkBox -v true -l "Normals" normalsCb;
  15. checkBox -v true -l "UVs" uvsCb;
  16. checkBox -v false -l "Colors" colorsCb;
  17. checkBox
  18. -v true
  19. -l "Bones"
  20. -onc "textField -e -en true maxInfluencesText;"
  21. -ofc "textField -e -en false maxInfluencesText;"
  22. bonesCb;
  23. textFieldGrp -tx 4 -label "Max Influences Per Vertex" maxInfluencesText;
  24. setParent ..; // columnLayout
  25. setParent ..; // frameLayout
  26. frameLayout -cll true -cl false -bv true -bs "etchedIn" -l "Skinning Options";
  27. columnLayout -adj true;
  28. checkBox -v true -l "Material Indices" materialsCb;
  29. checkBox -v true -l "Diffuse Maps" diffuseMapsCb;
  30. checkBox -v true -l "Specular Maps" specularMapsCb;
  31. checkBox -v true -l "Bump Maps" bumpMapsCb;
  32. checkBox -v true -l "Copy Texture Files to Target Directory" copyTexturesCb;
  33. setParent ..; // columnLayout
  34. setParent ..; // frameLayout
  35. frameLayout -cll true -cl false -bv true -bs "etchedIn" -l "Animation Options";
  36. columnLayout -adj true;
  37. checkBox -v true -l "Export Animations" animCb;
  38. checkBox
  39. -v false
  40. -l "Bake Animation"
  41. -onc "textField -e -en true startText; textField -e -en true endText; textField -e -en true stepText;"
  42. -ofc "textField -e -en false startText; textField -e -en false endText; textField -e -en false stepText;"
  43. bakeAnimCb;
  44. textField -en false -tx `playbackOptions -minTime true -q` -ann "Start" startText;
  45. textField -en false -tx `playbackOptions -maxTime true -q` -ann "End" endText;
  46. textField -en false -tx 1 -ann "Step" stepText;
  47. setParent ..; // columnLayout
  48. setParent ..; // frameLayout
  49. frameLayout -cll true -cl false -bv true -bs "etchedIn" -l "Debug Options";
  50. columnLayout -adj true;
  51. checkBox -v false -l "Pretty Output" prettyOutputCb;
  52. setParent ..; // columnLayout
  53. setParent ..; // frameLayout
  54. }
  55. else if ($action == "query")
  56. {
  57. string $option = "\"";
  58. if (`checkBox -q -v vertsCb`)
  59. $option += "vertices ";
  60. if (`checkBox -q -v facesCb`)
  61. $option += "faces ";
  62. if (`checkBox -q -v normalsCb`)
  63. $option += "normals ";
  64. if (`checkBox -q -v uvsCb`)
  65. $option += "uvs ";
  66. if (`checkBox -q -v materialsCb`)
  67. $option += "materials ";
  68. if (`checkBox -q -v diffuseMapsCb`)
  69. $option += "diffuseMaps ";
  70. if (`checkBox -q -v specularMapsCb`)
  71. $option += "specularMaps ";
  72. if (`checkBox -q -v bumpMapsCb`)
  73. $option += "bumpMaps ";
  74. if (`checkBox -q -v copyTexturesCb`)
  75. $option += "copyTexturesMaps ";
  76. if (`checkBox -q -v colorsCb`)
  77. $option += "colors ";
  78. if (`checkBox -q -v bonesCb`)
  79. {
  80. $option += "bones ";
  81. $option += `textFieldGrp -q -tx maxInfluencesText`;
  82. $option += " ";
  83. }
  84. if (`checkBox -q -v animCb`)
  85. $option += "skeletalAnim ";
  86. if (`checkBox -q -v bakeAnimCb`)
  87. {
  88. $option += "bakeAnimations ";
  89. $option += `textField -q -tx startText`;
  90. $option += " ";
  91. $option += `textField -q -tx endText`;
  92. $option += " ";
  93. $option += `textField -q -tx stepText`;
  94. $option += " ";
  95. }
  96. if (`checkBox -q -v prettyOutputCb`)
  97. $option += "prettyOutput ";
  98. $option += "\"";
  99. eval($callback + $option);
  100. }
  101. return 1;
  102. }