MoI discussion forum
MoI discussion forum

Full Version: Constant Viewport refresh?

Show messages: All  1-3  4-5

From: Michael Gibson
22 Aug 2018   [#4] In reply to [#3]
Hi Fubax, well I really don't recommend it but you could try inserting a some script like this inside of CommandBar.htm :

code:
		<script>
			var g_intervalID = null;

			function constantRedrawTimerFunc()
			{
				moi.ui.redrawViewports();
			}

			function startConstantRedraw()
			{
				if ( !g_intervalID )
					g_intervalID = window.setInterval( constantRedrawTimerFunc, 300 ); // call timerfunc every 300 ms.
			}

			function stopConstantRedraw()
			{
				if ( g_intervalID )
				{
					window.clearInterval( g_intervalID );
					g_intervalID = null;
				}
			}
		</script>


Then set up 2 shortcut keys with:

script: moi.ui.commandBar.startConstantRedraw();

script: moi.ui.commandBar.stopConstantRedraw();


The call to moi.ui.redrawViewports(); will not immediately draw the viewports, it will mark them as needing an update and they'll get redrawn when the message queue is next emptied.

- Michael
From: Fubax
23 Aug 2018   [#5] In reply to [#4]
Thank you Michael, it works. I only had to use it temporally so the implementation is very nice.

Show messages: All  1-3  4-5