Description

If you use both Category hierarchy and CallInEditor in UFUNCTION, it will result in an unintended sequence as shown below.

[Image Removed]

And, the following code can solve this issue

void FDetailLayoutBuilderImpl::GenerateDetailLayout()
{
   ...
      SubCategoryMap.Empty();
   for (FCategoryMap::TIterator It(DefaultCategoryMap); It; ++It)
   {
      // Remove all subcategories
      TSharedPtr<FDetailCategoryImpl> DetailCategory = It.Value();
      // Note: Sub-categories are added later
      int32 Index = INDEX_NONE;
      if (DetailCategory->GetCategoryName().ToString().FindChar(FPropertyNodeConstants::CategoryDelimiterChar, Index))
      {
         SubCategoryMap.Add(It.Key(), DetailCategory);
         It.RemoveCurrent();
      }
   }
 
#if 1 //workaround begins
   for (FCategoryMap::TIterator It(CustomCategoryMap); It; ++It)
   {
      // Remove all subcategories
      TSharedPtr<FDetailCategoryImpl> DetailCategory = It.Value();
      // Note: Sub-categories are added later
      int32 Index = INDEX_NONE;
      if (DetailCategory->GetCategoryName().ToString().FindChar(FPropertyNodeConstants::CategoryDelimiterChar, Index))
      {
         SubCategoryMap.Add(It.Key(), DetailCategory);
         It.RemoveCurrent();
      }
   }
#endif //workaround ends
 
   // Build default categories
   while (DefaultCategoryMap.Num() > 0)
      ...

 

Steps to Reproduce

1. Add function using subcategory

UFUNCTION(CallInEditor, Category = "Map|Capture")
void GenerateSnapshot();

2. compile

3. Check Detail panel of Actor

result : does not consider subcategory

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-164419 in the post.

2
Login to Vote

Unresolved
ComponentUE - Gameplay - Blueprint Editor
Affects Versions5.0
Target Fix5.2
CreatedSep 20, 2022
UpdatedSep 30, 2022