Description

When the function UDataTableFunctionLibrary::FillDataTableFromCSVString() is used from Editor Utility Blueprints or Python Scripts, and the contents of the affected Data Table are currently being viewed in the Data Table Editor, the engine may crash or display garbage values. This does not happen with the similar function UDataTableFunctionLibrary::FillDataTableFromCSVFile().

The reason appears to be that UDataTableFunctionLibrary::FillDataTableFromCSVString() calls UCSVImportFactory::FactoryCreateText() directly, which in turn discards the old UDataTable and creates a new one in its place, without properly notifying any open Editor windows. On the other hand, UDataTableFunctionLibrary::FillDataTableFromCSVFile() wraps the call to FactoryCreateText() inside the pair FDataTableEditorUtils::BroadcastPreChange() and FDataTableEditorUtils::BroadcastPostChange(), which seems to handle the situation correctly (not 100% verified).

 

Steps to Reproduce

(Step 1)

  • Launch UE 5.2

(Step 2)

  • Create a Structure (Blueprint – Structure).
  • Add a few Integer variables and a Texture2D variable.
  • Save and close.

(Step 3)

  • Create a DataTable (Miscellaneous – Data Table).
  • Select the previously created structure for the rows.
  • Add a single row to the data table.
  • In the "Row Editor" tab below, select any texture for the Texture2D variable.
  • Save and close.

(Step 4)

  • On the Content Browser, right-click the data table and select "export as CSV". Save the CSV file on any desired location.
  • Open the saved CSV file in any text editor, select and copy all of its contents.

(Step 5)

  • Create an EditorUtilityObject (Editor Utilities – Editor Utility Blueprint – Editor Utility Object).
  • Override the "Run" function. Implement "Event Run" with a single node "Fill Data Table from CSV String".
  • For the first input pin, pick the previously created data table.
  • For the second input pin, paste the contents of the CSV file.
  • Compile, save and close.

(Step 6)

  • Open the Data Table asset and make sure a row is selected with its contents displayed in the "row editor" tab below.
  • While keeping the Data Table asset open, right-click the Editor Utility Object asset and run it.
  • At this point, garbage values may appear for the integer variables. The engine may crash or not.
  • If the engine does not crash, deselect and reselect the table row on the Data Table Editor. Note the values are correct now. Re-run the Editor Utility Object.

Have Comments or More Details?

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

0
Login to Vote

Unresolved
Affects Versions5.2.1
Target Fix5.5
CreatedJan 20, 2024
UpdatedApr 16, 2024