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"

AnswerHub Maintenance

Background maintenance is scheduled to occur between 9 - 11am EDT on Tuesday, May 21. Site operation may be slower than normal during this time and a brief interruption in operation may be observed

Unable to assign animation blueprint to skeletal mesh with C++ in 4.15

If I create a new project in UE 4.15, and create a c++ class that uses the following code to load an animation blueprint:

 static ConstructorHelpers::FObjectFinder MeshBaseAnimRef(TEXT("/Game/ABP_AssetName"));
 MeshBase->SetAnimInstanceClass(MeshBaseAnimRef.Object->GeneratedClass);

The code will not compile, saying that UAnimBlueprint is an 'incomplete class type'. If I create a project in an earlier version, and add the same code, there will be no such error, and the project can be converted to 4.15 without a problem from there.

Cheers! (This question used to be an attempted bug report, and has been edited down to be more concise. Short answer: AnimBlueprint.h must be included manually now.)

-Ben

Product Version: UE 4.15
Tags:
more ▼

asked Mar 14 '17 at 03:01 AM in C++ Programming

avatar image

Sirennus
3 1 3

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

2 answers: sort voted first

Hi Ben,

incomplete type usually means you're missing an include, try to include "AnimBlueprint.h" where you need to use it.

more ▼

answered Mar 14 '17 at 12:14 PM

avatar image


1.4k 47 32 103

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

Hey Sirennus-

When something has been deprecated, that means that it still works currently, but is in the process of being phased out / replaced. Without seeing the full compile error, Cø's suggestion of specifically including AnimBlueprint would be my best guess to fix the issue. If adding the include does not fix the compile error, please provide the full error you receive to provide further information.

Cheers

Doug Wilson

more ▼

answered Mar 14 '17 at 01:31 PM

avatar image Sirennus Mar 15 '17 at 08:56 AM

No luck, tried including "Components/SkeletalMeshComponent.h", which is where UAnimBlueprint is declared, with no change. I'll put the UE message log in the 'question' post now.

avatar image Mar 15 '17 at 08:58 AM

UAnimBlueprint is declared in AnimBlueprint.h, not in SkeletalMeshComponent.h

avatar image Sirennus Mar 15 '17 at 09:10 AM

Guess I don't know how to navigate visual studio, cause it only led me there. Yes, that worked. So i guess this isn't a bug, after all. Thanks for your help, guys. This is a better solution than the one that I found. *edit: Since there's clearly no error on UE's part here, should I remove this question to clear space? I think this goes to show that I should leave bug reports to the experts, heheh. *Edit 2: Hang on, why DID this happen, anyway? Despite this resolution, this still leaves 4.15 unable to use UAnimBlueprint without an include, unlike the previous versions, isn't that a problem? -Ben

avatar image Doug E ♦♦ STAFF Mar 15 '17 at 01:26 PM

Hey Ben,

The removal of the include (from previous engine versions) was an intentional change made to improve overall compile times. This is why the include had to be added manually.

avatar image Sirennus Mar 17 '17 at 01:07 AM

Oh dear, wish I had known that from the start :^) Thanks again! I'll leave this be, now.

(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