Hi,
> Regarding my previous post, sorry if it was confusing. I meant when I had this getMainABP function running as not threadsafe, I did not have any not valid errors it ran fine. I realized I was not using the setup correctly and taking advantage of thread safe performance so switched it to threadsafe based on the lyra example, and that’s when I introduced the return none log spam. ( Although the system did work data wise ).
Ok yeah, that makes sense. The function anim bp function (in your case GetABPBase) should be marked as thread safe. The call to GetOwningComponent.GetAnimInstance isn’t thread safe so when it’s included in a threadsafe function like GetABPBase it runs up front before the update and we cache the value for wherever it’s referenced within the graph.
> hmm switching to use GetMainAnimInstance seems like it might have solved my issue, I will test more and come back. How does it work differently?
Looking at the implementation of Blueprint_GetMainAnimInstance, it’s actually marked as thread safe as well, which I’m assuming is why the issue goes away when you use it. However, all it’s doing is wrapping the call to GetOwningComponent.GetAnimInstance. So it shouldn’t really be marked as thread safe because technically it’s not. The chances of it ever causing a problem are low, but in theory you could access some data via GetMainAnimInstance that’s being written to on another thread. We do similar things to this quite often in our projects, so this is an ok solution if it works for you.
> Blueprint Runtime Error: “Accessed None trying to read property CallFunc_GetABPBase_ReturnValue_28”. Node: AimOffset Player ‘(None)’ Graph: AimOffsetLayer Function: Execute Ubergraph ABP Layers Base Blueprint: ABP_LayersBase
I have managed to get a repro where the cast will fail on the first frame. But I only hit it once, I didn’t get any spam. It may just be an issue with your setup being slightly different and that exposes an issue in Lyra. If you happen to be calling the function more on the first frame than in Lyra, you would see more errors.
> Let me know if you want to see the project and how to send it to you if so.
Yeah, I think we’re at a point where it’d be useful to get a proper repro. It would have to be a cut down version of the project that I could run on my end without any dependencies, or a project you recreate that repros the issue. I’ve shared a link to a Box folder with you that you can upload the project to. You should have received a separate email with the details.
> Also I did play with getting the anim instance ans chaching on blueprint init of the layered abp but that didn’t provide me with the updating data. I didn’t try doing it on update every frame, that sounds like it could work but following thr Lyra setup I assumed this way was more performant.
That’s also slightly odd. We store by reference in blueprint, so if you get the anim instance and store it, then use that reference to access variables on the anim instance in subsequent frames, those values should be the same as the updated values as you see in the main anim instance.