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 #3306 from pypeclub/bugfix/OP-3362_Nuke-Farm-Publi…
Browse files Browse the repository at this point in the history
…sh-WITHOUT-Review-not-working

Nuke: fixing farm publishing if review is disabled
  • Loading branch information
jakubjezek001 authored Jun 15, 2022
2 parents 1f4709a + a7f2587 commit a0a7960
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class NukeRenderLocal(openpype.api.Extractor):
# TODO: rewrite docstring to nuke
"""Render the current Fusion composition locally.
"""Render the current Nuke composition locally.
Extract the result of savers by starting a comp render
This will run the local render of Fusion.
Expand Down
8 changes: 2 additions & 6 deletions openpype/hosts/nuke/plugins/publish/precollect_instances.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,11 @@ def process(self, context):
"resolutionWidth": resolution_width,
"resolutionHeight": resolution_height,
"pixelAspect": pixel_aspect,
"review": review
"review": review,
"representations": []

})
self.log.info("collected instance: {}".format(instance.data))
instances.append(instance)

# create instances in context data if not are created yet
if not context.data.get("instances"):
context.data["instances"] = list()

context.data["instances"].extend(instances)
self.log.debug("context: {}".format(context))
28 changes: 10 additions & 18 deletions openpype/hosts/nuke/plugins/publish/precollect_workfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class CollectWorkfile(pyblish.api.ContextPlugin):
label = "Pre-collect Workfile"
hosts = ['nuke']

def process(self, context):
def process(self, context): # sourcery skip: avoid-builtin-shadow
root = nuke.root()

current_file = os.path.normpath(nuke.root().name())
Expand Down Expand Up @@ -74,6 +74,14 @@ def process(self, context):
}
context.data.update(script_data)

# creating representation
representation = {
'name': 'nk',
'ext': 'nk',
'files': base_name,
"stagingDir": staging_dir,
}

# creating instance data
instance.data.update({
"subset": subset,
Expand All @@ -82,26 +90,10 @@ def process(self, context):
"publish": root.knob('publish').value(),
"family": family,
"families": [family],
"representations": list()
"representations": [representation]
})

# adding basic script data
instance.data.update(script_data)

# creating representation
representation = {
'name': 'nk',
'ext': 'nk',
'files': base_name,
"stagingDir": staging_dir,
}

instance.data["representations"].append(representation)

self.log.info('Publishing script version')

# create instances in context data if not are created yet
if not context.data.get("instances"):
context.data["instances"] = list()

context.data["instances"].append(instance)
5 changes: 5 additions & 0 deletions openpype/hosts/nuke/plugins/publish/precollect_writes.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ def process(self, instance):
"frameEndHandle": last_frame,
})

# make sure rendered sequence on farm will
# be used for exctract review
if not instance.data["review"]:
instance.data["useSequenceForReview"] = False

# * Add audio to instance if exists.
# Find latest versions document
version_doc = pype.get_latest_version(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,10 @@ def _get_representations(self, instance, exp_files):

def _solve_families(self, instance, preview=False):
families = instance.get("families")

# test also instance data review attribute
preview = preview or instance.get("review")

# if we have one representation with preview tag
# flag whole instance for review and for ftrack
if preview:
Expand Down Expand Up @@ -750,6 +754,10 @@ def process(self, instance):
"family": "prerender",
"families": []})

# also include review attribute if available
if "review" in data:
instance_skeleton_data["review"] = data["review"]

# skip locking version if we are creating v01
instance_version = instance.data.get("version") # take this if exists
if instance_version != 1:
Expand Down
3 changes: 0 additions & 3 deletions openpype/settings/defaults/project_settings/deadline.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@
"maya": [
".*([Bb]eauty).*"
],
"nuke": [
".*"
],
"aftereffects": [
".*"
],
Expand Down

0 comments on commit a0a7960

Please sign in to comment.