Skip to content

Commit

Permalink
Merge pull request #44 from ynput/bugfix/AY-7250_minor_creator_bugfixes
Browse files Browse the repository at this point in the history
AY-7250 Fix plugins settings and OTIO export for shot creator.
  • Loading branch information
robin-ynput authored Jan 8, 2025
2 parents 02e9825 + 2dc9db0 commit 8815ed8
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 16 deletions.
11 changes: 8 additions & 3 deletions client/ayon_flame/api/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -824,9 +824,14 @@ def __init__(self, path, logger=None):
self.log.debug("drop frame: {}".format(self.drop_mode))
# get all resolution related data and assign them
self._get_resolution_info_from_origin(xml_data)
self.log.debug("width: {}".format(self.width))
self.log.debug("height: {}".format(self.height))
self.log.debug("pixel aspect: {}".format(self.pixel_aspect))

try:
self.log.debug("width: {}".format(self.width))
self.log.debug("height: {}".format(self.height))
self.log.debug("pixel aspect: {}".format(self.pixel_aspect))

except AttributeError:
self.log.debug("audio: true")

self.clip_data = xml_data

Expand Down
20 changes: 13 additions & 7 deletions client/ayon_flame/otio/flame_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,13 +208,19 @@ def create_otio_markers(otio_item, item):
def create_otio_reference(clip_data, media_info, fps=None):
metadata = _get_metadata(clip_data)

metadata.update(
{
"ayon.source.width": media_info.width,
"ayon.source.height": media_info.height,
"ayon.source.pixelAspect": media_info.pixel_aspect,
}
)
# Add image-based metadata if not a pure audio media
# TODO: what happens if media is image-based but not width
# can be reached ?
# (could use ayon_core.lib.transcoding.get_otio_info_for_input)
if hasattr(media_info, "width"):
metadata.update(
{
"ayon.source.width": media_info.width,
"ayon.source.height": media_info.height,
"ayon.source.pixelAspect": media_info.pixel_aspect,
}
)

duration = int(clip_data["source_duration"])

# get file info for path and start frame
Expand Down
17 changes: 11 additions & 6 deletions client/ayon_flame/plugins/create/create_shot_clip.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ def update_instances(self, update_list):
segment_item = created_inst.transient_data["segment_item"]
marker_data = ayfapi.get_segment_data_marker(segment_item)

# Backwards compatible (Deprecated since 24/09/05)
# ignore instance if no existing marker data
if marker_data is None:
continue

try:
instances_data = marker_data[_CONTENT_ID]

Expand Down Expand Up @@ -387,7 +392,7 @@ def header_label(text):
"segmentIndex",
label="Segment Index",
tooltip="Take number from segment index",
default=True,
default=presets.get("segmentIndex", True),
),
NumberDef(
"countFrom",
Expand Down Expand Up @@ -490,13 +495,13 @@ def header_label(text):
"export_audio",
label="Include audio",
tooltip="Process subsets with corresponding audio",
default=False,
default=presets.get("export_audio", False),
),
BoolDef(
"sourceResolution",
label="Source resolution",
tooltip="Is resolution taken from timeline or source?",
default=False,
default=presets.get("sourceResolution", False),
),

# shotAttr
Expand Down Expand Up @@ -525,19 +530,19 @@ def header_label(text):
"includeHandles",
label="Include handles",
tooltip="Should the handles be included?",
default=False,
default=presets.get("includeHandles", True),
),
BoolDef(
"retimedHandles",
label="Retimed handles",
tooltip="Should the handles be retimed?",
default=True,
default=presets.get("retimedHandles", True),
),
BoolDef(
"retimedFramerange",
label="Retimed framerange",
tooltip="Should the framerange be retimed?",
default=True,
default=presets.get("retimedFramerange", True),
),
]

Expand Down
10 changes: 10 additions & 0 deletions server/settings/create_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ class CreateShotClipModel(BaseSettingsModel):
section="Vertical Synchronization Of Attributes"
)

export_audio: bool = SettingsField(
False,
title="Include audio",
)

sourceResolution: bool = SettingsField(
False,
title="Source resolution",
)

workfileFrameStart: int = SettingsField(
1001,
title="Workfiles Start Frame",
Expand Down

0 comments on commit 8815ed8

Please sign in to comment.