Pjanssen
03-13-2007, 10:53 PM
Hi guys,
I've been working on a script that creates sprites from a certain cameraview. The script rotates the camera so that it describes a spherical path around the object.
http://img369.imageshack.us/img369/2360/ui1al0.th.jpg (http://img369.imageshack.us/my.php?image=ui1al0.jpg)
It renders anywhere between 20 and 800 frames. Each time a frame is completed, a couple of things change, and the camera is rotated before it starts rendering the next frame.
When all is done, the images are passed on to a script I wrote that stitches everything together.
http://img369.imageshack.us/img369/6233/ui2my4.th.jpg (http://img369.imageshack.us/my.php?image=ui2my4.jpg)
I've got everything working nicely, except for one thing: controlling the rendering process.
When you've got say 400 frames to render, with GI, DoF and what not, you definitely want to be able to cancel the rendering process. And what's more, I want to be able to do it decently. Pushing the escape key for a couple of seconds basically does the trick, but it throws up some script errors (because of 'missing' data later on in the script, due to the aborted loops) and eventually max crashes.
I have written a resume function, so theoratically aborting a render this way doesn't do much harm, but it's not a very charming way. :p
I have quite literally been searching for days on how to accomplish this, but I can't seem to find anything useful.
One thing I tried is making a button (as you can see in the rendering screen), that will change a variable which is being evaluated with each loop iteration. That should -in theory- be enough to at least break off the loops (the current frame render will still continue though). But the irony is, that when rendering, max seems to be too busy to respond to the button...
I hope that some of you guys can help me with this issue. Any thoughts, ideas and opinions on it are very much appreciated.
Thanks in advance!
Oh by the way, I think that it'd be good to mention: my experience with maxscript is rather limited, I've only started using it a week ago. But I do have quite some experience with other scripting and programming languages, like php, actionscript, java etc.
I've been working on a script that creates sprites from a certain cameraview. The script rotates the camera so that it describes a spherical path around the object.
http://img369.imageshack.us/img369/2360/ui1al0.th.jpg (http://img369.imageshack.us/my.php?image=ui1al0.jpg)
It renders anywhere between 20 and 800 frames. Each time a frame is completed, a couple of things change, and the camera is rotated before it starts rendering the next frame.
When all is done, the images are passed on to a script I wrote that stitches everything together.
http://img369.imageshack.us/img369/6233/ui2my4.th.jpg (http://img369.imageshack.us/my.php?image=ui2my4.jpg)
I've got everything working nicely, except for one thing: controlling the rendering process.
When you've got say 400 frames to render, with GI, DoF and what not, you definitely want to be able to cancel the rendering process. And what's more, I want to be able to do it decently. Pushing the escape key for a couple of seconds basically does the trick, but it throws up some script errors (because of 'missing' data later on in the script, due to the aborted loops) and eventually max crashes.
I have written a resume function, so theoratically aborting a render this way doesn't do much harm, but it's not a very charming way. :p
I have quite literally been searching for days on how to accomplish this, but I can't seem to find anything useful.
One thing I tried is making a button (as you can see in the rendering screen), that will change a variable which is being evaluated with each loop iteration. That should -in theory- be enough to at least break off the loops (the current frame render will still continue though). But the irony is, that when rendering, max seems to be too busy to respond to the button...
I hope that some of you guys can help me with this issue. Any thoughts, ideas and opinions on it are very much appreciated.
Thanks in advance!
Oh by the way, I think that it'd be good to mention: my experience with maxscript is rather limited, I've only started using it a week ago. But I do have quite some experience with other scripting and programming languages, like php, actionscript, java etc.
