undefined bitmap value for missing bitmap in scene
I'm working on a script that write a text file where collect all the bitmap path for each material in scene.
What I've done for now seems to works well, but only if all the maps are in some known folder.
If a material has a missing bitmapon it, it returns an error, due to a "undefined" value.
Here is my code.
txt = createfile "C:\bitmaplist.txt" MatID = 0 for mat in sceneMaterials do ( format "MATERIAL: = Mat-% = % = %\n" MatID mat.name (classof mat) to:txt for prop in (getPropNames mat) do ( propVal = ((getProperty mat prop) as string) if (matchPattern propVal pattern:"*Bitmap") == true do ( bitmapPath = (getProperty mat prop).bitmap bitmapFileName = trimleft (bitmapPath as string) "BitMap:" scenePath = substituteString (bitmapNewPath as string) "\\" "//" format " Mat-% = % = Bitmap:%%\n" MatID (prop as string) scenePath bitmapFileName to:txt ) ) format "\n\n" to:txt MatID = MatID + 1 )
There are 5 days that I try to find a solution, without results.
Someone can help me, please?