Merge branch 'develop' into feature/PYPE-653_master_version

This commit is contained in:
iLLiCiTiT 2020-02-24 16:43:28 +01:00
commit c4d766b60b
7 changed files with 203 additions and 20 deletions

View file

@ -19,6 +19,7 @@ class CollectAvalonEntities(pyblish.api.ContextPlugin):
label = "Collect Avalon Entities"
def process(self, context):
io.install()
project_name = api.Session["AVALON_PROJECT"]
asset_name = api.Session["AVALON_ASSET"]

View file

@ -256,10 +256,16 @@ class CollectRenderedFrames(pyblish.api.ContextPlugin):
)
ext = collection.tail.lstrip(".")
detected_start = min(collection.indexes)
detected_end = max(collection.indexes)
representation = {
"name": ext,
"ext": "{}".format(ext),
"files": list(collection),
"frameStart": frame_start,
"detectedStart": detected_start,
"detectedEnd": detected_end,
"stagingDir": root,
"anatomy_template": "render",
"fps": fps,
@ -323,12 +329,17 @@ class CollectRenderedFrames(pyblish.api.ContextPlugin):
if "slate" in instance.data["families"]:
frame_start += 1
detected_start = min(collection.indexes)
detected_end = max(collection.indexes)
representation = {
"name": ext,
"ext": "{}".format(ext),
"files": list(collection),
"frameStart": frame_start,
"frameEnd": frame_end,
"detectedStart": detected_start,
"detectedEnd": detected_end,
"stagingDir": root,
"anatomy_template": "render",
"fps": fps,
@ -394,6 +405,9 @@ class CollectRenderedFrames(pyblish.api.ContextPlugin):
if "review" not in families:
families.append("review")
detected_start = min(collection.indexes)
detected_end = max(collection.indexes)
instance.data.update(
{
"name": str(collection),
@ -428,6 +442,8 @@ class CollectRenderedFrames(pyblish.api.ContextPlugin):
"files": list(collection),
"frameStart": start,
"frameEnd": end,
"detectedStart": detected_start,
"detectedEnd": detected_end,
"stagingDir": root,
"anatomy_template": "render",
"fps": fps,

View file

@ -149,6 +149,9 @@ class ExtractReview(pyblish.api.InstancePlugin):
# necessary input data
# adds start arg only if image sequence
if isinstance(repre["files"], list):
if start_frame != repre.get("detectedStart", start_frame):
start_frame = repre.get("detectedStart")
input_args.append(
"-start_number {0} -framerate {1}".format(
start_frame, fps))

View file

@ -111,15 +111,16 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin):
project_entity = instance.data["projectEntity"]
context_asset_name = context.data["assetEntity"]["name"]
asset_name = instance.data["asset"]
asset_entity = instance.data.get("assetEntity")
if not asset_entity:
if not asset_entity or asset_entity["name"] != context_asset_name:
asset_entity = io.find_one({
"type": "asset",
"name": asset_name,
"parent": project_entity["_id"]
})
assert asset_entity, (
"No asset found by the name \"{0}\" in project \"{1}\""
).format(asset_name, project_entity["name"])