PDA

View Full Version : overflowing stack?


sheb
02-01-2005, 02:33 PM
Hello people!

Ohhh my head hurts. Is there a limit to the amount of recursion thats possible in maxscript? I wrote something thatis floodselection the whole mesh. The function is starting with one face, marks it as "set" and then calls itself on all (edge)neighbouring faces (and checking an array of already checked faces).

It all works fine on a small mesh but with heavier ones max just quits (no errror, just goes back to windows). I suspect max is running out of memory or something? I tried to increase the memory in the preferences but that didnt help :/

Any suggestions? I guess i could rewrite it somehow without recursion..


thanks all,

seb
ps: not directly related to this: When i pass a array to a function does it use a pointer on that array (i thought so).

magicm
02-01-2005, 03:23 PM
- make sure your function doesn't go into an infinite loop
- you can check how much scripter memory there's left with the heapfree command.

As for your other question, check out the scripts i've attached.. The only difference between the two is that the second function takes a by-reference argument.

- Martijn

Reality3D
02-01-2005, 04:18 PM
Maybe also increasing the initial heap size(customize/preferences/maxscript)

sheb
02-01-2005, 07:47 PM
Thanks!

Im pretty sure its working and its not a infenite loop :(. The thing is its pretty much starting a function on every face of the mesh. at around 900 its crashing, so maybe thats just a limit im hitting :/

ill try solving it without the recursion but its a shame cos recursion is COOL ;)

CGTalk Moderation
02-01-2006, 08:00 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.