Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rollout BatchCMF "Batch Convert SMD Files v1.0" width:304 height:164
- (
- local get_path
- local get_files
- local set_path
- local name_of_type = #(
- "SMD (.smd)",
- "Adobe_Illustrator (.AI)",
- "DWG_Export (.DWG)",
- "DWF_Exporter (.DWF)",
- "STL_Export (.STL)",
- "FBXEXP (.FBX)",
- "VTA (.VTA)"
- )
- edittext edt1 "" pos:[104,16] width:192 height:16 readonly:true
- button btn1 "Open from ..." pos:[8,13] width:88 height:24
- edittext edt2 "" pos:[104,51] width:192 height:16 readonly:true
- button btn2 "Save to ..." pos:[8,48] width:88 height:24
- dropdownList ddl1 "File type:" pos:[8,82] width:176 height:40 items:name_of_type
- button btn3 "Convert" pos:[192,80] width:104 height:40
- checkbox chk1 "Show settings window for each file" pos:[8,124]
- hyperlink hp1 "bodyulcg.com" address:"http://bodyulcg.com" color:(color 0 190 255) hovercolor:white visitedColor:(color 0 190 255) align:#right
- on btn1 pressed do
- (
- local OpenFileDialog = dotnetobject "System.Windows.Forms.OpenFileDialog"
- OpenFileDialog.multiselect = true
- OpenFileDialog.title = "Open (.SMD) files"
- OpenFileDialog.filter = "3ds SMD (*.SMD)|*.SMD|All files (*.*)|*.*"
- OpenFileDialog.ShowDialog()
- if OpenFileDialog.FileNames.count > 0 then
- (
- get_files = OpenFileDialog.FileNames
- get_path = GetFileNamePath OpenFileDialog.FileNames[1]
- edt1.text = (get_path + " (" + (get_files.count as string) + " .SMD files)")
- )
- )
- on btn2 pressed do
- (
- set_path = getSavePath caption:"Save to ..."
- if set_path != undefined then
- (
- edt2.text = set_path
- )
- )
- on btn3 pressed do
- (
- local file_type = case ddl1.selection of
- (
- 1:".smd"
- 2:".ai"
- 3:".dwg"
- 4:".dwf"
- 5:".stl"
- 6:".fbx"
- 7:".vta"
- default:".smd"
- )
- if get_files != undefined and set_path != undefined then
- (
- for i in get_files do
- (
- loadMaxFile i
- if chk1.state then
- (
- b1 = getNodeByName "head_mat"
- select b1
- exportFile (set_path + "\\" + (GetFileNameFile i) + file_type) selectedOnly:on
- )
- else
- (
- b1 = getNodeByName "head_mat"
- select b1
- exportFile (set_path + "\\" + (GetFileNameFile i) + file_type) selectedOnly:on #noPrompt
- )
- )
- )
- else
- (
- messagebox "Not specified path!" title:"Path"
- )
- )
- )
- createDialog BatchCMF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement