How to create thread safe nodes and functions in AnimBP

Since I have updated to 4.15, my animation blueprint gives me warnings on pure functions from my AnimInstance class, custom anim node implementations and various functions within the animation blueprint. Since I am using a lot of these to drive the animation, the warnings of course reflect this.

So, what does thread safe even mean and how do I make something thread safe? I have never worked with multi threading before, so this confuses me and, well, those warnings are REALLY annoying.

1 Like

We need a way to mark e.g. pure functions as thread safe to supress these warnings. I haven’t yet found a way to do this, could someone from epic confirm whether it’s possible to do this in UE4.15 or if it will need a fix in a later engine build. From a workflow perspective I’m expecting something like the pure toggle to mark the function thread-safe.

Bumping this. I have a very safe, non state modifying BlueprintPure specified function I’d like to avoid compile warnings with!

You can use the following decoration:

UFUNCTION(BlueprintCallable, meta = (BlueprintThreadSafe))

I think you should ensure that you don’t query e.g. the character in these functions. The way I got around this is to rather push values from my Character during its tick to the AnimInstance instead of the AnimInstance querying the Character params. It unfortunately requires a lot of duplication.

4 Likes

Same here! Any update?
Should this reported as bug or feature?

Is this possible? Looks like it’s in ue5, I guess it’ll never work in 4? Anyone have any idea?