Disable Viewport Updating
MehdiZangenehBar
Posts: 31
I want to do heavy process, so viewport shouldn't be referesh/ updated, until the end.
any context or command to do this?
Comments
I like to wrap this around any code that will potentially be slowed by the viewport being refreshed
Thatv is SDK code, this is the scripting forum.
DS 4.22.1.88 (so present in the ciurrent General Release) added script features that should help:
http://docs.daz3d.com/doku.php/public/software/dazstudio/4/change_log_4_23_0_1#4_22_1_88
this is great! thank you!
script forum and sdk forum tied together,any code sdk code can be converted to the script code:
App.getInterface().getViewportMgr().redrawsLocked(false)
what part might help?!
Not all SDK features work in Script and vice versa.
In any event, in this case using the SDK calls is risky - if the script crashes out, or simply fails to complete the unlock step for some reason, then the Viewport can be left locked - the calls mentioned in the chnage log will unlock automatically when the script ends, so there is no risk of leaving the Viewport locked.
beginViewportRedrawLock()
Aha, Thank You!
so code should be
beginViewportRedrawLock
process...
dropViewportRedrawLock
what clearViewportRedrawLocks does?
I'm not sure, but it may be clearing all locks while the other two target only the active viewport.
OK, i just want to confirm that beginViewportRedrawLock does the job perfectly.
I call clearViewportRedrawLocks at the end, until we found the official documentation.
http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/global (I think this is brand new, I did look earlier - for what little that may have been worth)
I think the idea is that you can stack mutliple locks during a script and they will not release until all are removed or the clear command is used to remove all of them at once - useful if you might soemtimes want the viewport to update, subject to coinditoons - but if you have just one lock at the beginning it doesn't matter whether you clear or drop (or indeed just exit the script, though that would be sloppy).