[Closed] Array Limitations
From some tests, I’ve found the max limit for an array I’m trying to create is 950 members. What I’m trying to do is develop a simple compositing script that will render out a few frames of the same camera, changing materials, ambient only, etc. to automate the process of GI simulation through ambient occlusion, and basically eliminate the steps involved with compositing layers in an image editor. The problem arises when I try to use getPixels to take a row from a rendered frame buffer, which is 1575×1250. I can only do so if I try to grab 950 or less pixels, any more and the method returns an empty array. Would it be best to simply perform the operations with multiple arrays per scan line, or is there a more efficient way around this?
EDIT: Nevermind, had my x and y mixed up. Notice how 950 + 625 = 1575? Yeah well I didn’t.
Have you tried writing
undo off
(
)
around the code where you operate arrays?
MaxScript hates big loops with arrays or objects, and can easily eat 1gb of ram.
/Andreas
Tried with no results; I don’t think it’s a memory issue – according to task manager, max never gets above 600mb during execution. Here’s the (working) test code I’m using with a render size of 1575×1250:
bMap = render()
pixelArray = getPixels bMap [625,0] 950
print (pixelArray.count as string)
If the length argument of getPixels() is greater than that 950, it returns 0 (empty array).
Wow that was dumb. Sorry guys, I had my x and y coords reversed. Should have realized that 625+950 = 1575…mystery solved.