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)…
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…
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"…
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…
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 =…
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…
Hi there, poopipe. Thank you for taking the time to help me out. I agree, I'm definitely misunderstanding the structure. This explains a lot of things actually. I don't want to have to select the bitmap, although I may have to in this regard. I've been working on a batch exporter for textured models, and wanted to be able…
Hi, Noors. Thank you so much for your examples! Honestly, I don't know why Maxscript has been acting this way recently. Perhaps my loops are off by a single number. I will try these out and see what I can do. I really appreciate this.