mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
flame: improving code from suggestion
This commit is contained in:
parent
c025d4c8e4
commit
384edda56f
1 changed files with 6 additions and 6 deletions
|
|
@ -545,16 +545,16 @@ def get_segment_attributes(segment):
|
|||
"source_duration", "source_in", "source_out"
|
||||
]
|
||||
segment_attrs_data = {}
|
||||
for attr in segment_attrs:
|
||||
if not hasattr(segment, attr):
|
||||
for attr_name in segment_attrs:
|
||||
if not hasattr(segment, attr_name):
|
||||
continue
|
||||
_value = getattr(segment, attr)
|
||||
segment_attrs_data[attr] = str(_value).replace("+", ":")
|
||||
attr = getattr(segment, attr_name)
|
||||
segment_attrs_data[attr] = str(attr).replace("+", ":")
|
||||
|
||||
if attr in ["record_in", "record_out"]:
|
||||
clip_data[attr] = _value.relative_frame
|
||||
clip_data[attr_name] = attr.relative_frame
|
||||
else:
|
||||
clip_data[attr] = _value.frame
|
||||
clip_data[attr_name] = attr.frame
|
||||
|
||||
clip_data["segment_timecodes"] = segment_attrs_data
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue