Bitmap collector

Hi,
Does anyone know wether bitmap collector by neil belvin works with 2013 or is there another script, or a way within max to copy all bitmaps and place them within one folder ?
Cheers

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
barigazy's picture

try this code

How to use:
1.run the copySceneBmp function
2.next you can run simply

copySceneBmp()

then pick folder where you want to store bitmaps or you can run

copySceneBmp toDir:@"C:\Temp"

(specyfy your path if you not use @"C:\Temp") and thats it.

fn copySceneBmp toDir: =
(
	local usedSceneBitmaps = (getClassInstances bitmaptex)
	local bmpPats = #()
	local SIOFile = dotNetClass "System.IO.File"
	local SIOPath = dotNetClass "System.IO.Path"
	if usedSceneBitmaps.count != 0 do 
	(	
		for b in usedSceneBitmaps do 
		(
			if bmpPats.count == 0 then append bmpPats b.filename else
			(
				--next line this method performs a lower case comparison of strings
				--is more precise then *appendIfUnique*
				if (for i = 1 to bmpPats.count where stricmp bmpPats[i] b.filename == 0 collect i).count == 0 do
				append bmpPats b.filename
			)
		)
		if bmpPats.count != 0 do
		(
			targetDir = if toDir != unsupplied then toDir else (getsavepath caption:"Select the folder for bitmaps")
			if targetDir != undefined do 
			(
				for sFile in bmpPats do 
				( 
					tFile = targetDir +"\\"+(SIOPath.GetFileName sFile)
					SIOFile.Copy sFile tFile 
				)
				free bmpPats ; free usedSceneBitmaps
			)
		)
	)
)

bga

zahid hasan's picture

nice and simple. would you

nice and simple.
would you explain the dotnet part. how it is helping to copy the file.often files are not in the exact path but in some other asset path. how the script is handling this.sorry for bothering with basic questions.thanks

barigazy's picture

i use dotnet in this case in

i use dotnet in this case in combinations with mxs for comparation, but you can use
mxs only.dotnet have more powerful comparation methods (see code here http://www.scriptspot.com/3ds-max/scripts/scriptrun).About asset path, this code will skip all missing paths.

bga

kimarotta's picture

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.