Animation Property Access System in C++?

Hi, sorry for so long answer. To be clear, I’m not an Animation Developer. But I’m also interested in this topic, maybe it would be easier for us to cooperate))

Just to be clear, all I’m trying to do is “TryGetPawnOwner.GetActorLocation” in my c++ thread-safe function. In blueprints it won’t let you make that function call unless you use the property access node, whereas in c++ im not sure how to do this.

If I understood correctly, this won’t be a thread-safe call, cause you’re trying to get info directly from Owner, outside of AnimInstance. That’s why EventGraph is empty in AnimBP. As they stating in doc about animation in Lyra:

“When using Thread Safe functions you can not access data directly from game objects as you could in the Event Graph. For example, if you were attempting to copy the Gameplay float value for the Character’s speed it would not be considered thread-safe, therefore we recommend the use of Property Access to accommodate these instances.”

I think you should use proxy stored variables only for property access.

I’m guessing the correct way to get that would be to set an owner variable on the proxy during its initialization becuase it passes in the Anim Instance, and accessing the GetActorLocation() from that?

I would do that. Maybe even tried to set all properties on init that I would need to have access to in future, like Location, Rotation, Velocity etc.

By the way, just run a simple test measuring exec time for different AnimBPs in the game thread.
ALS_AnimBP ≈ 180μs
Basic AnimBP (only owners rotation and velocity) ≈ 80μs
Lyra AnimBP ≈ 30μs
Measured by Unreal Insights. The test wasn’t perfect, just simple AIBot running and jumping through the level, but still interesting results. Maybe I should run a test with multiple bots to make a stress test.

2 Likes