Editor localization causes the GetLinkedAnimLayerInstanceByGroup function to fail in retrieving the corresponding LinkedAnimLayer within the editor.

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.



[Attachment Removed]

Hey there,

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

			if(FAnimBlueprintFunction* FoundFunction = AnimBlueprintFunctions.FindByPredicate([RootNodeName](const FAnimBlueprintFunction& InFunction){ return InFunction.Name == RootNodeName; }))
			{
				FoundFunction->Group = RootNode->GetGroup();
				FoundFunction->OutputPoseNodeIndex = AnimNodeIndex;
				FoundFunction->OutputPoseNodeProperty = StructProperty;
			}

to

			if(FAnimBlueprintFunction* FoundFunction = AnimBlueprintFunctions.FindByPredicate([RootNodeName](const FAnimBlueprintFunction& InFunction){ return InFunction.Name == RootNodeName; }))
			{
 
				FName CategoryName;
				for (TFieldIterator<UFunction> It(this); It; ++It)
				{
					// Get the raw category metadata string (baked at compile time)
					const FString& Category = It->GetMetaData(FBlueprintMetadata::MD_FunctionCategory);
				
					// Convert to FName for grouping
					CategoryName = Category.IsEmpty() ? NAME_None : FName(*Category);
				}
				
				FoundFunction->Group = CategoryName;
				FoundFunction->OutputPoseNodeIndex = AnimNodeIndex;
				FoundFunction->OutputPoseNodeProperty = StructProperty;
			}

To add, Epic is going on holiday for the end of the year and will be back on January 5th.

Thanks

Dustin

[Attachment Removed]

Thanks, I’ll let the team know on the issue as well as your concern.

Dustin

[Attachment Removed]

Thank you for your reply.

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.

[Attachment Removed]