Hey guys, I am working on a script which queries for bitmaps in all DX Shaders in a multi-sub material.Here is what i have done so far.Where i am halting is, when i am querying the bitmap filename and trying to put in an array. I am not able to figure what's the problem.It keeps on throwing an error of array being not…
Hi, here is the rewritten for loop. It should work as expected:for aa= 1 to currentMat.numberofbitmaps() do( bmpFile = currentMat.geteffectbitmap aa -- as string if (bmpFile != undefined) do ( -- bmpFilePath = bmpFile.filename arrBitmapFileToken = filterString (bmpFile as String) " ." --<-- the html doesn't like the…
When I run this code on an object with 2 DX shaders applied to it, I get "zz" returning as 0, hence the warning. Presumably because findItem arrBitmapFileToken "tga" is failing in my case. You should probably have a check in that code block so that it only evaluates the chunk returning the warning... for example, if zz > 1…
SyncViewS: Thanx for the fast reply dude...ya, actually i was aware of the reason of the error.but in my case, there is a confirmed non zero value for the findItem array.I ran each line of code.but it still shows the error.if i put a print after "zz" assignment...it prints value 11 in my case...but still shows that error :(
Hi Animax, I haven't tested the script but here is a hint at first glance. It could be wrong, but worth testing: I guess problem is findItem. If it doesn't find the item in the array it returns a 0. But you use the result of that findItem as array index minus 1 [yy-1] and [zz-1]. So if findItem fails, the result is 0, and…
MoP:Thank you for the suggestions:) I indeed added the if condition which removed the error out of the way, but the code block was to gather all the bitmaps used by a particular shader and now it doesnt. The "aa" loop is for checking how many bitmaps used in the shader, then goes through each bitmap to get it's name.As the…