Hi,
we use linked ABP for updating motion matching pipeline. This linked graph has input data structure which is sent from the owner graph and may contain information such as proxy table for PSD chooser etc.
It happens that the preview character in the editor does not accept any such data so the chooser evaluation always return no database and the motion matching update node spams that there is no database. We can use some fake database for the preview character but it is not nice and a secondary problem appears after that. The same update then spams the output log that there is no pose history which is also true because pose history is recorded on different level and not available in this stage (LogPoseSearch: Error: FSearchContext::GetWorldRootBoneTransformAtTime - Couldn’t search for world space root boneTransform by PSS_Humanoid_Idle, because no IPoseHistory has been found!)
For us the preview character is useless in this state. The better case should be if we can specify character BP for it but it seems that it is not possible now.
Is it another way how to suppress the preview update completely?
Do you have any suggestion what we can do?
Thanks for any help.
Jiri
Hi, just to confirm that I understand the issue correctly - it sounds like you have your Motion Match node in a linked anim graph but the Pose History node, and the logic on which database to use, exists in the main graph?
This is a downside of the linked graph system when there is logic in the main graph that the linked graph relies on. What we would usually suggest is some form of fake/dummy data or logic within the linked animation graph. It sounds like you’ve already gone some of the way towards this since you mentioned having a fake database.
However, as you’ve seen, the Motion Matching node is also dependent on the presence of a Pose History node somewhere in the graph. The Motion Matching node uses the message stack system within the anim instance to find the nearest Pose History node, which means you can’t easily change the Pose History that’s being used (the one closest to the Motion Matching node in the graph will always be chosen). We could potentially make this easier in future by allowing you to specify the Pose History by node tag, or something similar, so you could switch which Pose History is being used depending on whether the full graph setup is running, or just the linked graph.
But for now, you would need to alter the structure of the graph to essentially have one branch that’s used when editing the sub-graph in the anim bp editor, and another graph when running the full setup with the main anim bp. So the graph would look something like this (or similar, where the Pose History is further downstream but still within the linked graph):
[Image Removed]If you wanted to go down the route you mentioned of disabling the animation update on the debug mesh when editing the linked graph, you’d have to make some code changes. Likely the easiest way to do this is to set the USkeletalMeshComponent::bNoSkeletonUpdate flag on UDebugSkelMeshComponent when your linked graph type is active on that mesh component. With that property set, the animation update won’t run on whatever anim instance is present on the mesh component.
Let me know if you’d like to discuss any of this further.
Hi, in terms of using EnableUpdateAnimation, I would be wary about that. That flag was just added recently by the Fortnite team specifically for the case where you have a linked anim graph that isn’t having it’s graph evaluated, but previously you would still have a cost for it being updated. The issue is that setting that flag doesn’t turn off evaluation phase of the graph, only the update phase. So you’ll still be evaluating the graph without updating it, and that could cause odd behaviour or crashes with certain setups, since we assume if an evaluation happens, that there has been an update on the same frame.
> It isn’t so nice to add these debug nodes into the graph. I consider the option with the bNoSkeletonUpdate flag, but it seems that there is only one preview character with shared skeleton component, so when one AnimInstance turns it off it also disables on the rest. Moreover, it has one flaw - when I disable update, there is no chance to turn it on again 
I was thinking the approach to take with the DebugSkeletalMeshComponent would be to special-case on USkeletalMeshComponent::AnimClass. Assuming you just have one specific anim bp type that you want to skip the update/evaluate for, you could do that inside of UDebugSkelMeshComponent::TickComponent and set bNoSkeletonUpdate for that bp type. I’m not sure that you would need to turn it back on in this situation, assuming the functionality is specific to the linked graph that contains the anim bp - would you ever need to see the debug skeletal mesh animate while editing that graph?
Since you already have a custom anim instance then another option might be to use EnableUpdateAnimation like you mentioned, but also just add a similar check in a derived implementation of UAnimInstance::ParallelEvaluateAnimation to see if the evaluate should run. That would at least be safer than just setting EnableUpdateAnimation.
Hi, yeah, doing something like you suggested would make sense since you’ll be skipping both the update and the evaluation of the graph. I don’t think there’s a way to prevent the evaluate at the Anim Instance level, without modifying engine code, since the functions aren’t virtual as you mentioned. The lack of virtual functions is intentional since there are a lot of dependencies between the different parts of the Anim Instance update, so making changes is somewhat risky. Although at least with your changes, they should only affect the anim bp editor preview instances.
I’ll close out this thread but feel free to reopen it if you run into any issues with this in future.
Hi Euan, thanks.
It isn’t so nice to add these debug nodes into the graph. I consider the option with the bNoSkeletonUpdate flag, but it seems that there is only one preview character with shared skeleton component, so when one AnimInstance turns it off it also disables on the rest. Moreover, it has one flaw - when I disable update, there is no chance to turn it on again 
The result should be that the update is disabled only for specific anim instance. Of course, the first try is without any changes to the engine (we inherited anim instance class, so the implementation is there).
Then I tried disable animation update with EnableUpdateAnimation() directly on the anim instance and it seems to be working better.
What do you think?
Jiri
Hi, thank you.
I have added the condition into PreUpdateLinkedInstances() but the only reason is that it is virtual method, something like this:
[Image Removed]This has advantage that I can change the flag (UpdatePreviewInstance) in runtime (this type of update is called even the animation update is turned off).
I can do similar check into ParallelEvaluateAnimation() as you suggested but it is not virtual right now so I have to change it in the base. In general, we try to avoid any changes into the engine. Nevertheless, I have tried this:
[Image Removed]And it really skips the evaluation when the update is turned off. The method IsPreviewAnimInstance() returns true, if the character is in preview world. UpdatePrewiewInstance is our flag on our AnimInstance that tells the system that the ABP should not be updated.
Do you think that it is better/safer solution?