Some issues about animation blueprint have just been discovered when I try to upgrade my 4.20 project to 4.23. And it turned out that those issues had caused some trouble to us.
As a result, it took me several days to dig into this issue, and something seems should be recorded. Hope this could help you some day.
What Is This Issue?
When you try to open an Animation Blueprint with a Sub Anim Instance node in it, you may notice that the engine is frozen. And while you check the editor log, you see lots of:
FAnimNode_StateMachine: Bad machine ptr
And you may notice that the engine takes much more time to compile the Animation Blueprint that have a Sub Anim Instance node in it.
Now you may get the point: This issue is all about the Sub Anim Instance node.
If You Simply Want a Solution
Method 1: Modify the engine code
By modify the engine code, you can fix the issue once and for all.
Modify the FAnimInstanceProxy::InitializeRootNode function in the AnimInstanceProxy.cpp file.
You need to move
1 | for (UStructProperty* Property : AnimClassInterface->GetAnimNodeProperties()) |
to the top of the if block.
The final code looks like:
1 | if(AnimClassInterface) |
Method 2: Modify the Resource
If you tend to keep consistent with the official engine, you need to follow these steps:
- Add following lines to your
DefaultEngine.inifile.
1 | [Core.Log] |
This would prevent the engine from printing endless log to your console, which causing freeze.
- Open the Animation Blueprint, and locate the
Sub Anim Inputnode. This might take some time… - Create a new
Sub Anim Inputnode and replace the old node with the new one. - Revert those modifications from the
DefaultEngine.inifile.
So that’s how we should fix this issue. Another blog would be post to record how I dig into this issue.