/* -- Bitmap List [.NET] by Pichaya Popanyasak [Tong] -- p_popanyasak@hotmail.com */ --clearlistener() Global maxVer = 2000+(((maxVersion())[1]/1000.0)-2) as Integer Global scriptVer = "Beta 1.1" Global AllTextureSlot = #() Global AllTexture = #() Global BitmapList_rollout, InfoRollout, Help_Rollout, AboutRollout Global ArrayRollSize = #(1350,680) Global the_Menu, ArrayItemSel -- #################################################### Strart MXS Function #################################################### function substract_Array Array1 Array2 = ( local Array3=#() for i in Array1 do (if finditem Array2 i==0 then append Array3 i) for i in Array2 do (if finditem Array1 i==0 then append Array3 i) return Array3 ) -- End Fn fn indexStr total current = ( total_str = (total as string).count current_str = (current as string).count dif_str = total_str - current_str index = "" for n = 1 to dif_str do (index += "0") index += current as string ) -- End Fn fn StrPathOnly StrPath Val = ( StrArray = filterString (StrPath) "\\" -- Filter File Path StrPath = "" for s = 2 to (StrArray.count - Val) do ( if s != (StrArray.count - Val) then (StrPath += StrArray[s] + "\\") else (StrPath += StrArray[s]) ) return StrPath ) -- End Fn fn findTextures ThisTexture ThisSlot = --Search the Texture for all sub textures ( if ThisTexture != undefined do ( texcount = (getNumSubTexmaps ThisTexture) if texcount == 0 do --parent textures don't have a filename (will error) ( append AllTextureSlot ThisSlot -- Add Slot Name into Array append AllTexture ThisTexture -- Add Bitmaptexture into Array ) -- End If for i in 1 to texcount do ( texture_slot = (getSubTexmapSlotName ThisTexture i) -- Get Texture Slot Nmae texture = (getSubTexMap ThisTexture i) -- Get Texture findTextures texture texture_slot ) -- End Loop ) -- End If ) -- End FN fn findMaterials ThisMat = --Search the Material or object for all sub materials and sub textures ( if ThisMat != undefined do ( subtexcount = try (getNumSubTexmaps ThisMat) catch (0) if subtexcount != 0 do ( try ( for i in 1 to subtexcount do ( the_slot = getSubTexmapSlotName ThisMat i -- Get Texture Slot Nmae the_submat = getSubTexMap ThisMat i -- Get Texture findTextures the_submat the_slot ) -- End Loop ) catch () -- End Try ) -- End If submatcount = try (getNumSubMtls ThisMat) catch (0) if submatcount != 0 do ( try ( for i in 1 to submatcount do (findMaterials (getSubMtl ThisMat i)) -- End Loop ) catch () -- End Try ) -- End If ) -- End If ) -- End FN fn CollectFiles = ( CollectPath = getSavePath caption:"Select Collect Folder" if CollectPath != undefined do ( Array_File = for i in ArrayItemSel collect (AllTexture[i as integer].filename) for f in Array_File do (copyfile f (CollectPath + "\\" + (filenameFromPath f))) messagebox "Finish" ) ) -- End FN fn ArchiveFiles = ( ArchivePath = getSaveFileName caption:"Select Archive Folder" types:"Zip (*.zip)" if ArchivePath != undefined do ( thePath = GetFileNamePath ArchivePath theName = getFilenameFile ArchivePath archive_file = (thePath + theName + ".txt") zip_destination = (thePath + theName + ".zip") temp_archive_file = createfile archive_file Array_File = for i in ArrayItemSel collect (AllTexture[i as integer].filename) for f in Array_File do format "%\n" f to:temp_archive_file format "%\n" archive_file to:temp_archive_file close temp_archive_file ShellLaunch ((GetDir #maxroot) + "maxzip.exe") (zip_destination + " @" + archive_file) messagebox "Finish" ) ) -- End FN fn OpenPS ArrayItem = ( Array_File = for i in ArrayItem collect (AllTexture[i as integer].filename) ps = CreateOLEObject"Photoshop.Application" ps.Visible = true try (for f in Array_File do ps.open f) catch () ) -- End FN fn HighlightAssets Array_File = ( ATSOps.Refresh() ATSOps.visible = true ATSOps.SelectFiles &Array_File ) -- End FN fn strip_paths_missing = ( local missingpaths = #() ATSOps.visible=true ATSOps.GetFilesByFileSystemStatus #missing &missingpaths ATSOps.SelectFiles &missingpaths ATSOps.SetPathOnSelection "" ATSOps.visible=false ) -- End FN fn relink_found_paths = ( local foundpaths = #() ATSOps.visible=true ATSOps.CheckNetworkPaths=true setWaitCursor() ATSOps.Getfiles &foundpaths ATSOps.GetFilesByFileSystemStatus #found &foundpaths while foundpaths.count > 0 do ( for p = 1 to foundpaths.count do foundpaths[p] = mapPaths.getFullFilePath foundpaths[p] ATSOps.SelectFiles &foundpaths ATSOps.ResolveSelectionToAbsolute() ATSOps.Getfiles &foundpaths ATSOps.GetFilesByFileSystemStatus #found &foundpaths ) ATSOps.visible=false setArrowCursor() ) -- End FN fn Help_Rollout = ( if HelpRollout != undefined then destroydialog HelpRollout rollout HelpRollout "Help" width:480 height:800 ( dotNetControl dncText "System.Windows.Forms.Textbox" width:(HelpRollout.width-5) height:(HelpRollout.height-10) align:#center on HelpRollout open do ( str = "Description :\r\n" str += "The script \"Bitmap List [ .NET ] - Version : " + scriptVer + " \" use dotNetClass ListView and Maxform.\r\n" str += "The script for use change location bitmap and stuff in 3ds Max.\r\n" str += "The script support 3ds Max 2009 - Higher.\r\n\r\n" str += "Author :\r\n" str += "Pichaya Popanyasak, email : p_popanyasak@hotmail.com, Thailand.\r\n\r\n" str += "Modified :\r\n" str += (getFileModDate (getThisScriptFilename())) + "\r\n\r\n" str += "Menu Control :\r\n" str += "- File:\r\n" str += " - Asset Tracking... : Open Asset Tracking.\r\n" str += " - Material Editor : Open Material Editor.\r\n" str += " - Collect Files : Collect Select Items to Select Folder.\r\n" str += " - Archive Files : Archive Select Items to Zip.\r\n" str += " - Reflesh : Reflesh Items.\r\n" str += " - Exit : Exit.\r\n" str += "- Edit:\r\n" str += " - Scene Materials : Show Item from Scene Material.\r\n" str += " - Material Editor Materials : Show Item from Material Editor.\r\n" str += " - Selection Materials : Show Item from Select Object.\r\n" str += " - Highlight Assets in ATS Dialog : Highlight Assets in ATS Dialog.\r\n" str += " - Reveal Location in Explorer : Reveal Location in Explorer.\r\n" str += " - Find Material Object Selection : Find Material in List with Object Selection.\r\n" str += " - Bitmap View : View Bimap from Select a Item.\r\n" str += " - Bitmap Info : Show Bitmap Info from Select a Item.\r\n" str += " - Open in Photoshop : Open Bitmap in Photoshop.\r\n" str += " - Select All : Select All Items.\r\n" str += " - Select None : Select None Item.\r\n" str += " - Select Invert : Select Invert Items.\r\n" str += "- Tools:\r\n" str += " - Strip Paths Missing: Strip Paths from Missing Status.\r\n" str += " - Relink Found Paths: Relink Paths Location from Found Status.\r\n" str += "- Help:\r\n" str += " - Help : Open Help.\r\n" str += " - About : Open About.\r\n\r\n" str += "Form Control :\r\n" str += "- Click Column Header : For Sort Items.\r\n" str += "- Select [First Spinner] : For Start Item Select.\r\n" str += "- Select [Second Spinner] : For End Item Select.\r\n" str += "- Select [Button Select] : For Select Items Between 2 Spinner.\r\n" str += "- Map Name [Edit Box] : Type Name for Bitmap Texture.\r\n" str += "- Map Name [Button Change] : Rename Bitmap Texture.\r\n" str += "- Drive [Check Box] : Use Select Drive Option.\r\n" str += "- Drive [Edit Box] : Put Drive in Edit Text. If Network Path please use \"\\\\\" First.\r\n" str += "- Path [Check Box] : Use Path Option.\r\n" str += "- Path [Edit Box] : Type Path.\r\n" str += "- Path [Button ... / Browse] : Browse Path.\r\n" str += "- Name [Check Box] : Use Name Option.\r\n" str += "- Name [Edit Box] : Type Name.\r\n" str += "- Change [Button Change] : Change Select Items Bitmap Texture Location.\r\n" str += "- Search [Drop Down List] : Select Column for Search.\r\n" str += "- Search [Edit Box] : Put Text for Search (can use * and ? for search).\r\n" str += "- Search [Button Search] : Search Items.\r\n\r\n" str += "Hotkey Control :\r\n" str += "- F5 : Reflesh Items.\r\n" str += "- Ctrl+W : Exit.\r\n" str += "- Ctrl+H : Highlight Assets in ATS Dialog.\r\n" str += "- Ctrl+E : Reveal Location in Explorer.\r\n" str += "- Ctrl+M : Find Material in List with Object Selection.\r\n" str += "- Ctrl+V : View Bimap from Select a Item." str += "- Spacebar : Show Bitmap Info.\r\n" str += "- Ctrl+O : Open Bitmap in Photoshop.\r\n" str += "- Ctrl+A : Select All Items.\r\n" str += "- Ctrl+D : Select None Item.\r\n" str += "- Ctrl+I : Select Invert Items.\r\n" str += "- A-Z : Put Drive in Edit Text.\r\n" str += "- F1 : Open Help.\r\n\r\n" str += "Mouse Control :\r\n" str += "- LMB : Select Items.\r\n" str += "- Ctrl+Double+LMB [Material] : Assign Base Material from Item to Object Selection.\r\n" str += "- Double+LMB [Material] : Put Base Material from Item into Material Editor Active Slot.\r\n" str += "- Double+LMB [Drive] : Put Drive from Item in Edit Text.\r\n" str += "- Double+LMB [Path] : Put Path from Item in Edit Text.\r\n" str += "- Double+LMB [Name] : Put Name from Item in Edit Text.\r\n" str += "- Double+LMB [Node] : Select Objects use Material from Item.\r\n" str += "- Double+RMB [On Column] : Select Items Same Value." dncText.Font = dotNetObject "System.Drawing.Font" "Verdana" 7 ((dotNetClass "System.Drawing.FontStyle").Regular) dncText.BorderStyle = (dotNetClass "System.Windows.Forms.BorderStyle").FixedSingle dncText.BackColor = (dotNetClass "System.Drawing.Color").fromARGB 220 220 220 dncText.ForeColor = (dotNetClass "System.Drawing.Color").fromARGB 50 50 50 dncText.ScrollBars = (dotNetClass "System.Windows.Forms.ScrollBars").Vertical dncText.TextAlign = (dotNetClass "System.Windows.Forms.HorizontalAlignment").Left dncText.MultiLine = dncText.WordWrap = dncText.readOnly = true dncText.Text = str ) on HelpRollout resized rollout_size do ( if rollout_size.x >= 480 or rollout_size.y >= 350 then (dncText.Size = dotNetObject "System.Drawing.Size" (rollout_size.x-5) (rollout_size.y-10)) ) on HelpRollout rbuttonup press do destroydialog HelpRollout ) createDialog HelpRollout modal:true style:#(#style_titlebar,#style_sysmenu,#style_sunkenedge,#style_border,#style_resizing) ) -- End FN fn BitmapInfo_Rollout = ( if BitmapList_rollout.lv_objects.SelectedItems.count == 1 then ( if InfoRollout != undefined then destroydialog InfoRollout rollout InfoRollout "Bitmap Info" width:550 height:100 ( dotNetControl Info_dncText "System.Windows.Forms.Textbox" width:(InfoRollout.width-5) height:(InfoRollout.height-10) align:#center timer tmclose "" interval:10000 active:true on InfoRollout open do ( try ( str = "File Name : " + ((getBitmapInfo (AllTexture[BitmapList_rollout.lv_objects.SelectedItems.Item[0].text as Integer].bitmap.filename))[1] as string) + "\r\n" str += "File Type : " + ((getBitmapInfo (AllTexture[BitmapList_rollout.lv_objects.SelectedItems.Item[0].text as Integer].bitmap.filename))[2] as string) + "\r\n" str += "File Size : " + ((getBitmapInfo (AllTexture[BitmapList_rollout.lv_objects.SelectedItems.Item[0].text as Integer].bitmap.filename))[3] as string) + " x " str += ((getBitmapInfo (AllTexture[BitmapList_rollout.lv_objects.SelectedItems.Item[0].text as Integer].bitmap.filename))[4] as string) + "\r\n" str += "RGB Bits : " + ((getBitmapInfo (AllTexture[BitmapList_rollout.lv_objects.SelectedItems.Item[0].text as Integer].bitmap.filename))[5] as string) + "\r\n" str += "Alpha Bits : " + ((getBitmapInfo (AllTexture[BitmapList_rollout.lv_objects.SelectedItems.Item[0].text as Integer].bitmap.filename))[6] as string) + "\r\n" str += "Aspect Ratio : " + ((getBitmapInfo (AllTexture[BitmapList_rollout.lv_objects.SelectedItems.Item[0].text as Integer].bitmap.filename))[7] as string) + "\r\n" str += "Gamma : " + ((getBitmapInfo (AllTexture[BitmapList_rollout.lv_objects.SelectedItems.Item[0].text as Integer].bitmap.filename))[8] as string) ) catch ( str = "Bitmap None Info." ) Info_dncText.Font = dotNetObject "System.Drawing.Font" "Verdana" 7 ((dotNetClass "System.Drawing.FontStyle").Regular) Info_dncText.BorderStyle = (dotNetClass "System.Windows.Forms.BorderStyle").FixedSingle Info_dncText.BackColor = (dotNetClass "System.Drawing.Color").fromARGB 220 220 220 Info_dncText.ForeColor = (dotNetClass "System.Drawing.Color").fromARGB 50 50 50 Info_dncText.ScrollBars = (dotNetClass "System.Windows.Forms.ScrollBars").Vertical Info_dncText.TextAlign = (dotNetClass "System.Windows.Forms.HorizontalAlignment").Left Info_dncText.MultiLine = Info_dncText.WordWrap = Info_dncText.readOnly = true Info_dncText.Text = str ) on InfoRollout rbuttonup press do destroydialog InfoRollout on tmclose tick do destroydialog InfoRollout ) createDialog InfoRollout bgcolor:(color 160 160 160) modal:true style:#(#style_titlebar,#style_sysmenu,#style_sunkenedge,#style_border) ) else ( messagebox "Please Select 1 Item" ) ) -- End FN -- ////////////////////////////////////////////////////////////////////////////////////////////// End MSX Function ////////////////////////////////////////////////////////////////////////////////////////////// try (destroyDialog BitmapList_rollout) catch () rcMenu the_Menu ( subMenu "File" ( menuItem menu_OpenAsset "Asset Tracking..." menuItem menu_OpenMeditMat "Material Editor" separator sep0 menuItem menu_CollectFiles "Collect Files" menuItem menu_ArchiveFiles "Archive Files" separator sep1 menuItem menu_Reflesh "Reflesh F5" separator sep2 menuItem menu_Exit "Exit Esc" ) subMenu "Edit" ( menuItem menu_SceneMat "Scene Materials" menuItem menu_MeditMat "Meterial Editor Materials" menuItem menu_SelMat "Selection Materials" separator sep3 menuItem menu_HighLightAsset "Highlight Assets in ATS Dialog Ctrl+H" menuItem menu_RevealEx "Reveal Location in Explorer Ctrl+E" menuItem menu_FindMatObj "Find Material Object Selection Ctrl+M" menuItem menu_View "Bitmap View Ctrl+V" menuItem menu_BitmapInfo "Bitmap Info Spacebar" menuItem menu_OpenPS "Open in Photoshop Ctrl+O" separator sep4 menuItem menu_SelAll "Select All Ctrl+A" menuItem menu_SelNone "Select None Ctrl+D" menuItem menu_SelInvert "Select Invert Ctrl+I" ) subMenu "Tools" ( menuItem menu_StripPathsMissing "Strip Paths Missing" menuItem menu_RelinkFoundPath "Relink Found Paths" ) subMenu "Help" ( menuItem menu_Help "Help F1" separator sep5 menuItem menu_About "About" ) on menu_OpenAsset picked do (ATSOps.visible=true) on menu_OpenMeditMat picked do (MatEditor.Open()) on menu_CollectFiles picked do (CollectFiles()) on menu_ArchiveFiles picked do (ArchiveFiles()) on menu_Reflesh picked do ( if the_Menu.menu_SceneMat.checked == true do ( the_Menu.menu_SceneMat.checked = true the_Menu.menu_MeditMat.checked = the_Menu.menu_SelMat.checked = false BitmapList_rollout.Scene_Mat() ) if the_Menu.menu_MeditMat.checked == true do ( the_Menu.menu_MeditMat.checked = true the_Menu.menu_SceneMat.checked = the_Menu.menu_SelMat.checked = false BitmapList_rollout.Medit_Mat() ) if the_Menu.menu_SelMat.checked == true do ( the_Menu.menu_SelMat.checked = true the_Menu.menu_SceneMat.checked = the_Menu.menu_MeditMat.checked = false BitmapList_rollout.Sel_Mat() ) AllTexture = #() -- Clear Array BitmapList_rollout.lv_objects.Items.clear() -- Clear All Items BitmapList_rollout.fillInSpreadSheet BitmapList_rollout.lv_objects BitmapList_rollout.TheMaterials -- Add Item in Row BitmapList_rollout.RowColor BitmapList_rollout.lv_objects -- Change Color Row BitmapList_rollout.lbl_TotalFile.text = ("Total File : " + (BitmapList_rollout.lv_objects.Items.count as String)) BitmapList_rollout.spn_SelStart.range = BitmapList_rollout.spn_SelEnd.range = [1,AllTexture.count,1] ) on menu_Exit picked do (if BitmapList_rollout != undefined then destroydialog BitmapList_rollout) on menu_SceneMat picked do ( the_Menu.menu_SceneMat.checked = true the_Menu.menu_MeditMat.checked = the_Menu.menu_SelMat.checked = false BitmapList_rollout.Scene_Mat() AllTexture = #() -- Clear Array BitmapList_rollout.lv_objects.Items.clear() -- Clear All Items BitmapList_rollout.fillInSpreadSheet BitmapList_rollout.lv_objects BitmapList_rollout.TheMaterials -- Add Item in Row BitmapList_rollout.RowColor BitmapList_rollout.lv_objects -- Change Color Row BitmapList_rollout.lbl_TotalFile.text = ("Total File : " + (BitmapList_rollout.lv_objects.Items.count as String)) BitmapList_rollout.spn_SelStart.range = BitmapList_rollout.spn_SelEnd.range = [1,AllTexture.count,1] ) on menu_MeditMat picked do ( the_Menu.menu_MeditMat.checked = true the_Menu.menu_SceneMat.checked = the_Menu.menu_SelMat.checked = false BitmapList_rollout.Medit_Mat() AllTexture = #() -- Clear Array BitmapList_rollout.lv_objects.Items.clear() -- Clear All Items BitmapList_rollout.fillInSpreadSheet BitmapList_rollout.lv_objects BitmapList_rollout.TheMaterials -- Add Item in Row BitmapList_rollout.RowColor BitmapList_rollout.lv_objects -- Change Color Row BitmapList_rollout.lbl_TotalFile.text = ("Total File : " + (BitmapList_rollout.lv_objects.Items.count as String)) BitmapList_rollout.spn_SelStart.range = BitmapList_rollout.spn_SelEnd.range = [1,AllTexture.count,1] ) on menu_SelMat picked do ( the_Menu.menu_SelMat.checked = true the_Menu.menu_SceneMat.checked = the_Menu.menu_MeditMat.checked = false BitmapList_rollout.Sel_Mat() AllTexture = #() -- Clear Array BitmapList_rollout.lv_objects.Items.clear() -- Clear All Items BitmapList_rollout.fillInSpreadSheet BitmapList_rollout.lv_objects BitmapList_rollout.TheMaterials -- Add Item in Row BitmapList_rollout.RowColor BitmapList_rollout.lv_objects -- Change Color Row BitmapList_rollout.lbl_TotalFile.text = ("Total File : " + (BitmapList_rollout.lv_objects.Items.count as String)) BitmapList_rollout.spn_SelStart.range = BitmapList_rollout.spn_SelEnd.range = [1,AllTexture.count,1] ) on menu_HighLightAsset picked do ( Array_File = for i in ArrayItemSel collect (AllTexture[i as integer].filename) HighlightAssets Array_File ) on menu_RevealEx picked do ( if BitmapList_rollout.lv_objects.SelectedItems.Count == 1 then ( ShellLaunch "explorer.exe" (getFilenamePath (AllTexture[BitmapList_rollout.lv_objects.SelectedItems.Item[0].text as Integer]).filename) ) else ( messagebox "Please Select 1 Item" ) ) on menu_FindMatObj picked do ( BitmapList_rollout.lv_objects.selecteditems.clear() for i in selection do ( objname = i.name BitmapList_rollout.Search_Item BitmapList_rollout.lv_objects 8 ("*" + objname + "*") ) ) on menu_View picked do ( try ( if BitmapList_rollout.lv_objects.SelectedItems.count == 1 then ( Bmap = (AllTexture[BitmapList_rollout.lv_objects.SelectedItems.Item[0].text as Integer].bitmap) display Bmap; freescenebitmaps () ) else ( messagebox "Please Select 1 Item" ) ) catch ( messagebox "Can't Open Bitmap" ) ) on menu_BitmapInfo picked do (BitmapInfo_Rollout()) on menu_OpenPS picked do (OpenPS (BitmapList_rollout.Array_ItemSel BitmapList_rollout.lv_objects)) on menu_SelAll picked do ( BitmapList_rollout.SelItem BitmapList_rollout.lv_objects 0 (BitmapList_rollout.lv_objects.Items.Count - 1) true; BitmapList_rollout.Array_ItemSel BitmapList_rollout.lv_objects BitmapList_rollout.SelColor BitmapList_rollout.lv_objects BitmapList_rollout.lbl_SelFile.text = ("Select File : " + (BitmapList_rollout.lv_objects.Items.Count as String)) ) on menu_SelNone picked do ( BitmapList_rollout.lv_objects.selecteditems.clear(); BitmapList_rollout.Array_ItemSel BitmapList_rollout.lv_objects BitmapList_rollout.SelColor BitmapList_rollout.lv_objects BitmapList_rollout.lbl_SelFile.text = ("Select File : " + (BitmapList_rollout.lv_objects.SelectedItems.count as String)) ) on menu_SelInvert picked do ( ItemAll = for i = 0 to (BitmapList_rollout.lv_objects.Items.Count - 1) collect i ItemSel = for i = 1 to BitmapList_rollout.lv_objects.SelectedItems.count collect (BitmapList_rollout.lv_objects.SelectedItems.item[i-1].index) ItemInv = (substract_Array ItemAll ItemSel) BitmapList_rollout.lv_objects.selecteditems.clear() for i in ItemInv do (BitmapList_rollout.lv_objects.items.item[i].selected = true); BitmapList_rollout.Array_ItemSel BitmapList_rollout.lv_objects BitmapList_rollout.SelColor BitmapList_rollout.lv_objects BitmapList_rollout.lbl_SelFile.text = ("Select File : " + (BitmapList_rollout.lv_objects.SelectedItems.count as String)) ) on menu_StripPathsMissing picked do ( strip_paths_missing() AllTexture = #() -- Clear Array BitmapList_rollout.lv_objects.Items.clear() -- Clear All Items BitmapList_rollout.fillInSpreadSheet BitmapList_rollout.lv_objects BitmapList_rollout.TheMaterials -- Add Item in Row BitmapList_rollout.RowColor BitmapList_rollout.lv_objects -- Change Color Row BitmapList_rollout.lbl_TotalFile.text = ("Total File : " + (BitmapList_rollout.lv_objects.Items.count as String)) messagebox "Finish" ) on menu_RelinkFoundPath picked do ( relink_found_paths() AllTexture = #() -- Clear Array BitmapList_rollout.lv_objects.Items.clear() -- Clear All Items BitmapList_rollout.fillInSpreadSheet BitmapList_rollout.lv_objects BitmapList_rollout.TheMaterials -- Add Item in Row BitmapList_rollout.RowColor BitmapList_rollout.lv_objects -- Change Color Row BitmapList_rollout.lbl_TotalFile.text = ("Total File : " + (BitmapList_rollout.lv_objects.Items.count as String)) messagebox "Finish" ) on menu_Help picked do (Help_Rollout()) on menu_About picked do ( if AboutRollout != undefined then destroydialog AboutRollout rollout AboutRollout "About" ( label lbl_Script "Bitmap List [ .NET ]" align:#center label lbl_Author "by Pichaya Popanyasak" align:#center label lbl_Mod "" align:#center hyperlink mailTrack "p_popanyasak@hotmail.com" address:"mailto:p_popanyasak@hotmail.com" color:blue hoverColor:yellow align:#center timer tmclose "" interval:6000 active:true on AboutRollout rbuttonup press do destroydialog AboutRollout on tmclose tick do destroydialog AboutRollout on AboutRollout open do lbl_Mod.text = "Modified: " + (getFileModDate (getThisScriptFilename())) ) createdialog AboutRollout width:200 modal:true style:#(#style_titlebar,#style_sysmenu,#style_border) ) ) -- End RC Menu rollout BitmapList_rollout ("Bitmap List [ .NET ] - Version : " + scriptVer + " , [ 3ds Max " + (maxVer as string) + " ]") width:ArrayRollSize[1] height:ArrayRollSize[2] ( local TheMaterials local mouseButtons = dotNetClass "System.Windows.Forms.MouseButtons" local Color_1 = (dotNetClass "System.Drawing.Color").FromArgb 200 200 200 local Color_2 = (dotNetClass "System.Drawing.Color").FromArgb 220 220 220 local Color_Sel = (dotNetClass "System.Drawing.Color").FromArgb 100 200 200 -- ////////////////////////////////////////////////////////////////////////////////////////////// Start .NET Function ////////////////////////////////////////////////////////////////////////////////////////////// fn Scene_Mat = ( TheMaterials = sceneMaterials ) -- the materials in the scene fn Medit_Mat = ( TheMaterials = meditMaterials ) -- the materials in material editor fn Sel_Mat = ( TheMaterials = for i in (selection as array) collect i.material ) -- the materials in select object fn initListView lv = ( -- Setup the forms view lv.View = (dotNetClass "System.Windows.Forms.View").Details lv.fullRowSelect = true -- Set so full width of listView is selected and not just first column. lv.gridLines = true -- Show lines between the items. lv.MultiSelect = true -- Allow for multiple selections. lv.labelEdit = false -- Allow Edit lv.BackColor = Color_1 -- Set Background Color lv.refresh() -- Add columns. layout_def = #("Index","Material","Slot Name","Map Name","Drive","Path","Name","Status","Node") -- column items div = ((ArrayRollSize[1]-15)-(1335-15))/9 as float layout_width = #(50+div,150+div,100+div,150+div,50+div,300+div,300+div,50+div,150+div) -- column items width for i = 1 to layout_def.count do lv.Columns.add layout_def[i] layout_width[i] -- add column with name and optional width ) -- End Fn fn fillInSpreadSheet lv mat = ( for m in mat do (findMaterials m) -- Get All Bitmaptexture rows = #() for i = 1 to AllTexture.count do ( try( the_index = indexStr AllTexture.count i the_slotname = AllTextureSlot[i] the_texname = AllTexture[i].name the_texfile = AllTexture[i].filename StrArray = filterString (the_texfile) "\\" -- Filter File Path if (findString StrArray[1] ":") != undefined then (the_texfiledrive = StrArray[1]) else (the_texfiledrive = "\\\\" + StrArray[1]) the_texfilePath = (StrPathOnly the_texfile 1) the_texfilename = StrArray[StrArray.count] the_mat = for m in refs.dependents AllTexture[i] where (superclassof m == Material) and (m.name != "") collect m.name the_status = (ATSOps.GetFileSystemStatus AllTexture[i].filename)[1] the_node = for n in refs.dependentNodes AllTexture[i] collect (n.name) the_node_Name = ""; for i = 1 to the_node.count do (if i != the_node.count then (the_node_Name += the_node[i] + ", ") else (the_node_Name += the_node[i])) li = dotNetObject "System.Windows.Forms.ListViewItem" (the_index as string) -- ID sub_li = li.SubItems.add (the_mat[1] as string) -- Material sub_li = li.SubItems.add (the_slotname as string) -- Slot Name sub_li = li.SubItems.add (the_texname as string) -- Map Name sub_li = li.SubItems.add (toUpper (the_texfiledrive as string)) -- Drive sub_li = li.SubItems.add (toLower (the_texfilePath as string)) -- Path sub_li = li.SubItems.add (toLower (the_texfilename as string)) -- Name sub_li = li.SubItems.add (the_status as string) -- Status sub_li = li.SubItems.add (the_node_Name as string) -- Node append rows li ) catch ( print ((i as string) + " - " + (AllTexture[i] as string) + " - undefined") ) ) -- End Loop lv.Items.AddRange rows -- when done, we populate the ListView ) -- End Fn fn SelColor lv = ( ItemAll = for i = 0 to (lv.Items.Count - 1) collect i ItemSel = for i = 1 to lv.SelectedItems.count collect (lv.SelectedItems.item[i-1].index) ItemInv = (substract_Array ItemAll ItemSel) for i in ItemSel do (lv.items.item[i].BackColor = Color_Sel) for i in ItemInv do ( if (filterstring (((lv.items.item[i].index)/2 as float) as string) ".")[2] != "0" then (lv.items.item[i].BackColor = Color_1) else (lv.items.item[i].BackColor = Color_2) -- End If ) ) fn RowColor lv = ( for i = 1 to lv.items.count do ( if (filterstring (((i-1)/2 as float) as string) ".")[2] != "0" then (lv.items.item[i-1].BackColor = Color_1) else (lv.items.item[i-1].BackColor = Color_2) -- End If ) -- End Loop ) -- End Fn fn SelItem lv start end status = ( for i = start to end do lv.items.item[i].selected = status ) -- End Fn fn Array_ItemSel lv = ( ArrayItemSel = #() -- Clear Array for i = 1 to lv.SelectedItems.count do (append ArrayItemSel (lv.SelectedItems.item[i-1].text)) -- End Loop return ArrayItemSel ) -- End Fn fn SelectSameVal lv SubItemHit SubItemIndex SubItemCurrent = ( lv.selecteditems.clear() if SubItemHit == SubItemIndex do ( SubItem_Same = SubItemCurrent.text for i = 1 to lv.Items.count do ( the_Item = lv.Items.Item[i-1] if (the_Item.subItems.item[SubItemIndex].text) == SubItem_Same do (lv.items.item[the_Item.index].selected = true) ) Array_ItemSel lv; SelColor lv ) ) -- End Fn fn Search_Item lv SubItemIndex SearchText = ( if BSearchText != "" do ( for i = 1 to lv.Items.count do ( the_Item = lv.Items.Item[i-1] ItemText = the_Item.subItems.item[SubItemIndex].text -- Item String if (matchPattern ItemText pattern:SearchText) == true do (lv.Items.Item[the_Item.index].selected = true) -- Check Match Pattern String ) Array_ItemSel lv; SelColor lv BitmapList_rollout.lbl_SelFile.text = "Select File : " + (lv.SelectedItems.count as String) ) ) -- End FN -- ////////////////////////////////////////////////////////////////////////////////////////////// End .NET Function ////////////////////////////////////////////////////////////////////////////////////////////// label lbl_Select "Select :" pos:[8,12] width:40 height:16 spinner spn_SelStart "" pos:[48,12] width:64 height:16 range:[1,1e+006,1] type:#integer scale:1 label lbl_To "To" pos:[120,12] width:16 height:16 spinner spn_SelEnd "" pos:[144,12] width:64 height:16 range:[1,1e+006,1] type:#integer scale:1 button btn_Select "Select" pos:[216,8] width:64 height:24 label lbl_MapName "Map Name :" pos:[288,12] width:64 height:16 edittext edt_MapName "" pos:[352,8] width:112 height:24 button btn_ChangeMapName "Change" pos:[472,8] width:48 height:24 checkbox chk_Drive "" pos:[528,12] width:16 height:16 label lbl_Drive "Drive :" pos:[552,12] width:40 height:16 edittext edt_Drive "" pos:[592,8] width:59 height:24 enabled:false checkbox chk_Path "" pos:[656,12] width:16 height:16 label lbl_Path "Path :" pos:[680,12] width:40 height:16 edittext edt_Path "" pos:[712,8] width:272 height:24 enabled:false button btn_Browse "..." pos:[992,8] width:24 height:24 enabled:false checkbox chk_Name "" pos:[1024,12] width:16 height:16 label lbl_Name "Name :" pos:[1048,12] width:40 height:16 edittext edt_name "" pos:[1088,8] width:184 height:24 enabled:false button btn_ChangeFile "Change" pos:[1280,8] width:64 height:24 label lbl_TotalFile "Total : " pos:[8,40] width:128 height:16 label lbl_SelFile "Select : " pos:[144,40] width:128 height:16 label lbl_Search "Search :" pos:[288,43] width:64 height:16 dropDownList ddl_Search "" pos:[356,40] width:109 height:21 items:#("Material","Slot Name","Map Name","Drive","Path","Name","Status","Node") edittext edt_Search "" pos:[468,40] width:183 height:24 button btn_Search "Search" pos:[656,40] width:56 height:24 progressBar pb_Progress "" pos:[719,43] width:625 height:16 dotNetControl lv_objects "System.Windows.Forms.ListView" pos:[8,72] align:#center width:(ArrayRollSize[1]-15) height:(ArrayRollSize[2]-80) -- Create the dotNet listview control on lv_objects columnClick arg do ( lv_objects.ListViewItemSorter = dotnetobject "MXS_dotNet.ListViewItemComparer" arg.column -- Sort Order Ascending lv_objects.ListViewItemSorter = undefined RowColor lv_objects -- Change Color Row ) on lv_objects MouseDoubleClick arg do ( local Item = lv_objects.GetItemAt arg.x arg.y -- Get Item local SubItem = Item.GetSubItemAt arg.x arg.y -- Get Sub Item ArrayIndex = #(Item.index, (Item.subItems.indexof SubItem)) if arg.button == mouseButtons.left do ( if (dotNetClass "system.windows.forms.control").modifierKeys == (dotNetClass "system.windows.forms.control").modifierKeys.Control then ( if ArrayIndex[2] == 1 do -- Assign Material to Object Selection ( the_mat = for m in refs.dependents AllTexture[Item.text as Integer] where (superclassof m == Material) and (m.name != "") collect m for i in selection do i.material = the_mat[1] ) if the_Menu.menu_SceneMat.checked == true do ( the_Menu.menu_SceneMat.checked = true the_Menu.menu_MeditMat.checked = the_Menu.menu_SelMat.checked = false BitmapList_rollout.Scene_Mat() ) if the_Menu.menu_MeditMat.checked == true do ( the_Menu.menu_MeditMat.checked = true the_Menu.menu_SceneMat.checked = the_Menu.menu_SelMat.checked = false BitmapList_rollout.Medit_Mat() ) if the_Menu.menu_SelMat.checked == true do ( the_Menu.menu_SelMat.checked = true the_Menu.menu_SceneMat.checked = the_Menu.menu_MeditMat.checked = false BitmapList_rollout.Sel_Mat() ) AllTexture = #() -- Clear Array lv_objects.Items.clear() -- Clear All Items fillInSpreadSheet lv_objects TheMaterials -- Add Item in Row RowColor lv_objects -- Change Color Row lbl_TotalFile.text = "Total File : " + (lv_objects.Items.count as String) BitmapList_rollout.spn_SelStart.range = BitmapList_rollout.spn_SelEnd.range = [1,AllTexture.count,1] ) else ( if ArrayIndex[2] == 1 do -- Add Material to Material Editor ActiveMtlSlot ( the_mat = for m in refs.dependents AllTexture[Item.text as Integer] where (superclassof m == Material) and (m.name != "") collect m MatEditor.Open(); meditMaterials[medit.GetActiveMtlSlot()] = the_mat[1] ) ) if ArrayIndex[2] == 3 do (edt_MapName.text = SubItem.text) -- Add Map Name to Edit Text if ArrayIndex[2] == 4 do -- Add Drive to Edit Text ( chk_Drive.checked = edt_Drive.enabled = true try(edt_Drive.text = SubItem.text) catch() ) if ArrayIndex[2] == 5 do (chk_Path.checked = edt_Path.enabled = btn_Browse.enabled = true; edt_Path.text = SubItem.text) -- Add Path to Edit Text if ArrayIndex[2] == 6 do (chk_Name.checked = edt_name.enabled = true; edt_name.text = SubItem.text) -- Add Name to Edit Text if ArrayIndex[2] == 8 do (select (for n in refs.dependentNodes AllTexture[Item.text as Integer] collect n);unhide selection; actionMan.executeAction 0 "311") -- Select Node ) if arg.button == mouseButtons.right do ( SelectSameVal lv_objects ArrayIndex[2] 1 SubItem -- Select Items Same Material SelectSameVal lv_objects ArrayIndex[2] 2 SubItem -- Select Items Same Material SelectSameVal lv_objects ArrayIndex[2] 3 SubItem -- Select Items Same Map Name SelectSameVal lv_objects ArrayIndex[2] 4 SubItem -- Select Items Same Drive SelectSameVal lv_objects ArrayIndex[2] 5 SubItem -- Select Items Same Path SelectSameVal lv_objects ArrayIndex[2] 6 SubItem -- Select Items Same Name SelectSameVal lv_objects ArrayIndex[2] 7 SubItem -- Select Items Same Status SelectSameVal lv_objects ArrayIndex[2] 8 SubItem -- Select Items Same Object ) -- End If ) on lv_objects MouseClick arg do ( local Item = lv_objects.GetItemAt arg.x arg.y -- Get Item local SubItem = Item.GetSubItemAt arg.x arg.y -- Get Sub Item if arg.button == mouseButtons.left do ( Array_ItemSel lv_objects SelColor lv_objects lbl_SelFile.text = "Select File : " + (lv_objects.SelectedItems.count as String) ) -- End If if arg.button == mouseButtons.right do ( Array_ItemSel lv_objects SelColor lv_objects lbl_SelFile.text = "Select File : " + (lv_objects.SelectedItems.count as String) ) -- End If ) on lv_objects keyUp arg do ( if arg.keyValue == 116 do -- F5 [ Reflesh ] ( if the_Menu.menu_SceneMat.checked == true do ( the_Menu.menu_SceneMat.checked = true the_Menu.menu_MeditMat.checked = the_Menu.menu_SelMat.checked = false BitmapList_rollout.Scene_Mat() ) if the_Menu.menu_MeditMat.checked == true do ( the_Menu.menu_MeditMat.checked = true the_Menu.menu_SceneMat.checked = the_Menu.menu_SelMat.checked = false BitmapList_rollout.Medit_Mat() ) if the_Menu.menu_SelMat.checked == true do ( the_Menu.menu_SelMat.checked = true the_Menu.menu_SceneMat.checked = the_Menu.menu_MeditMat.checked = false BitmapList_rollout.Sel_Mat() ) AllTexture = #() -- Clear Array lv_objects.Items.clear() -- Clear All Items fillInSpreadSheet lv_objects TheMaterials -- Add Item in Row RowColor lv_objects -- Change Color Row lbl_TotalFile.text = "Total File : " + (lv_objects.Items.count as String) BitmapList_rollout.spn_SelStart.range = BitmapList_rollout.spn_SelEnd.range = [1,AllTexture.count,1] ) if arg.keyValue == 27 do -- Esc [ Exit Window ] ( if BitmapList_rollout != undefined then destroydialog BitmapList_rollout ) if arg.keyValue == 112 do (Help_Rollout()) -- F1 [ Help ] ) on lv_objects keyPress arg do ( local theKey = getproperty arg #keychar asDotNetObject: true local cn = dotNetClass "System.Convert" local KeyCharNum = cn.ToInt32 theKey --print KeyCharNum if KeyCharNum == 5 do -- Ctrl+e [ Reveal Location in Explorer ] ( if BitmapList_rollout.lv_objects.SelectedItems.Count == 1 then ( ShellLaunch "explorer.exe" (getFilenamePath (AllTexture[BitmapList_rollout.lv_objects.SelectedItems.Item[0].text as Integer]).filename) ) else ( messagebox "Please Select 1 Item" ) ) if KeyCharNum == 8 do -- Ctrl+h [ Highlight Assets in ATS Dialog ] ( Array_File = for i in ArrayItemSel collect (AllTexture[i as integer].filename) HighlightAssets Array_File ) if KeyCharNum == 1 do -- Ctrl+a [ Select All ] ( SelItem lv_objects 0 (lv_objects.Items.Count - 1) true; Array_ItemSel lv_objects SelColor lv_objects lbl_SelFile.text = "Select File : " + (lv_objects.Items.Count as String) ) if KeyCharNum == 4 do -- Ctrl+d [ Select None ] ( lv_objects.selecteditems.clear(); Array_ItemSel lv_objects SelColor lv_objects lbl_SelFile.text = "Select File : " + (lv_objects.SelectedItems.count as String) ) if KeyCharNum == 9 do -- Ctrl+i [ Select Invert ] ( ItemAll = for i = 0 to (lv_objects.Items.Count - 1) collect i ItemSel = for i = 1 to lv_objects.SelectedItems.count collect (lv_objects.SelectedItems.item[i-1].index) ItemInv = (substract_Array ItemAll ItemSel) lv_objects.selecteditems.clear() for i in ItemInv do (lv_objects.items.item[i].selected = true); Array_ItemSel lv_objects SelColor lv_objects lbl_SelFile.text = "Select File : " + (lv_objects.SelectedItems.count as String) ) if KeyCharNum == 13 do -- Ctrl+m [ Find Material in List with Object Selection ] ( BitmapList_rollout.lv_objects.selecteditems.clear() for i in selection do ( objname = i.name Search_Item BitmapList_rollout.lv_objects 8 ("*" + objname + "*") ) ) if KeyCharNum == 15 do -- Ctrl+o [ Open in Photoshop ] ( OpenPS (BitmapList_rollout.Array_ItemSel BitmapList_rollout.lv_objects) ) if KeyCharNum == 22 do -- Ctrl+v [ Bitmap View ] ( try ( if BitmapList_rollout.lv_objects.SelectedItems.count == 1 then ( Bmap = (AllTexture[BitmapList_rollout.lv_objects.SelectedItems.Item[0].text as Integer].bitmap) display Bmap; freescenebitmaps () ) else ( messagebox "Please Select 1 Item" ) ) catch ( messagebox "Can't Open Bitmap" ) ) if KeyCharNum == 32 do (BitmapInfo_Rollout()) -- Space Bar [ Bitmap Info ] if KeyCharNum == 97 do (chk_Drive.checked = edt_Drive.enabled = true; try(edt_Drive.text = "A:") catch()) -- A if KeyCharNum == 98 do (chk_Drive.checked = edt_Drive.enabled = true; try(edt_Drive.text = "B:") catch()) -- B if KeyCharNum == 99 do (chk_Drive.checked = edt_Drive.enabled = true; try(edt_Drive.text = "C:") catch()) -- C if KeyCharNum == 100 do (chk_Drive.checked = edt_Drive.enabled = true; try(edt_Drive.text = "D:") catch()) -- D if KeyCharNum == 101 do (chk_Drive.checked = edt_Drive.enabled = true; try(edt_Drive.text = "E:") catch()) -- E if KeyCharNum == 102 do (chk_Drive.checked = edt_Drive.enabled = true; try(edt_Drive.text = "F:") catch()) -- F if KeyCharNum == 103 do (chk_Drive.checked = edt_Drive.enabled = true; try(edt_Drive.text = "G:") catch()) -- G if KeyCharNum == 104 do (chk_Drive.checked = edt_Drive.enabled = true; try(edt_Drive.text = "H:") catch()) -- H if KeyCharNum == 105 do (chk_Drive.checked = edt_Drive.enabled = true; try(edt_Drive.text = "I:") catch()) -- I if KeyCharNum == 106 do (chk_Drive.checked = edt_Drive.enabled = true; try(edt_Drive.text = "J:") catch()) -- J if KeyCharNum == 107 do (chk_Drive.checked = edt_Drive.enabled = true; try(edt_Drive.text = "K:") catch()) -- K if KeyCharNum == 108 do (chk_Drive.checked = edt_Drive.enabled = true; try(edt_Drive.text = "L:") catch()) -- L if KeyCharNum == 109 do (chk_Drive.checked = edt_Drive.enabled = true; try(edt_Drive.text = "M:") catch()) -- M if KeyCharNum == 110 do (chk_Drive.checked = edt_Drive.enabled = true; try(edt_Drive.text = "N:") catch()) -- N if KeyCharNum == 111 do (chk_Drive.checked = edt_Drive.enabled = true; try(edt_Drive.text = "O:") catch()) -- O if KeyCharNum == 112 do (chk_Drive.checked = edt_Drive.enabled = true; try(edt_Drive.text = "P:") catch()) -- P if KeyCharNum == 113 do (chk_Drive.checked = edt_Drive.enabled = true; try(edt_Drive.text = "Q:") catch()) -- Q if KeyCharNum == 114 do (chk_Drive.checked = edt_Drive.enabled = true; try(edt_Drive.text = "R:") catch()) -- R if KeyCharNum == 115 do (chk_Drive.checked = edt_Drive.enabled = true; try(edt_Drive.text = "S:") catch()) -- S if KeyCharNum == 116 do (chk_Drive.checked = edt_Drive.enabled = true; try(edt_Drive.text = "T:") catch()) -- T if KeyCharNum == 117 do (chk_Drive.checked = edt_Drive.enabled = true; try(edt_Drive.text = "U:") catch()) -- U if KeyCharNum == 118 do (chk_Drive.checked = edt_Drive.enabled = true; try(edt_Drive.text = "V:") catch()) -- V if KeyCharNum == 119 do (chk_Drive.checked = edt_Drive.enabled = true; try(edt_Drive.text = "W:") catch()) -- W if KeyCharNum == 120 do (chk_Drive.checked = edt_Drive.enabled = true; try(edt_Drive.text = "X:") catch()) -- X if KeyCharNum == 121 do (chk_Drive.checked = edt_Drive.enabled = true; try(edt_Drive.text = "Y:") catch()) -- Y if KeyCharNum == 122 do (chk_Drive.checked = edt_Drive.enabled = true; try(edt_Drive.text = "Z:") catch()) -- Z ) on chk_Drive changed theState do (if theState == true then (edt_Drive.enabled = true) else (edt_Drive.enabled = false)) on chk_Path changed theState do (if theState == true then (edt_Path.enabled = btn_Browse.enabled = true) else (edt_Path.enabled = btn_Browse.enabled = false)) on chk_Name changed theState do (if theState == true then (edt_name.enabled = true) else (edt_name.enabled = false)) on BitmapList_rollout open do ( Scene_Mat(); the_Menu.menu_SceneMat.checked = true initListView lv_objects -- Set Properties .NET fillInSpreadSheet lv_objects TheMaterials -- Add Item in Row RowColor lv_objects -- Change Color Row lbl_TotalFile.text = "Total File : " + (lv_objects.Items.count as String) spn_SelStart.range = spn_SelEnd.range = [1,AllTexture.count,1] ) on BitmapList_rollout close do ( if HelpRollout != undefined then destroydialog HelpRollout if AboutRollout != undefined then destroydialog AboutRollout freeSceneBitmaps(); gc() ) on btn_Select pressed do ( lv_objects.selecteditems.clear() if spn_SelStart.value < spn_SelEnd.value then (SelItem lv_objects (spn_SelStart.value-1) (spn_SelEnd.value-1) true; Array_ItemSel lv_objects) else (SelItem lv_objects (spn_SelEnd.value-1) (spn_SelStart.value-1) true; Array_ItemSel lv_objects) SelColor lv_objects lbl_SelFile.text = "Select File : " + (lv_objects.SelectedItems.count as String) ) on btn_ChangeMapName pressed do ( if ArrayItemSel.count != 0 then ( for i in ArrayItemSel do (AllTexture[i as integer].name = edt_MapName.text) -- End Loop AllTexture = #() -- Clear Array lv_objects.Items.clear() -- Clear All Items fillInSpreadSheet lv_objects TheMaterials -- Add Item in Row RowColor lv_objects -- Change Color Row messagebox "Finish" -- Finish ) else (messagebox "Please Select Item.") -- End If ) on btn_Browse pressed do ( try ( NewPath = getSavePath caption:"Browse New Folder" edt_Path.text = (StrPathOnly NewPath 0) ) catch () ) on btn_Search pressed do ( BitmapList_rollout.lv_objects.selecteditems.clear() Search_Item BitmapList_rollout.lv_objects BitmapList_rollout.ddl_Search.selection BitmapList_rollout.edt_Search.text ) on btn_ChangeFile pressed do ( if ArrayItemSel.count != 0 then ( count = 0 for i in ArrayItemSel do ( ArrayFileSplit = (filterstring AllTexture[i as integer].filename "\\") --if (findString ArrayFileSplit[1] ":") != undefined then (the_texfiledrive = ArrayFileSplit[1]) else (the_texfiledrive = "\\\\" + ArrayFileSplit[1]) if (edt_Drive.enabled == true) and (edt_Path.enabled == true) and (edt_name.enabled == true) then ( if (edt_Path.text == "") or (edt_name.text == "") then (messagebox "No Path or Name.") else ( StrDrive = edt_Drive.text; StrPath = edt_Path.text; StrName = edt_name.text StrFile = (StrDrive + "\\" + StrPath + "\\" + StrName) -- New Path AllTexture[i as integer].filename = StrFile -- Relink Bitmap ) -- End If ) else if (edt_Drive.enabled == true) and (edt_Path.enabled == true) then ( if (edt_Path.text == "") then (messagebox "No Path or Name.") else ( StrDrive = edt_Drive.text; StrPath = edt_Path.text StrFile = (StrDrive + "\\" + StrPath + "\\" + ArrayFileSplit[ArrayFileSplit.count]) -- New Path AllTexture[i as integer].filename = StrFile -- Relink Bitmap ) -- End If ) else if (edt_Path.enabled == true) and (edt_name.enabled == true) then ( if (edt_Path.text == "") or (edt_name.text == "") then (messagebox "No Path or Name.") else ( StrPath = edt_Path.text; StrName = edt_name.text StrFile = (ArrayFileSplit[1] + "\\" + StrPath + "\\" + StrName) -- New Path AllTexture[i as integer].filename = StrFile -- Relink Bitmap ) -- End If ) else if (edt_Drive.enabled == true) and (edt_name.enabled == true) then ( if (edt_name.text == "") then (messagebox "No Path or Name.") else ( StrDrive = edt_Drive.text; StrName = edt_name.text StrFile = (StrDrive + "\\" + (StrPathOnly (AllTexture[i as integer].filename) 1) + "\\" + StrName) -- New Path AllTexture[i as integer].filename = StrFile -- Relink Bitmap ) -- End If ) else if edt_Drive.enabled == true then ( StrDrive = edt_Drive.text StrFile = (StrDrive + "\\" + (StrPathOnly (AllTexture[i as integer].filename) 1) + "\\" + ArrayFileSplit[ArrayFileSplit.count]) -- New Path AllTexture[i as integer].filename = StrFile -- Relink Bitmap ) else if edt_Path.enabled == true then ( if (edt_Path.text == "") then (messagebox "No Path or Name.") else ( StrPath = edt_Path.text StrFile = (ArrayFileSplit[1] + "\\" + StrPath + "\\" + ArrayFileSplit[ArrayFileSplit.count]) -- New Path AllTexture[i as integer].filename = StrFile -- Relink Bitmap ) -- End If ) else if edt_name.enabled == true then ( if (edt_name.text == "") then (messagebox "No Path or Name.") else ( StrName = edt_name.text StrFile = (ArrayFileSplit[1] + "\\" + (StrPathOnly (AllTexture[i as integer].filename) 1) + "\\" + StrName) -- New Path AllTexture[i as integer].filename = StrFile -- Relink Bitmap ) -- End If ) count += 1 pb_Progress.value = ((100.0*count)/(ArrayItemSel.count)) ) -- End Loop freescenebitmaps (); max views redraw -- Reflesh Bitmap AllTexture = #() -- Clear Array lv_objects.Items.clear() -- Clear All Items fillInSpreadSheet lv_objects TheMaterials -- Add Item in Row RowColor lv_objects -- Change Color Row lbl_TotalFile.text = "Total File : " + (lv_objects.Items.count as String) BitmapList_rollout.spn_SelStart.range = BitmapList_rollout.spn_SelEnd.range = [1,AllTexture.count,1] pb_Progress.value = 0 ) else ( messagebox "Please Select Item." ) -- End If ) ) createDialog BitmapList_rollout menu:the_Menu style:#(#style_titlebar,#style_border,#style_sunkenedge,#style_sysmenu,#style_minimizebox)--,#style_resizing)