Description

The TextExportTransient can be specified as a property flag and object flag. Behavior is inconsistent: there are many ways in which an object marked TextExportTransient can still be part of the text export:

  • When an object property marked CPF_TextExportTransient references a UObject not marked RF_TextExportTransient...
    • That UObject, if outered to an exported object will still be exported as an ObjectInner
    • Repro steps: fill these with an object that's not marked TextExportTransient. Copy the outer actor and note that the referenced objects are exported as part of ObjectInners, although the properties are not exported. This may be won't fix... since it's non-trivial to determine for an ObjectInner how it got there.
    • Expected[Image Removed]: When an inner object is only referenced via a TextExportTransient property, that inner object isn't text exported.

 

    UPROPERTY(VisibleAnywhere, TextExportTransient)
    UMyTextExportTransientObject* MyTextExportTransientProperty;
    UPROPERTY(VisibleAnywhere, TextExportTransient)
    TArray<UMyTextExportTransientObject*> MyTextExportTransientArray; 

 

  • When an object marked RF_TextExportTransient, but is referenced by an object property marked CPF_InstancedReference, or an object array property marked CPF_InstancedReference...
    • Both the object name and contents are exported, since the InstancedReference code path in 
      void ExportProperties(...)

      do not check whether the referenced object is marked TextExportTransient.

    • Repro steps: fill these with a UObject that has the flag RF_TextExportTransient. Copy them and notice that the object references and definition is exported on-demand when these properties are parsed.
    • Expected: Any TextExportTransient object is not exported, even when referenced by an instanced property. Those instanced properties' reference to the TET object is also not exported.

 

    UPROPERTY(VisibleAnywhere, Instanced)
    UMyTextExportTransientObject* MyInstancedObject;
    UPROPERTY(VisibleAnywhere, Instanced)
    TArray<UMyTextExportTransientObject*> MyInstancedArray; 

 

Steps to Reproduce

Try out the following combinations of UObject and UPROPERTY tags:

  • UObjects without RF_TextExportTransient referenced by UPROPERTIES(TextExportTransient)
  • UObjects with SetFlags(RF_TextExportTransient) referenced by UPROPERTY(Instanced) object ptr or object ptr arrays

Try the above combinations while following these steps:

  • Spawn an actor class that creates a UObject with/without TextExportTransient tag in its OnConstruction override
  • Also in OnConstruction: Assign it to a UPROPERTY with/without the TextExportTransient property specifier.
  • Drag the actor into the level and copy it with Ctrl + C
  • Paste it into a text editor with Ctrl + V

Expected: Ideally in none of the cases where either the object or the property is TextExportTransient is the object exported in any way (not with Begin Object, nor path name of object).

Observed: 

  • Instanced UPROPERTIES (single or array) will cause a TextExportTransient object to be text exported: both its reference and the object.
  • Non-TextExportTransient UObjects referenced only by TextExportTransient UPROPERTIES will still be exported as part of InnerObjects
Callstack

Not a crash. Callstack for reference when copying objects:

     UnrealEditor-Engine.dll!UExporter::EmitBeginObject(FOutputDevice & Ar, UObject * Obj, unsigned int PortFlags) Line 481    C++
     UnrealEditor-UnrealEd.dll!UObjectExporterT3D::ExportText(const FExportObjectInnerContext * Context, UObject * Object, const wchar_t * Type, FOutputDevice & Ar, FFeedbackContext * Warn, unsigned int PortFlags) Line 320    C++
     UnrealEditor-Engine.dll!UExporter::ExportToOutputDevice(const FExportObjectInnerContext * Context, UObject * Object, UExporter * InExporter, FOutputDevice & Out, const wchar_t * FileType, int Indent, unsigned int PortFlags, bool bInSelectedOnly, UObject * ExportRootScope) Line 201    C++
>    UnrealEditor-Engine.dll!UExporter::ExportObjectInner(const FExportObjectInnerContext * Context, UObject * Object, FOutputDevice & Ar, unsigned int PortFlags) Line 602    C++
     UnrealEditor-UnrealEd.dll!ULevelExporterT3D::ExportText(const FExportObjectInnerContext * Context, UObject * Object, const wchar_t * Type, FOutputDevice & Ar, FFeedbackContext * Warn, unsigned int PortFlags) Line 585    C++
     UnrealEditor-Engine.dll!UExporter::ExportToOutputDevice(const FExportObjectInnerContext * Context, UObject * Object, UExporter * InExporter, FOutputDevice & Out, const wchar_t * FileType, int Indent, unsigned int PortFlags, bool bInSelectedOnly, UObject * ExportRootScope) Line 201    C++
     UnrealEditor-UnrealEd.dll!UUnrealEdEngine::CopyActors(const TArray<AActor *,TSizedDefaultAllocator<32>> & InActorsToCopy, UWorld * InWorld, FString * DestinationData) Line 169    C++
     UnrealEditor-UnrealEd.dll!UUnrealEdEngine::edactCopySelected(UWorld * InWorld, FString * DestinationData) Line 110    C++
     UnrealEditor-UnrealEd.dll!UEditorEngine::CopySelectedActorsToClipboard(UWorld * InWorld, const bool bShouldCut, const bool bIsMove, bool bWarnAboutReferences, FString * DestinationData) Line 3355    C++
     UnrealEditor-UnrealEd.dll!UUnrealEdEngine::Exec_Edit(UWorld * InWorld, const wchar_t * Str, FOutputDevice & Ar) Line 1592    C++
     UnrealEditor-UnrealEd.dll!UUnrealEdEngine::Exec(UWorld * InWorld, const wchar_t * Stream, FOutputDevice & Ar) Line 718    C++
     UnrealEditor-LevelEditor.dll!FLevelEditorActionCallbacks::ExecuteExecCommand(FString Command) Line 2034    C++
     [Inline Frame] UnrealEditor-LevelEditor.dll!Invoke(void(*)(FString) &) Line 47    C++
     UnrealEditor-LevelEditor.dll!UE::Core::Private::Tuple::TTupleBase<TIntegerSequence<unsigned int,0>,FString>::ApplyAfter<void (__cdecl*const &)(FString)>(void(*)(FString) & Func) Line 310    C++
     UnrealEditor-LevelEditor.dll!TBaseStaticDelegateInstance<void __cdecl(void),FDefaultDelegateUserPolicy,FString>::ExecuteIfSafe() Line 779    C++
     [Inline Frame] UnrealEditor-Slate.dll!TDelegate<void __cdecl(void),FDefaultDelegateUserPolicy>::ExecuteIfBound() Line 635    C++
     UnrealEditor-Slate.dll!FUIAction::Execute() Line 139    C++
 

Have Comments or More Details?

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

0
Login to Vote

Unresolved
ComponentUE - Gameplay - Blueprint
Affects Versions5.45.3
Target Fix5.5
CreatedMay 23, 2024
UpdatedJun 3, 2024
View Jira Issue