Metadata information seems to not be available on import. A user has reported that this was working before but I was able to reproduce the issue in //UE4/Release-4.24 cl 11590370
I am currently listing this as not a regression, further testing may reveal this to be untrue.
Update
In order to access metadata from datasmith scenes the following line must be included before attempting to access metadata:
ds_scene_in_memory.translate_scene()
Final script should look something like this:
import unreal ds_file_on_disk = "C:/Users/alex.berryhill/Desktop/BoxWithMetadata.udatasmith" ds_scene_in_memory = unreal.DatasmithSceneElement.construct_datasmith_scene_from_file(ds_file_on_disk) key_name = "myKey" ds_scene_in_memory.translate_scene() objects_and_values = ds_scene_in_memory.get_all_objects_and_values_for_key(key_name, unreal.DatasmithMeshActorElement) objects = objects_and_values[0] values = objects_and_values[1] print("Printing objects...") print(objects) print("Printing values...") print(values) result = ds_scene_in_memory.import_scene("/Game/MyStudioScene") ds_scene_in_memory.destroy_scene()
Result
The Datasmith scene is imported but Metadata is reported as an empty array.
LogPython: Printing objects... LogPython: [] LogPython: Printing values... LogPython: []
Expected
Metadata information can be manipulated during import.
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-102042 in the post.
2 |
Component | UE - Editor - Content Pipeline - Datasmith - Importer |
---|---|
Affects Versions | 4.24, 4.25, 4.26 |
Target Fix | 4.27 |
Created | Oct 27, 2020 |
---|---|
Resolved | Oct 27, 2020 |
Updated | Oct 28, 2020 |