x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Set Anim Instance node causing crashes

I just migrated a project from 4.18 to 4.22 and discovered an easily repeatable crash based on something I had working in 4.18. Whenever I use the Set Anim Instance node to change to a different anim blueprint, UE4 crashes.

I tested this extensively in my game and am positive that this is what's causing the crash. I tried making a blank actor with two blank anim blueprint in a blank level and simply set up the actor to switch anim instances after a couple seconds and it causes a crash. I even tried creating a new project using the third person template, making a child of the third person character's anim blueprint and then switching to it on begin play, and it also resulted in a crash.

It strikes me as a bug since I didn't have this issue in 4.18, though I guess I could just be using the node wrong?

Product Version: UE 4.22
Tags:
more ▼

asked Apr 04 '19 at 09:44 PM in Bug Reports

avatar image

Grundlefly
18 2 4

avatar image Van Aarde Apr 05 '19 at 08:07 PM

Hi, this definitely appears to be a bug. We've run into the same issue upgrading from 4.21 but have been unable to resolve it thus far.

I have been able to repro this crash by simply creating a new Character blueprint, creating two different animation blueprints and switching from one to the other using the SetAnimInstance node.

So, you're not alone.

avatar image Devero Apr 09 '19 at 02:46 AM

Im also having this crash as well on calling the same node, needs to be hotfix asap.

avatar image Kelint May 23 '19 at 01:44 AM

This is causing crashes for my FirstPersonShooterKit as well.

avatar image Matei Adeodatus May 27 '19 at 09:07 AM

Did anyone found a workaround for this?

avatar image underscorediscovery Jun 15 '19 at 03:54 AM

commenting (to notify) - I posted an answer that should help!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

3 answers: sort voted first

Hello!
I have a working solution for 4.22.x that can be implemented at the project level.

EDIT: If you just want a drop in solution that also works with BP only projects:

Here's a plugin I made with the workaround described below


image

Thanks to this answers page I found the commit referencing a fix.
I looked closely through the code and realized the code path is direct, meaning we can call the same code in a wrapper function, before hand!

I've made a gist with the details, and example code over here.
https://gist.github.com/underscorediscovery/46ecaf5cc1ba97f1a7e922f6a77a5705

Short answer with code:
1. expose a function that implements the HandleExistingParallelEvaluationTask
2. THEN call SetAnimInstanceClass

 void UTypesAndGlobals::SetAnimInstanceClassFix(USkeletalMeshComponent* SkeletalMesh, UClass* NewClass) {
   // For details: https://gist.github.com/underscorediscovery/46ecaf5cc1ba97f1a7e922f6a77a5705
   // We may be doing parallel evaluation on the current anim instance
   // Calling this here with true will block this init till that thread completes
   // and it is safe to continue
   const bool bBlockOnTask = true; // wait on evaluation task so it is safe to swap the buffers
   const bool bPerformPostAnimEvaluation = true; // Do PostEvaluation so we make sure to swap the buffers back. 
   SkeletalMesh->HandleExistingParallelEvaluationTask(bBlockOnTask, bPerformPostAnimEvaluation);
   SkeletalMesh->SetAnimInstanceClass(NewClass);
 }

This bug caught us out and I spent a while trying various solutions (deploying a custom engine build would be prohibitive for us)

This that I tried:
- FCoreDelegates begin/end frame and various checkpoints to call SetAnimInstanceClass - no luck
- delay of 0 to move the call to somewhere else in the frame, also no luck
- various other hacky ideas :p

Hope this helps!

more ▼

answered Jun 15 '19 at 03:54 AM

avatar image

underscorediscovery
26 3 3

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Since this issue was a big problem for us we did some further digging and found there was a commit in the master branch about 5 days ago titled "Speculative fix w.r.t. copy pose node": https://github.com/EpicGames/UnrealEngine/commit/c4ea32533ee98508ab68038488a09b3a12d54cd4

We cherry picked only the code changes from SkeletalMeshComponent.cpp for the moment and merged it into our custom engine build and it did indeed resolve our SetAnimInstance related crashes. Fingers crossed this fix makes it into the next 4.22 build!

more ▼

answered Apr 06 '19 at 03:15 PM

avatar image

Van Aarde
34 1 2 7

avatar image Grundlefly Apr 07 '19 at 01:53 AM

Good to know I'm not just shoving a square peg in a round hole. Hopefully we get that fix in the first hotfix.

avatar image Grundlefly Apr 27 '19 at 01:44 AM

Just downloaded the latest hotfix, and the issue still appears to be present.

avatar image Grundlefly May 21 '19 at 09:47 PM

Just gave it a go in 4.22.2 and it's still an issue.

avatar image Fi17750 May 06 '19 at 02:11 PM

This problem still not be solved in 4.22.1. still crash when i used this node。

avatar image underscorediscovery Jun 15 '19 at 03:55 AM

commenting (to notify) - I posted an answer that should help!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

This bug still not solved in 4.22.3. Can confirm it continues to happen in a blank, empty test project. The crash report appears to be happening on line 1554 of the SkeletalMeshComponent.cpp

So I figured out an alternative. When I don't want the animation blueprint playing, I use the Pause Anims bool set to false. Then I set it back to true when I want it to tick again. Working so far!

more ▼

answered Jul 03 '19 at 02:27 AM

avatar image

JTXPbrah
86 5 7 10

avatar image underscorediscovery Jul 03 '19 at 02:40 AM

I've commented that on the release thread as well, and provided a work around in the accepted answer!

avatar image JTXPbrah Jul 03 '19 at 02:41 AM

I just discovered an alternative for those that don't know how to use c++ or git or anything like that. Seems to work well and no need to set the animBP to null

avatar image underscorediscovery Jul 03 '19 at 02:57 AM

ah cool, yea that makes sense. fwiw the git link doesn't require git, just hit the Download button and it'll give you a zip file.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question