I’m trying to find a way to start and stop Pixel Streaming programmatically in my project in Editor, using either Python, C++, or console commands.
I’ve enabled the Pixel Streaming plugin in my project, but I’m struggling to control it from code. Here’s what I’ve tried so far:
- Tried to access
unreal.PixelStreamingStreamerComponent
using both Python and C++, but couldn’t find a way to do it.
- Enabled
-AllowPixelStreamingCommands
and attempted to use console commands ‘startStreaming’ and ‘stopStreaming’, but these don’t work.
I’m looking for a way to start and stop streaming without using the editor toolbar.
Could someone please provide the current, correct way to:
- Start Pixel Streaming programmatically
- Stop Pixel Streaming programmatically
- Switch Between Level Editor and Full Editor
If possible, I’d appreciate examples in Python, C++, or even correct console commands if that’s the best approach.
Hi there!
I’d be happy to shed a bit of light on this for you.
If you’d like to programmatically start and stop level/editor streaming, you can use the following C++ code:
For Pixel Streaming 1:
`IPixelStreamingEditorModule& Module = IPixelStreamingEditorModule::Get();
// Stream level editor
Module.StartStreaming(UE::EditorPixelStreaming::EStreamTypes::LevelEditorViewport);
// Stream editor
Module.StartStreaming(UE::EditorPixelStreaming::EStreamTypes::Editor);
// Stop streaming
Module.StopStreaming();`And for Pixel Streaming 2:
`IPixelStreaming2EditorModule& Module = IPixelStreaming2EditorModule::Get();
// Stream level editor
Module.StartStreaming(EPixelStreaming2EditorStreamTypes::LevelEditorViewport);
// Stream editor
Module.StartStreaming(EPixelStreaming2EditorStreamTypes::Editor);
// Stop streaming
Module.StopStreaming();`This should get you going in the right direction, but please let me know if you had any further questions!
Kind Regards,
Michael