try (closeRolloutFloater PCToolFloater) catch() PCToolFloater = NewRolloutFloater "PCTool ver1.3" 520 285 rollout ImportExport "Import/Export" ( --layout-- radioButtons Rdo_SelImEx "" pos:[190,5] width:80 height:30 labels:#("Import ", "Export") edittext Tex_Dir "" pos:[10,30] width:400 height:20 button Btn_Dir "..." pos:[415,30] width:20 height:20 button Btn_ImportOrExport "Import" pos:[445,30] width:50 height:50 label Lbl_ModType "ModType:" pos:[20,60] width:50 height:20 dropdownList Ddl_ModType "" pos:[70,57] width:50 height:22 items:#("OBJ", "WSM") selection:1 label Lbl_FileType "FileType:" pos:[130,60] width:45 height:20 dropdownList Ddl_FileType "" pos:[175,57] width:50 height:22 items:#(".xml", ".pc2") selection:2 spinner Spn_FrameStart "Frame:" pos:[265,60] width:60 height:16 range:[-999,9999,animationRange.start] type:#integer enabled:false spinner Spn_FrameEnd "`" pos:[340,60] width:60 height:16 range:[-999,9999,animationRange.end] type:#integer enabled:false checkbox Chk_AfterModDel "AfterModDel" pos:[20,90] width:100 height:20 checked:false enabled:false checkbox Chk_UseExistingMod "UseExistingMod" pos:[130,90] width:100 height:20 --fn-- fn fn_UEM ImEx_state = ( for o in objects do ( local FileName = Tex_Dir.text + "\\" + o.name + Ddl_FileType.selected if superClassOf o == GeometryClass or superClassOf o == shape then ( for m in o.modifiers where classof m == SelectMod do ( m.fileName = FileName if ImEx_state == 2 then (cacheOps.RecordCache m) ) ) ) ) fn fn_select ImEx_state = ( TargetObj =#() for s in selection do (append TargetObj s) for t in TargetObj do ( local FileName = Tex_Dir.text + "\\" + t.name + Ddl_FileType.selected if superClassOf t == GeometryClass or superClassOf t == shape then ( addmodifier t (SelectMod fileName:FileName) if ImEx_state == 2 then ( t.modifiers[1].recordStart = Spn_FrameStart.value t.modifiers[1].recordEnd = Spn_FrameEnd.value cacheOps.RecordCache t.modifiers[1] if Chk_AfterModDel.checked == true then (deleteModifier t t.modifiers[1]) ) ) ) ) --code-- on Rdo_SelImEx changed state do ( if state == 1 then ( Btn_ImportOrExport.text = "Import" Chk_AfterModDel.enabled = false Spn_FrameStart.enabled = false Spn_FrameEnd.enabled = false ) else ( Btn_ImportOrExport.text = "Export" Spn_FrameStart.enabled = true Spn_FrameEnd.enabled = true if Chk_UseExistingMod.checked == false then (Chk_AfterModDel.enabled = true) ) ) on Chk_UseExistingMod changed state do ( if state == true then (if Rdo_SelImEx.state == 2 then (Chk_AfterModDel.enabled = false)) else (if Rdo_SelImEx.state == 2 then (Chk_AfterModDel.enabled = true)) ) on Btn_Dir pressed do ( local ReferenceName = getSavePath caption:"Select Directory" if ReferenceName != undefined then (Tex_Dir.text = ReferenceName) ) on Btn_ImportOrExport pressed do ( if Tex_Dir.text != "" then ( local SelectMod case Ddl_ModType.text of ( "OBJ": SelectMod = Point_Cache "WSM": SelectMod = Point_CacheSpacewarpModifier ) if Btn_ImportOrExport.text == "Import" then ( if Chk_UseExistingMod.checked == true then (fn_UEM 1) else (fn_select 1) ) if Btn_ImportOrExport.text == "Export" then ( if Chk_UseExistingMod.checked == true then (fn_UEM 2) else (fn_select 2) ) clearSelection() ) else (messageBox "Please Input Directory.") ) ) addRollout ImportExport PCToolFloater rollout Others "Others" ( --layout-- GroupBox Gb_Mod "Modifiers" pos:[10,5] width:90 height:40 button Btn_ModOn "on" pos:[15,20] width:35 height:20 button Btn_ModOff "off" pos:[55,20] width:35 height:20 GroupBox Gb_ModBelow "ModifiersBelow" pos:[10,55] width:90 height:40 button Btn_BelowOn "on" pos:[15,70] width:35 height:20 button Btn_BelowOff "off" pos:[55,70] width:35 height:20 GroupBox Gb_LoadType "LoadType(Local)" pos:[110,5] width:120 height:40 button Btn_File "File" pos:[115,20] width:50 height:20 button Btn_Mem "Mem" pos:[170,20] width:50 height:20 GroupBox Gb_LoadTypeNet "LoadType(Network)" pos:[110,55] width:120 height:40 button Btn_FileNet "File" pos:[115,70] width:50 height:20 button Btn_MemNet "Mem" pos:[170,70] width:50 height:20 listbox Lbx_ListPCObj "" pos:[240,10] width:155 height:7 dropdownList Ddl_ListType "" pos:[400,5] width:60 height:22 items:#("All", "OBJ", "WSM") button Btn_ListReload "Reload" pos:[465,5] width:40 height:20 button Btn_ListAll "All" pos:[420,35] width:65 height:30 button Btn_ListSel "Select" pos:[420,70] width:65 height:30 --fn-- fn PCSelOBJ = ( clearSelection() local PCobj = #() for o in objects do (if o.modifiers[Point_Cache] != undefined then append PCobj o) select PCobj ) fn PCSelWSM = ( clearSelection() local PCobj = #() for o in objects do (if o.modifiers[Point_CacheSpacewarpModifier] != undefined then append PCobj o) select PCobj ) fn ModifiersEnabled onoff = ( PCSelOBJ() if selection != undefined then (for s in selection do(s.modifiers[Point_Cache].enabled = onoff)) PCSelWSM() if selection != undefined then (for s2 in selection do(s2.modifiers[Point_CacheSpacewarpModifier].enabled = onoff)) clearSelection() ) fn ModifiersBelow onoff = ( PCSelOBJ() if selection != undefined then ( local PCobjOBJ = #() for s in selection do append PCobjOBJ s for s2 in PCobjOBJ do ( select s2 case onoff of ( 0 : cacheOps.EnableBelow $.modifiers[Point_Cache] 1 : cacheOps.DisableBelow $.modifiers[Point_Cache] ) ) ) PCSelWSM() if selection != undefined then ( local PCobjWSM = #() for s3 in selection do append PCobjWSM s3 for s4 in PCobjWSM do ( select s4 case onoff of ( 0 : cacheOps.EnableBelow $.modifiers[Point_CacheSpacewarpModifier] 1 : cacheOps.DisableBelow $.modifiers[Point_CacheSpacewarpModifier] ) ) ) clearSelection() ) fn LoadType_Local FileOrMem = ( PCSelOBJ() if selection != undefined then (for s in selection do(s.modifiers[Point_Cache].loadType = FileOrMem)) PCSelWSM() if selection != undefined then (for s2 in selection do(s2.modifiers[Point_CacheSpacewarpModifier].loadType = FileOrMem)) clearSelection() ) fn LoadType_Network FileOrMem = ( PCSelOBJ() if selection != undefined then (for s in selection do(s.modifiers[Point_Cache].loadTypeSlave = FileOrMem)) PCSelWSM() if selection != undefined then (for s2 in selection do(s2.modifiers[Point_CacheSpacewarpModifier].loadTypeSlave = FileOrMem)) clearSelection() ) --code-- on Btn_ModOn pressed do (ModifiersEnabled true) on Btn_ModOff pressed do (ModifiersEnabled false) on Btn_BelowOn pressed do (ModifiersBelow 0) on Btn_BelowOff pressed do (ModifiersBelow 1) on Btn_File pressed do (LoadType_Local 0) on Btn_Mem pressed do (LoadType_Local 2) on Btn_FileNet pressed do (LoadType_Network 1) on Btn_MemNet pressed do (LoadType_Network 2) on Btn_ListReload pressed do ( if Ddl_ListType.text == "All" then ( List_All = #() for o in objects do (if o.modifiers[Point_Cache] != undefined or o.modifiers[Point_CacheSpacewarpModifier] != undefined then (append List_All o.name)) Lbx_ListPCObj.items = List_All ) if Ddl_ListType.text == "OBJ" then ( List_OBJ = #() for o in objects do (if o.modifiers[Point_Cache] != undefined then (append List_OBJ o.name)) Lbx_ListPCObj.items = List_OBJ ) if Ddl_ListType.text == "WSM" then ( List_WSM = #() for o in objects do (if o.modifiers[Point_CacheSpacewarpModifier] != undefined then (append List_WSM o.name)) Lbx_ListPCObj.items = List_WSM ) ) on Btn_ListAll pressed do ( clearSelection() for num in Lbx_ListPCObj.items do (selectmore (getNodeByName num)) ) on Btn_ListSel pressed do ( clearSelection() try (select (getNodeByName Lbx_ListPCObj.selected)) catch() ) ) addRollout Others PCToolFloater