Notifications
Clear all

[Closed] Viewport redraws inside "with redraw off"

I have quite a large exporter for the game I am working on and it fully works in MAXScript. Now to speed things up, I have put the code that starts the whole thing inside with redraw off(), so that the viewport is not updated during exporting. I am moving the slider around a lot during exporting, so this really saves some 80% of the time needed to export a level. Now the oddity is that at a specific point in my code is this line:

delete copiedObj

If this line is executed, then the viewport is redraw all the time. If I delete that line or if the line is never called, then the viewport is not redrawn. That seems quite odd to me and I have not been able to find any work around or something to get around it.

What can I do to solve this? (If no one knows a real solution, than getting position and rotation information from a node without having to change the slidertime might do the trick as well.)

Thanks in advance!

5 Replies

instead of using your ‘with redraw off()’… try this:

disableSceneRedraw()

function()
[size=1]enableSceneRedraw()

[/size]

Yes, I expected that to work, so I already tried them and they did not solve it either, unfortunately.

at time X print $.pos – where X is the queried frame number

Wow, that really increased the speed of my exporter! At time is also faster when with redraw off would have worked, because the slider itself is always updated. Thanks!

Glad to hear it worked out well for you.