Advertisement
Guest User

Untitled

a guest
Dec 9th, 2019
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.30 KB | None | 0 0
  1. rollout BatchCMF "Batch Convert SMD Files v1.0" width:304 height:164
  2. (
  3. local get_path
  4. local get_files
  5. local set_path
  6. local name_of_type = #(
  7. "SMD (.smd)",
  8. "Adobe_Illustrator (.AI)",
  9. "DWG_Export (.DWG)",
  10. "DWF_Exporter (.DWF)",
  11. "STL_Export (.STL)",
  12. "FBXEXP (.FBX)",
  13. "VTA (.VTA)"
  14. )
  15.  
  16. edittext edt1 "" pos:[104,16] width:192 height:16 readonly:true
  17. button btn1 "Open from ..." pos:[8,13] width:88 height:24
  18. edittext edt2 "" pos:[104,51] width:192 height:16 readonly:true
  19. button btn2 "Save to ..." pos:[8,48] width:88 height:24
  20. dropdownList ddl1 "File type:" pos:[8,82] width:176 height:40 items:name_of_type
  21. button btn3 "Convert" pos:[192,80] width:104 height:40
  22. checkbox chk1 "Show settings window for each file" pos:[8,124]
  23. hyperlink hp1 "bodyulcg.com" address:"http://bodyulcg.com" color:(color 0 190 255) hovercolor:white visitedColor:(color 0 190 255) align:#right
  24.  
  25. on btn1 pressed do
  26. (
  27. local OpenFileDialog = dotnetobject "System.Windows.Forms.OpenFileDialog"
  28. OpenFileDialog.multiselect = true
  29. OpenFileDialog.title = "Open (.SMD) files"
  30. OpenFileDialog.filter = "3ds SMD (*.SMD)|*.SMD|All files (*.*)|*.*"
  31. OpenFileDialog.ShowDialog()
  32.  
  33. if OpenFileDialog.FileNames.count > 0 then
  34. (
  35. get_files = OpenFileDialog.FileNames
  36. get_path = GetFileNamePath OpenFileDialog.FileNames[1]
  37. edt1.text = (get_path + " (" + (get_files.count as string) + " .SMD files)")
  38. )
  39. )
  40.  
  41. on btn2 pressed do
  42. (
  43. set_path = getSavePath caption:"Save to ..."
  44. if set_path != undefined then
  45. (
  46. edt2.text = set_path
  47. )
  48. )
  49.  
  50. on btn3 pressed do
  51. (
  52. local file_type = case ddl1.selection of
  53. (
  54. 1:".smd"
  55. 2:".ai"
  56. 3:".dwg"
  57. 4:".dwf"
  58. 5:".stl"
  59. 6:".fbx"
  60. 7:".vta"
  61. default:".smd"
  62. )
  63. if get_files != undefined and set_path != undefined then
  64. (
  65. for i in get_files do
  66. (
  67. loadMaxFile i
  68. if chk1.state then
  69. (
  70. b1 = getNodeByName "head_mat"
  71. select b1
  72. exportFile (set_path + "\\" + (GetFileNameFile i) + file_type) selectedOnly:on
  73. )
  74. else
  75. (
  76. b1 = getNodeByName "head_mat"
  77. select b1
  78. exportFile (set_path + "\\" + (GetFileNameFile i) + file_type) selectedOnly:on #noPrompt
  79. )
  80. )
  81. )
  82. else
  83. (
  84. messagebox "Not specified path!" title:"Path"
  85. )
  86. )
  87.  
  88. )
  89. createDialog BatchCMF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement