PerceivingSystems / bedlam_render

BEDLAM (CVPR 2023) render pipeline tools
https://bedlam.is.tuebingen.mpg.de/
Other
131 stars 6 forks source link

‘AttributeError’ in ‘create_level_sequences_csv.py’ when accessing ‘MovieScene3DTransformSection’ #15

Closed niuzehai closed 10 months ago

niuzehai commented 10 months ago

Hello,

I'm reaching out for assistance with an issue I encountered while running the create_level_sequences_csv.py script in Unreal Engine 5.3.

Issue Description: When attempting to generate level sequences, the script fails and throws an AttributeError related to MovieScene3DTransformSection not having the get_channels() method. The exact error message is as follows:

LogPython: ============================================================

LogPython: Running: D:/UE_5.3/Engine/Content/PS/Bedlam/Core/Python/create_level_sequences_csv.py LogPython: Generating level sequence: seq_000000, frames=138, hdri=None, camera_hfov=65.470451 LogPackageName: Warning: TryConvertFilenameToLongPackageName was passed an ObjectPath (/Engine/PS/Bedlam/SMPLX/rp_christine_posed_027/rp_christine_posed_027_1020.rp_christine_posed_027_1020) rather than a PackageName or FilePath; it will be converted to the PackageName. Accepting ObjectPaths is deprecated behavior and will be removed in a future release; TryConvertFilenameToLongPackageName will fail on ObjectPaths. LogPython: Processing body: GeometryCache'/Engine/PS/Bedlam/SMPLX/rp_christine_posed_027/rp_christine_posed_027_1020.rp_christine_posed_027_1020' LogPackageName: Warning: TryConvertFilenameToLongPackageName was passed an ObjectPath (/Engine/PS/Bedlam/Clothing/rp_christine_posed_027/rp_christine_posed_027_1020_clo.rp_christine_posed_027_1020_clo) rather than a PackageName or FilePath; it will be converted to the PackageName. Accepting ObjectPaths is deprecated behavior and will be removed in a future release; TryConvertFilenameToLongPackageName will fail on ObjectPaths. LogPython: Clothing: GeometryCache'/Engine/PS/Bedlam/Clothing/rp_christine_posed_027/rp_christine_posed_027_1020_clo.rp_christine_posed_027_1020_clo' LogPackageName: Warning: TryConvertFilenameToLongPackageName was passed an ObjectPath (/Engine/PS/Bedlam/SMPLX/rp_alexandra_posed_006/rp_alexandra_posed_006_1076.rp_alexandra_posed_006_1076) rather than a PackageName or FilePath; it will be converted to the PackageName. Accepting ObjectPaths is deprecated behavior and will be removed in a future release; TryConvertFilenameToLongPackageName will fail on ObjectPaths. LogPython: Processing body: GeometryCache'/Engine/PS/Bedlam/SMPLX/rp_alexandra_posed_006/rp_alexandra_posed_006_1076.rp_alexandra_posed_006_1076' LogPackageName: Warning: TryConvertFilenameToLongPackageName was passed an ObjectPath (/Engine/PS/Bedlam/Clothing/rp_alexandra_posed_006/rp_alexandra_posed_006_1076_clo.rp_alexandra_posed_006_1076_clo) rather than a PackageName or FilePath; it will be converted to the PackageName. Accepting ObjectPaths is deprecated behavior and will be removed in a future release; TryConvertFilenameToLongPackageName will fail on ObjectPaths. LogPython: Clothing: GeometryCache'/Engine/PS/Bedlam/Clothing/rp_alexandra_posed_006/rp_alexandra_posed_006_1076_clo.rp_alexandra_posed_006_1076_clo' LogPackageName: Warning: TryConvertFilenameToLongPackageName was passed an ObjectPath (/Engine/PS/Bedlam/SMPLX/rp_carla_posed_026/rp_carla_posed_026_1022.rp_carla_posed_026_1022) rather than a PackageName or FilePath; it will be converted to the PackageName. Accepting ObjectPaths is deprecated behavior and will be removed in a future release; TryConvertFilenameToLongPackageName will fail on ObjectPaths. LogPython: Processing body: GeometryCache'/Engine/PS/Bedlam/SMPLX/rp_carla_posed_026/rp_carla_posed_026_1022.rp_carla_posed_026_1022' LogPackageName: Warning: TryConvertFilenameToLongPackageName was passed an ObjectPath (/Engine/PS/Bedlam/Clothing/rp_carla_posed_026/rp_carla_posed_026_1022_clo.rp_carla_posed_026_1022_clo) rather than a PackageName or FilePath; it will be converted to the PackageName. Accepting ObjectPaths is deprecated behavior and will be removed in a future release; TryConvertFilenameToLongPackageName will fail on ObjectPaths. LogPython: Clothing: GeometryCache'/Engine/PS/Bedlam/Clothing/rp_carla_posed_026/rp_carla_posed_026_1022_clo.rp_carla_posed_026_1022_clo' LogPackageName: Warning: TryConvertFilenameToLongPackageName was passed an ObjectPath (/Engine/PS/Bedlam/SMPLX/rp_caren_posed_008/rp_caren_posed_008_1047.rp_caren_posed_008_1047) rather than a PackageName or FilePath; it will be converted to the PackageName. Accepting ObjectPaths is deprecated behavior and will be removed in a future release; TryConvertFilenameToLongPackageName will fail on ObjectPaths. LogPython: Processing body: GeometryCache'/Engine/PS/Bedlam/SMPLX/rp_caren_posed_008/rp_caren_posed_008_1047.rp_caren_posed_008_1047' LogPackageName: Warning: TryConvertFilenameToLongPackageName was passed an ObjectPath (/Engine/PS/Bedlam/Clothing/rp_caren_posed_008/rp_caren_posed_008_1047_clo.rp_caren_posed_008_1047_clo) rather than a PackageName or FilePath; it will be converted to the PackageName. Accepting ObjectPaths is deprecated behavior and will be removed in a future release; TryConvertFilenameToLongPackageName will fail on ObjectPaths. LogPython: Clothing: GeometryCache'/Engine/PS/Bedlam/Clothing/rp_caren_posed_008/rp_caren_posed_008_1047_clo.rp_caren_posed_008_1047_clo' LogPackageName: Warning: TryConvertFilenameToLongPackageName was passed an ObjectPath (/Engine/PS/Bedlam/SMPLX/rp_ben_posed_008/rp_ben_posed_008_1084.rp_ben_posed_008_1084) rather than a PackageName or FilePath; it will be converted to the PackageName. Accepting ObjectPaths is deprecated behavior and will be removed in a future release; TryConvertFilenameToLongPackageName will fail on ObjectPaths. LogPython: Processing body: GeometryCache'/Engine/PS/Bedlam/SMPLX/rp_ben_posed_008/rp_ben_posed_008_1084.rp_ben_posed_008_1084' LogPackageName: Warning: TryConvertFilenameToLongPackageName was passed an ObjectPath (/Engine/PS/Bedlam/Clothing/rp_ben_posed_008/rp_ben_posed_008_1084_clo.rp_ben_posed_008_1084_clo) rather than a PackageName or FilePath; it will be converted to the PackageName. Accepting ObjectPaths is deprecated behavior and will be removed in a future release; TryConvertFilenameToLongPackageName will fail on ObjectPaths. LogPython: Clothing: GeometryCache'/Engine/PS/Bedlam/Clothing/rp_ben_posed_008/rp_ben_posed_008_1084_clo.rp_ben_posed_008_1084_clo' LogPython: Deleting existing old LevelSequence: /Game/Bedlam/LevelSequences/seq_000000 LogUObjectGlobals: Force Deleting 1 Package(s): Asset Name: /Game/Bedlam/LevelSequences/seq_000000.seq_000000 Asset Type: LevelSequence LogUObjectHash: Compacting FUObjectHashTables data took 0.31ms LogUObjectHash: Compacting FUObjectHashTables data took 0.33ms LogUObjectHash: Compacting FUObjectHashTables data took 0.22ms LogPython: Error: Traceback (most recent call last): LogPython: Error: File "D:/UE_5.3/Engine/Content/PS/Bedlam/Core/Python/create_level_sequences_csv.py", line 713, in LogPython: Error: success = add_level_sequence(sequence_name, camera_actor, camera_pose, ground_truth_logger_actor, sequence_bodies, sequence_frames, hdri_name, camera_hfov, camera_movement, cameraroot_yaw, cameraroot_location) LogPython: Error: File "D:/UE_5.3/Engine/Content/PS/Bedlam/Core/Python/create_level_sequences_csv.py", line 359, in add_level_sequence LogPython: Error: camera_cut_section = add_static_camera(level_sequence, camera_actor, camera_pose, camera_hfov) LogPython: Error: File "D:/UE_5.3/Engine/Content/PS/Bedlam/Core/Python/create_level_sequences_csv.py", line 254, in add_static_camera LogPython: Error: add_transform_track(camera_binding, camera_pose) LogPython: Error: File "D:/UE_5.3/Engine/Content/PS/Bedlam/Core/Python/create_level_sequences_csv.py", line 232, in add_transform_track LogPython: Error: transform_channels = transform_section.get_channels() LogPython: Error: AttributeError: 'MovieScene3DTransformSection' object has no attribute 'get_channels'

This error occurs during the creation of a static camera in the sequence.

Steps to Reproduce:

  1. Execute the create_level_sequences_csv.py script in Unreal Engine 5.3.
  2. Script attempts to call get_channels() on a MovieScene3DTransformSection object.
  3. Error is thrown indicating the lack of the get_channels() method.

Expected Behavior: The script should successfully add transform tracks to the camera without throwing an error.

Actual Behavior: The script fails due to an AttributeError.

Possible Solution: I suspect that there might be a change in the Unreal Engine API from previous versions to 5.3 that removed or replaced the get_channels() method. It would be helpful if you could suggest an alternative approach or update the script to be compatible with Unreal Engine 5.3.

Environment:

I appreciate any help or guidance you can provide.

tpsmpi commented 10 months ago

Replacing get_channels() with get_all_channels() might resolve your issue with 5.3. We are only providing active support for the Unreal Engine version used for the publication and stated in the requirements for this project (5.0). If you want to use later Unreal versions you need to adopt the code to potential Unreal Python API changes or Editor behavior. For Unreal Python API questions we recommend to use the official Epic Developer Community and API docs.

niuzehai commented 10 months ago

Dear tpsmpi,

I would like to express my sincere gratitude for your prompt and helpful response to the issue I encountered with the create_level_sequences_csv.py script.

Your suggestion to replace get_channels() with get_all_channels() worked perfectly and resolved the compatibility issue with Unreal Engine 5.3. I understand now that the active support is for the specific Unreal Engine version stated in the project's requirements, and I appreciate the clarity on this matter.

I also acknowledge your advice to adapt the code to accommodate any changes in Unreal's Python API and Editor behavior when working with different versions. Moving forward, I will certainly make use of the official Epic Developer Community and API documentation for any further Unreal Python API inquiries.

Thank you once again for your support and for the valuable work you've shared with the community.