AcademySoftwareFoundation / AcademySoftwareFoundation/OpenTimelineIO

opentimelineio_contrib\ adapters\ fcpx_xml.py line 304

Open
#1,633 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
2k
Forks
351
Avg merge
1d 12h
Merged PRs (30d)
1

Description

`File "/home/geektr/prod/gitruck-python/workspaces/short_video_generator/backend/services/otio/otio_services.py", line 718, in timeline_loader
fcp_xml_str, fcpx_xml_str, otio_json_str = struct_builder(
File "/home/geektr/prod/gitruck-python/workspaces/short_video_generator/backend/services/otio/otio_services.py", line 499, in struct_builder
fcpx_xml_str = otio.adapters.write_to_string(
File "/home/geektr/miniconda3/envs/gitruck_prod/lib/python3.10/site-packages/opentimelineio/adapters/__init__.py", line 213, in write_to_string
return adapter.write_to_string(
File "/home/geektr/miniconda3/envs/gitruck_prod/lib/python3.10/site-packages/opentimelineio/adapters/adapter.py", line 283, in write_to_string
return self._execute_function(
File "/home/geektr/miniconda3/envs/gitruck_prod/lib/python3.10/site-packages/opentimelineio/plugins/python_plugin.py", line 153, in _execute_function
return (getattr(self.module(), func_name)(**kwargs))
File "/home/geektr/miniconda3/envs/gitruck_prod/lib/python3.10/site-packages/opentimelineio_contrib/adapters/fcpx_xml.py", line 1161, in write_to_string
return FcpxOtio(input_otio).to_xml()
File "/home/geektr/miniconda3/envs/gitruck_prod/lib/python3.10/site-packages/opentimelineio_contrib/adapters/fcpx_xml.py", line 172, in to_xml
top_sequence = self._stack_to_sequence(project.tracks)
File "/home/geektr/miniconda3/envs/gitruck_prod/lib/python3.10/site-packages/opentimelineio_contrib/adapters/fcpx_xml.py", line 248, in _stack_to_sequence
self._track_for_spine(track, lane_id, spine, compound_clip)
File "/home/geektr/miniconda3/envs/gitruck_prod/lib/python3.10/site-packages/opentimelineio_contrib/adapters/fcpx_xml.py", line 271, in _track_for_spine
offset = self._offset_based_on_parent(
File "/home/geektr/miniconda3/envs/gitruck_prod/lib/python3.10/site-packages/opentimelineio_contrib/adapters/fcpx_xml.py", line 309, in _offset_based_on_parent
parent.get("offset"),
AttributeError: 'NoneType' object has no attribute 'get'`

The key problem is here: opentimelineio_contrib\ adapters\ fcpx_xml.py line 304, [if total_time > trimmed_range: return item] trimmed_range how to calculate and not tell the developer in the document, simple and rude to return a None, how do you let the program go down Execute? Shoot yourself in the foot.

Contributor guide

Open the contributing guide

Research direction

Start with opentimelineio_contrib/adapters/fcpx_xml.py, especially _offset_based_on_parent around line 304, then trace its caller _track_for_spine and the write_to_string stack shown in the report. Determine how trimmed_range and the parent value are expected to behave; done means the reported timeline conversion no longer raises AttributeError and the behavior is documented or covered by an appropriate existing test.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.