Steps to Reproduce

Run the following python code in editor (can do this step by step in the python console):

import unreal
 
# Run with an animation sequence (`AnimSequence` asset) selected in the content browser
anim = unreal.EditorUtilityLibrary.get_selected_assets()[0]
# The C++ type of data_model_interface, declared in `UAnimSequenceBase` is `TScriptInterface<IAnimationDataModel>`
data_model = anim.data_model_interface
 
# Printing the object reveals the actual object type, `AnimationSequencerDataModel`
print(data_model)
# <Object '/Game/...:AnimationSequencerDataModel' (0x...) Class 'AnimationSequencerDataModel'>
 
# However, the Python object type is the interface type (`AnimationDataModel`)
print(type(data_model))
# <class 'AnimationDataModel'>
 
# Trying to access properties of the interface implementor class (`AnimationSequencerDataModel`) fails
# (as indicated in the generated docstring for `AnimationSequencerDataModel`, `animated_bone_attributes` is an editor property of the type)
anim_bone_attrs = data_model.get_editor_property('animated_bone_attributes')
# Error: Exception: AnimationDataModel: Failed to find property 'animated_bone_attributes' for attribute 'animated_bone_attributes' on 'AnimationSequencerDataModel'
 
# Trying to explicitly cast to the actual object type fails
anim_seq_data_model = unreal.AnimationSequencerDataModel.cast(data_model)
# Error: TypeError: AnimationSequencerDataModel: Cannot cast type 'AnimationDataModel' to 'AnimationSequencerDataModel'

Have Comments or More Details?

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

1
Login to Vote

Backlogged
ComponentUE - Editor - Workflow Systems
Affects Versions5.3
CreatedDec 22, 2023
UpdatedJan 20, 2024