Merge branch 'hotfix/PYPE-776-client-custom-work' into develop

This commit is contained in:
Milan Kolar 2020-03-26 18:43:40 +01:00
commit c382fc4742
4 changed files with 31 additions and 34 deletions

View file

@ -1135,7 +1135,7 @@ class BuildWorkfile(WorkfileSettings):
regex_filter=None,
version=None,
representations=["exr", "dpx", "lutJson", "mov",
"preview", "png"]):
"preview", "png", "jpeg", "jpg"]):
"""
A short description.

View file

@ -74,17 +74,14 @@ class ValidateScript(pyblish.api.InstancePlugin):
if "handleEnd" in asset_attributes:
handle_end = asset_attributes["handleEnd"]
# Set frame range with handles
# asset_attributes["frameStart"] -= handle_start
# asset_attributes["frameEnd"] += handle_end
if len(str(asset_attributes["fps"])) > 4:
asset_attributes["fps"] = float("{0:.8f}".format(asset_attributes["fps"]))
asset_attributes["fps"] = float("{0:.4f}".format(
asset_attributes["fps"]))
# Get values from nukescript
script_attributes = {
"handleStart": ctx_data["handleStart"],
"handleEnd": ctx_data["handleEnd"],
"fps": ctx_data["fps"],
"fps": float("{0:.4f}".format(ctx_data["fps"])),
"frameStart": ctx_data["frameStart"],
"frameEnd": ctx_data["frameEnd"],
"resolutionWidth": ctx_data["resolutionWidth"],

View file

@ -47,6 +47,16 @@ class CollectClips(api.ContextPlugin):
track = item.parent()
source = item.source().mediaSource()
source_path = source.firstpath()
file_head = source.filenameHead()
file_info = next((f for f in source.fileinfos()), None)
source_first_frame = file_info.startFrame()
is_sequence = False
if not source.singleFile():
self.log.info("Single file")
is_sequence = True
source_path = file_info.filename()
effects = [f for f in item.linkedItems()
if f.isEnabled()
if isinstance(f, hiero.core.EffectTrackItem)]
@ -78,12 +88,6 @@ class CollectClips(api.ContextPlugin):
)
)
try:
head, padding, ext = os.path.basename(source_path).split(".")
source_first_frame = int(padding)
except Exception:
source_first_frame = 0
data.update({
"name": "{0}_{1}".format(track.name(), item.name()),
"item": item,
@ -91,6 +95,8 @@ class CollectClips(api.ContextPlugin):
"timecodeStart": str(source.timecodeStart()),
"timelineTimecodeStart": str(sequence.timecodeStart()),
"sourcePath": source_path,
"sourceFileHead": file_head,
"isSequence": is_sequence,
"track": track.name(),
"trackIndex": track_index,
"sourceFirst": source_first_frame,
@ -101,8 +107,9 @@ class CollectClips(api.ContextPlugin):
int(item.sourceIn())) + 1,
"clipIn": int(item.timelineIn()),
"clipOut": int(item.timelineOut()),
"clipDuration": (int(item.timelineOut()) -
int(item.timelineIn())) + 1,
"clipDuration": (
int(item.timelineOut()) - int(
item.timelineIn())) + 1,
"asset": asset,
"family": "clip",
"families": [],

View file

@ -147,22 +147,15 @@ class CollectPlatesData(api.InstancePlugin):
"version": version
})
source_first_frame = instance.data.get("sourceFirst")
source_file_head = instance.data.get("sourceFileHead")
try:
basename, ext = os.path.splitext(source_file)
head, padding = os.path.splitext(basename)
ext = ext[1:]
padding = padding[1:]
self.log.debug("_ padding: `{}`".format(padding))
# head, padding, ext = source_file.split('.')
source_first_frame = int(padding)
padding = len(padding)
file = "{head}.%0{padding}d.{ext}".format(
head=head,
padding=padding,
ext=ext
)
if instance.data.get("isSequence", False):
self.log.info("Is sequence of files")
file = os.path.basename(source_file)
ext = os.path.splitext(file)[-1][1:]
self.log.debug("source_file_head: `{}`".format(source_file_head))
head = source_file_head[:-1]
start_frame = int(source_first_frame + instance.data["sourceInH"])
duration = int(
instance.data["sourceOutH"] - instance.data["sourceInH"])
@ -170,10 +163,10 @@ class CollectPlatesData(api.InstancePlugin):
self.log.debug("start_frame: `{}`".format(start_frame))
self.log.debug("end_frame: `{}`".format(end_frame))
files = [file % i for i in range(start_frame, (end_frame + 1), 1)]
except Exception as e:
self.log.warning("Exception in file: {}".format(e))
head, ext = os.path.splitext(source_file)
ext = ext[1:]
else:
self.log.info("Is single file")
ext = os.path.splitext(source_file)[-1][1:]
head = source_file_head
files = source_file
start_frame = instance.data["sourceInH"]
end_frame = instance.data["sourceOutH"]