I am making a plugin which has its own thread to handle requests from other apps. One thing I want to do is to import raw resources created by other app to UE contents(uassets for animation, mat, mesh and so on). The problem I got is that all import functions I can find is not thread safe, so that I have to store those import requests trigger by sub thread to a vector and handle them in my game thread.
The only way I came up with is to spawn an actor in plugin’s StartupModule function and look into the request queue in the actor’s Tick function. But I can’t find a good example to follow to create a “shadow” Actor and ticks it in editor. So I am wondering if I went the right direction. Is there other way to achieve this functionality? If no, how to spawn an actor out of the “World” and get it ticked? I am new to UE4 so could you guys give me some hints? Thanks.
You can implement tick to any object by adding inference to FTickableGameObject or FTickableEditorObject the class (like interface) it self don’t event need to be UObject so you can do this on module class or any class you can think off.
If tick involves game it self use FTickableGameObject and ot make it tick to editor override IsTickableInEditor and IsTickableWhenPaused to make it return true. If it’s more for editor functions use FTickableEditorObject
Once you set it up just override Tick function as you normally do in actor
The “example code” is the unreal engine source code. Just open UE4.sln and search for MIDIDeviceModule or SkeletonEditor.
To be more specific about this topic: You have to create an instance of your own FTickableEditorObject and it will register itself to the engine/editor update loop.