ThreeJsExportScript.mel 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // ThreeJsExportScript.mel
  2. // Author: Chris Lewis
  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. checkBox -v true -l "Vertices" vertsCb;
  11. checkBox -v true -l "Faces" facesCb;
  12. checkBox -v true -l "Normals" normalsCb;
  13. checkBox -v true -l "UVs" uvsCb;
  14. checkBox -v false -l "Material Indices" materialsCb;
  15. checkBox -v false -l "Colors" colorsCb;
  16. }
  17. else if ($action == "query")
  18. {
  19. string $option = "\"";
  20. if (`checkBox -q -v vertsCb`)
  21. $option += "vertices ";
  22. if (`checkBox -q -v facesCb`)
  23. $option += "faces ";
  24. if (`checkBox -q -v normalsCb`)
  25. $option += "normals ";
  26. if (`checkBox -q -v uvsCb`)
  27. $option += "uvs ";
  28. if (`checkBox -q -v materialsCb`)
  29. $option += "materials ";
  30. if (`checkBox -q -v colorsCb`)
  31. $option += "colors ";
  32. $option += "\"";
  33. eval($callback + $option);
  34. }
  35. return 1;
  36. }