When using other language(such as Chinese) as editor language, the Group Name of the Animation Interface will be localized to Chinese. In editor, the animation blueprint grab the group from metadata, which will be the localized FText, this prevents us from obtaining the desired AnimLayer via FName. Are there any good solutions?
[Image Removed]
void UAnimBlueprintGeneratedClass::GenerateAnimationBlueprintFunctions()
{
.......
#if WITH_EDITOR
// In editor we can grab the group from metadata, otherwise we need to wait until CDO post load (LinkFunctionsToDefaultObjectNodes)
FText CategoryText = FObjectEditorUtils::GetCategoryText(*It);
FName Group = CategoryText.IsEmpty() ? NAME_None : FName(*CategoryText.ToString());
#endif
......
#if WITH_EDITOR
AnimBlueprintFunction->Group = Group;
#endif
}
And we will pass the English Group Name into UAnimInstance::GetLinkedAnimLayerInstanceByGroup(FName InGroup) and fail to get the anim layer we want.
Thanks for raising this, I’ve logged an issue that you can follow here: https://issues.unrealengine.com/issue/UE-358593 because of your unique setup, could you try this modification and see if it helps?
In UAnimBlueprintGeneratedClass::LinkFunctionsToDefaultObjectNodes, change
The change works. But I think it would be better to add a if (It->GetName() == RootNodeName
) in the UFunction for loop.
Another concern, MD_FunctionCategory is declare in the editor module and UAnimBlueprintGeneratedClass is in runtime module, using MD_FunctionCategory seems somewhat inappropriate.