-- ExtendedXporter.ms -- By Nikolay Litvinov (gniklit@gmail.com) -- v1.4 -- Created On: 13/07/15 -- Modified On: 22/07/15 -- tested using Max 2012 messageBox "Category:\"Niklit Scripts\"" messageBox "Script requered plugins Panda Directx Exporter AND Xporter" macroScript ExtendedXporter Category:"Niklit Scripts" Tooltip:"ExtendedXporter" icon:#("UVWUnwrapModes",19) ( global dirPath="c:\\export\\" global stateFN=off global stateParam=off global xname theClasses =exporterPlugin.classes PandNum=finditem theClasses PandaDirectXMaxExporter Xnum=finditem theClasses X_File_Export fn fn_ExpXporterFN =( makeDir dirPath all:on exportFile (dirPath+selection[1].name+".X") using:theClasses[Xnum] shellLaunch "explorer.exe" dirPath ) fn fn_ExpXporter_SEL_FN= ( maxFile1 = getFilenameFile MaxFileName workFile = MaxFilePath + maxFile1 + ".max" saveMaxFile workFile macros.run "by 111" "copy_Object" loadMaxFile xname quiet: on max select all fn_ExpXporterFN() loadMaxFile workFile quiet: on ) fn fn_fixerObj = ( if selection[1] != undefined do --Verify there is an object selected selection[1].layer.current=true --Make the currently selected object's layer the "current" layer arSel=selection as array selFixed=#() for i=1 to selection.count do ( fixObj = editable_mesh name: arSel[i].name; converttoPoly fixObj fixObj.attach arSel[i] fixObj append selFixed fixObj ) select selFixed $.backfacecull = on ) fn fn_IMPOTR_Xporter=( max create mode for obj in selection do ( addModifier obj (Turn_to_Mesh useInvisibleEdges: off) convertToPoly obj ) ) fn fn_EXPORT_Xporter=( max create mode if selection.count==0 then messagebox "0 objects selected" else if selection.count==objects.count then fn_ExpXporterFN() else fn_ExpXporter_SEL_FN() ) fn fn_EXPORT_Panda = ( makeDir dirPath all:on exportFile (dirPath+selection[1].name+".X") #noPrompt selectedOnly: true using:theClasses[PandNum] shellLaunch "explorer.exe" dirPath) fn fn_EXPORT_Panda_Adv = ( makeDir dirPath all:on exportFile (dirPath+selection[1].name+".X") selectedOnly: true using:theClasses[PandNum] shellLaunch "explorer.exe" dirPath) try DestroyDialog ImpExp catch() rollout ImpExp "ImpExp" width:111 height:240 ( button btn1 "EXPORT" pos:[6,15] width:97 height:25 groupBox grp1 "Panda Export" pos:[2,-1] width:105 height:87 checkButton ckb1 "" pos:[6,45] width:15 height:15 label lbl1 "Advanced" pos:[24,45] width:53 height:14 checkButton ckb2 "" pos:[6,64] width:15 height:15 tooltip:"Fix objects for X file.\nForexample lost names after Export by Panda" label lbl2 "Fix objects" pos:[24,64] width:53 height:14 groupBox grp2 "Xporter" pos:[2,86] width:105 height:75 button btn2EXport "EXPORT" pos:[6,104] width:97 height:25 button btn3IXport "Post Import Fix" pos:[6,132] width:97 height:25 tooltip:"Fix objects (Turn to Mesh) after import X to 3dsMax" button btn4MAXExport "MAX Export" pos:[6,205] width:97 height:25 button btn5MAXImport "MAX Import" pos:[6,178] width:97 height:25 groupBox grp3 "MAX" pos:[2,162] width:105 height:75 on ckb1 changed state do if state == on then stateParam=on else stateParam=off on ckb2 changed state do if state == on then stateFN=on else stateFN=off on btn1 pressed do (if selection.count==0 then messageBox "0 objects selected" else if stateFN ==off then if stateParam==off then fn_EXPORT_Panda() else fn_EXPORT_Panda_Adv() else if stateParam==off then (fn_fixerObj(); fn_EXPORT_Panda()) else (fn_fixerObj(); fn_EXPORT_Panda_Adv()) --DestroyDialog ImpExp ) on btn2EXport pressed do fn_EXPORT_Xporter() on btn3IXport pressed do fn_IMPOTR_Xporter() on btn4MAXExport pressed do max file export on btn5MAXImport pressed do max file import ) CreateDialog ImpExp ) --- 111_xCopy_v0.1 -- 22 march 2007 - andrei kletskov - andklv@mail.ru macroScript copy_Object category:"by 111" toolTip:"copy Object" (try (xpath = GetDir #export global xname = xpath + "\\xCopy.max" saveNodes selection xname quiet:true PushPrompt ((selection.count as string) + " objects copied")) catch (PushPrompt "Error") ) --- 111_xPaste_v0.1 -- 22 march 2007 - andrei kletskov - andklv@mail.ru macroScript paste_Object category:"by 111" toolTip:"paste Object" (try (xpath = GetDir #export xname = xpath + "\\xCopy.max" mergemaxfile xname #select PushPrompt "Pasted") catch (PushPrompt "Error") )