Description

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()
Steps to Reproduce
  1. Create a 3DSMax file with Metadata
    • In 3DSMax select Edit > Object Properties
    • Metadata needs to be formatted as [key name][space]=[space][value]
  2. Export the object as a .udatasmith file
  3. Create a new project
  4. Enable Datasmith Import, and Python Script Editor plugins
  5. Restart the project
  6. Download and run the attached Python script
    • This can be done by saving the Python script in a "Python" folder in Content or copy and pasting the script into the Output Log
    • Be sure to change ds_file_on_disk to the filepath of the saved .udatasmith asset and change key_name to the keyname that you created in 3DSMax

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.

Have Comments or More Details?

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

2
Login to Vote

Non-Issue
CreatedOct 27, 2020
ResolvedOct 27, 2020
UpdatedOct 28, 2020
View Jira Issue