[Closed] overflowing stack?
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).
- 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
Maybe also increasing the initial heap size(customize/preferences/maxscript)
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