Hi, there. I have been looking at the Autodesk 3ds Maxscript documentation lately. I believe that this piece of code I have should work, but for some reason it does not. So, "theBitmap" code appears to work - I don't receive errors. But, "thePixels" code appears to throw errors. I don't know why it would when "theBitmap"…
You may just use selection[1].material.diffusemap<br><br>--or for batching, stuff like :<br><br>sel = selection as array<br>for obj in sel do<br>( <code> theBitmap = obj.material.diffusemap -- ) </code><code>theBitmap = as your bitmap file is already loaded. Maxscript help says to avoid getpixels for every pixel and use it…
Alright, my loops were off by one number and I was't accessing the colors as arrays. I've definitely learned. Thank you so much guys, it works perfectly now. If there is one thing I could change though, it would be to print the hex in capitalized letters - right now they're lower cased. Here is my final code: fStream =…
Use the toUpper built-in function
toUpper (bit.intAsHex(aPixelColor[1]))) to:fStream <br>--small tips to make code clearer (or shorter to navigate into), if you just have one line of code in a loop, you can write on one line:
if (aPixelColor[1] < 16) then format "0%" (toUpper(bit.intAsHex(aPixelColor[1]))) to:fStream
else…