PDA

View Full Version : Array Limitations


handiklap
04-11-2006, 04:00 PM
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 1575x1250. 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.

f97ao
04-11-2006, 04:04 PM
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 1575x1250. 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?

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

handiklap
04-11-2006, 04:20 PM
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 1575x1250:

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).

handiklap
04-11-2006, 04:43 PM
Wow that was dumb. Sorry guys, I had my x and y coords reversed. Should have realized that 625+950 = 1575...mystery solved.

CGTalk Moderation
04-11-2006, 04:43 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.