i use blueprint animation for skeletal mesh
template <typename ObjClass>
static FORCEINLINE ObjClass* LoadObjFromPath(const FName& Path)
{
if (Path == NAME_None) return NULL;
//~
return Cast<ObjClass>(StaticLoadObject(ObjClass::StaticClass(), NULL, *Path.ToString()));
}
static FORCEINLINE UAnimBlueprint* LoadAnimBlueprintFromPath(const FName& Path)
{
if (Path == NAME_None) return NULL;
//~
return LoadObjFromPath<UAnimBlueprint>(Path);
}
UAnimBlueprint* bP = LoadAnimBlueprintFromPath(FName(*Name));
if (bP.Object && SkeletalMesh)
{
SkeletalMesh->SetAnimationMode(EAnimationMode::AnimationBlueprint);
SkeletalMesh->SetAnimInstanceClass(bP->GetAnimBlueprintGeneratedClass());
}
in editor it works fine, after pakage it not working …what am I doing wrong?