GatherText grabbing editor data

Hi there,

It seems that with the new method of storing the localization data in assets as per the GatherLocalizationDataFromPropertiesOfDataStructure, that the localization process now adds in a lot of editor things like tooltips from assets even with the ShouldGatherFromEditorOnlyData=false

For example the PropertyTooltip in the FOptionalPinFromProperty struct (ShowPinForProperties.PropertyTooltip), which isn’t an editor only property. This seems to be a big culprit for us, but we are also seeing two other properties:

K2Node_FunctionEntry.MetaData.Category
AnimStateTransitionNode.Transition.K2Node_AnimGetter.CachedTitle

This is taken up a large chunk of our localization files.

I plan to add some code to hack out these property names since in our case we wont have duplication here, however if there a reason these properties couldn’t be marked as editor only? (with WITH_EDITORONLY_DATA )

Is there a more officially approved way I could implement this?

We’ve seen this ourselves internally, and have fixed it in two ways (one sticky plaster, and one robust).

The sticky plaster solution is the one you suggested (wrapping the properties in WITH_EDITORONLY_DATA). These fixes should be present as of 4.10.1.

The more robust solution is to gather the game text from the blueprint bytecode, and mark everything else that’s part of the blueprint asset as editor-only. This change should be present as of 4.11.

So we are now upgraded to 4.10.1 and indeed the PropertyTooltip is now being wrapped properly and not exported.

However two cases are still occurring for us and not wrapped in WITH_EDITORONLY_DATA.

These are in:

  • UK2Node_AnimGetter → FText
    CachedTitle
  • FKismetUserDeclaredFunctionMetadata → FText Category

I assume that 4.11 will fix this as there are part of the blueprint system and thus should be caught by that solution.

But wanted to bring this to attention in case others are pulling their hair out :slight_smile:

Hi Jamie,

(I’m on 4.11)

I’ve seen a lot of those annoying ShowPinForProperties.PropertyTooltip myself, so I’ve tested/debugged a small example, and I noticed they clean up when I “force load” the assets during the gathering (MustLoadForGather stuff in UGatherTextFromAssetsCommandlet::Main)

Alternatively, re-saving a particular asset also seems to work, so to summarize:

  • No force load, asset left as-is (kind of old, I guess) => bad
  • Force load => good
  • No force load but asset re-saved => bad

I must admit the MustLoadForGather rules (VER_UE4_PACKAGE_REQUIRES_LOCALIZATION_GATHER_FLAGGING stuff…) look a bit complicated - are there known bugs? Do I have another option than… re-saving all assets??

Thanks,

I should have mentioned before, but you’d need to re-save the assets to update the cache of texts they store in their header after getting these fixes.

There have actually been some more fixes made since (as we can’t correctly cache texts from things that contain bytecode, so those always get loaded), plus we added a version bump so that this manual re-saving to get a clean gather isn’t needed (any older assets are just fully loaded to make sure they’re up-to-date).

There’s nothing wrong with changing that code to just load any assets that contain texts (PackageFileSummary.GetFileVersionUE4() < VER_UE4_PACKAGE_REQUIRES_LOCALIZATION_GATHER_FLAGGING || PackageFileSummary.PackageFlags & PKG_RequiresLocalizationGather), but it will make your gather a lot slower.

OK thanks Jamie - I see the code is slightly different in 4.12, that’s the fix(es) you’re talking about I guess.

e.g.

old line:

else if (PackageFileSummary.GetFileVersionUE4() < VER_UE4_SERIALIZE_TEXT_IN_PACKAGES)

new line:

else if (PackageFileSummary.GetFileVersionUE4() < VER_UE4_SERIALIZE_TEXT_IN_PACKAGES || (EditorVersion && EditorVersion->Version < FEditorObjectVersion::GatheredTextPackageCacheFixes))