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…
Hey again, Noors. Those functions will definitely come in handy. I just thought of it now, but I should also check if the "count" is greater than or equal to the width of the image, then go to the next line. As it is, the code is best for 32x32 sizes. You're awesome! Thanks again for your work; it really means a lot to…
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"…
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…
You're welcome. Yeah i wasn't sure what you were doing with the counter.But i guess you don't need it if you put your last format outside the j loop.Then there will be a line break at the end of each row, no matter the width of the bitmap. <code> format "\n" to:fStream<br>)</code><code>for i = 0 to (aHeight-1)…
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 =…