How to force refresh UE viewport from another application (with focus in Maya, for example)?

Hi!

I am playing with similar to m2u great stuff and have probably a simple question: How to force UE’ viewport to refresh after each command?

At this moment I can transform my Actors on level by sending commands from Maya through TCP and I can see the Details panel is updated, but Unreal Editor viewport is not refreshed till I will switch focus from Maya.

Sure, I am using GEditor->RedrawAllViewports(); command, but this doesn’t help…

Win 7 x64, UE 4.7.6

Thank you in advance!

Hi!

6 years later I have the same issue, although I am using python. I tried


unreal.EditorLevelLibrary.editor_invalidate_viewports()

but it does not help.

Old thread, but answering in case this comes up in searches :slight_smile:

The viewports don’t refresh unless ‘use less CPU in background’ is unchecked in editor settings, but in C++ you can temporarily override this:

UEditorEngine* const EEngine = Cast<UEditorEngine>(GEngine);
EEngine->ShouldDisableCPUThrottlingDelegates.Add(ViewportRefreshDelegate);

Where ViewportRefreshDelegate can be something like

UEditorEngine::FShouldDisableCPUThrottling ViewportRefreshDelegate;
...
bool DoRefresh()
{
	return true;
}
...
ViewportRefreshDelegate.BindStatic(DoRefresh);

If you don’t want to permanently override the throttling, have your delegate return true for one frame, or remove it after the next tick.

1 Like