Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #3610 from pypeclub/bugfix/OP-3684_Refactored-inte…
Browse files Browse the repository at this point in the history
…grate-doesnt-work-for-AE-multi-frame-publishes

AfterEffects: refactored integrate doesnt work formulti frame publishes
  • Loading branch information
kalisp authored Aug 3, 2022
2 parents e19f0ba + 53cf211 commit 23c927c
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 22 deletions.
5 changes: 3 additions & 2 deletions openpype/hosts/aftereffects/plugins/publish/collect_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ def get_instances(self, context):
attachTo=False,
setMembers='',
publish=True,
renderer='aerender',
name=subset_name,
resolutionWidth=render_q.width,
resolutionHeight=render_q.height,
Expand All @@ -113,7 +112,6 @@ def get_instances(self, context):
frameStart=frame_start,
frameEnd=frame_end,
frameStep=1,
toBeRenderedOn='deadline',
fps=fps,
app_version=app_version,
publish_attributes=inst.data.get("publish_attributes", {}),
Expand All @@ -138,6 +136,9 @@ def get_instances(self, context):
fam = "render.farm"
if fam not in instance.families:
instance.families.append(fam)
instance.toBeRenderedOn = "deadline"
instance.renderer = "aerender"
instance.farm = True # to skip integrate

instances.append(instance)
instances_to_remove.append(inst)
Expand Down
2 changes: 2 additions & 0 deletions openpype/pipeline/publish/abstract_collect_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ class RenderInstance(object):

family = attr.ib(default="renderlayer")
families = attr.ib(default=["renderlayer"]) # list of families
# True if should be rendered on farm, eg not integrate
farm = attr.ib(default=False)

# format settings
multipartExr = attr.ib(default=False) # flag for multipart exrs
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import logging

from tests.lib.assert_classes import DBAssert
from tests.integration.hosts.aftereffects.lib import AfterEffectsTestClass

log = logging.getLogger("test_publish_in_aftereffects")


class TestPublishInAfterEffects(AfterEffectsTestClass):
"""Basic test case for publishing in AfterEffects
Should publish 5 frames
"""
PERSIST = True

TEST_FILES = [
("12aSDRjthn4X3yw83gz_0FZJcRRiVDEYT",
"test_aftereffects_publish_multiframe.zip",
"")
]

APP = "aftereffects"
APP_VARIANT = ""

APP_NAME = "{}/{}".format(APP, APP_VARIANT)

TIMEOUT = 120 # publish timeout

def test_db_asserts(self, dbcon, publish_finished):
"""Host and input data dependent expected results in DB."""
print("test_db_asserts")
failures = []

failures.append(DBAssert.count_of_types(dbcon, "version", 2))

failures.append(
DBAssert.count_of_types(dbcon, "version", 0, name={"$ne": 1}))

failures.append(
DBAssert.count_of_types(dbcon, "subset", 1,
name="imageMainBackgroundcopy"))

failures.append(
DBAssert.count_of_types(dbcon, "subset", 1,
name="workfileTest_task"))

failures.append(
DBAssert.count_of_types(dbcon, "subset", 1,
name="reviewTesttask"))

failures.append(
DBAssert.count_of_types(dbcon, "representation", 4))

additional_args = {"context.subset": "renderTestTaskDefault",
"context.ext": "png"}
failures.append(
DBAssert.count_of_types(dbcon, "representation", 1,
additional_args=additional_args))

assert not any(failures)


if __name__ == "__main__":
test_case = TestPublishInAfterEffects()
32 changes: 12 additions & 20 deletions tests/lib/testing_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,30 +314,22 @@ def test_folder_structure_same(self, dbcon, publish_finished,
Compares only presence, not size nor content!
"""
published_dir_base = download_test_data
published_dir = os.path.join(output_folder_url,
self.PROJECT,
self.ASSET,
self.TASK,
"**")
expected_dir_base = os.path.join(published_dir_base,
published_dir_base = output_folder_url
expected_dir_base = os.path.join(download_test_data,
"expected")
expected_dir = os.path.join(expected_dir_base,
self.PROJECT,
self.ASSET,
self.TASK,
"**")
print("Comparing published:'{}' : expected:'{}'".format(published_dir,
expected_dir))

print("Comparing published:'{}' : expected:'{}'".format(
published_dir_base, expected_dir_base))
published = set(f.replace(published_dir_base, '') for f in
glob.glob(published_dir, recursive=True) if
f != published_dir_base and os.path.exists(f))
glob.glob(published_dir_base + "\\**", recursive=True)
if f != published_dir_base and os.path.exists(f))
expected = set(f.replace(expected_dir_base, '') for f in
glob.glob(expected_dir, recursive=True) if
f != expected_dir_base and os.path.exists(f))
glob.glob(expected_dir_base + "\\**", recursive=True)
if f != expected_dir_base and os.path.exists(f))

not_matched = expected.difference(published)
assert not not_matched, "Missing {} files".format(not_matched)
not_matched = expected.symmetric_difference(published)
assert not not_matched, "Missing {} files".format(
"\n".join(sorted(not_matched)))


class HostFixtures(PublishTest):
Expand Down

0 comments on commit 23c927c

Please sign in to comment.