-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/AY-5566_Add-statuses-to-loader
- Loading branch information
Showing
12 changed files
with
258 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
client/ayon_core/hosts/nuke/plugins/publish/collect_headless_farm.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import pyblish.api | ||
|
||
from ayon_core.pipeline.publish import ( | ||
AYONPyblishPluginMixin | ||
) | ||
|
||
|
||
class CollectRenderOnFarm(pyblish.api.ContextPlugin): | ||
"""Setup instances for render on farm submission.""" | ||
|
||
# Needs to be after CollectFromCreateContext | ||
order = pyblish.api.CollectorOrder - 0.49 | ||
label = "Collect Render On Farm" | ||
hosts = ["nuke"] | ||
|
||
def process(self, context): | ||
if not context.data.get("render_on_farm", False): | ||
return | ||
|
||
for instance in context: | ||
if instance.data["family"] == "workfile": | ||
instance.data["active"] = False | ||
continue | ||
|
||
# Filter out all other instances. | ||
node = instance.data["transientData"]["node"] | ||
if node.name() != instance.context.data["node_name"]: | ||
instance.data["active"] = False | ||
continue | ||
|
||
instance.data["families"].append("render_on_farm") | ||
|
||
# Enable for farm publishing. | ||
instance.data["farm"] = True | ||
|
||
# Skip workfile version incremental save. | ||
instance.context.data["increment_script_version"] = False | ||
|
||
|
||
class SetupRenderOnFarm(pyblish.api.InstancePlugin, AYONPyblishPluginMixin): | ||
"""Setup instance for render on farm submission.""" | ||
|
||
order = pyblish.api.CollectorOrder + 0.4999 | ||
label = "Setup Render On Farm" | ||
hosts = ["nuke"] | ||
families = ["render_on_farm"] | ||
|
||
def process(self, instance): | ||
# Clear the families as we only want the main family, ei. no review | ||
# etc. | ||
instance.data["families"] = ["render_on_farm"] | ||
|
||
# Use the workfile instead of published. | ||
publish_attributes = instance.data["publish_attributes"] | ||
plugin_attributes = publish_attributes["NukeSubmitDeadline"] | ||
plugin_attributes["use_published_workfile"] = False |
36 changes: 36 additions & 0 deletions
36
client/ayon_core/hosts/nuke/plugins/publish/extract_headless_farm.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import os | ||
from datetime import datetime | ||
import shutil | ||
|
||
import pyblish.api | ||
|
||
from ayon_core.pipeline import registered_host | ||
|
||
|
||
class ExtractRenderOnFarm(pyblish.api.InstancePlugin): | ||
"""Copy the workfile to a timestamped copy.""" | ||
|
||
order = pyblish.api.ExtractorOrder + 0.499 | ||
label = "Extract Render On Farm" | ||
hosts = ["nuke"] | ||
families = ["render_on_farm"] | ||
|
||
def process(self, instance): | ||
if not instance.context.data.get("render_on_farm", False): | ||
return | ||
|
||
host = registered_host() | ||
current_datetime = datetime.now() | ||
formatted_timestamp = current_datetime.strftime("%Y%m%d%H%M%S") | ||
base, ext = os.path.splitext(host.current_file()) | ||
|
||
directory = os.path.join(os.path.dirname(base), "farm_submissions") | ||
if not os.path.exists(directory): | ||
os.makedirs(directory) | ||
|
||
filename = "{}_{}{}".format( | ||
os.path.basename(base), formatted_timestamp, ext | ||
) | ||
path = os.path.join(directory, filename).replace("\\", "/") | ||
instance.context.data["currentFile"] = path | ||
shutil.copy(host.current_file(), path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
name = "nuke" | ||
title = "Nuke" | ||
version = "0.1.13" | ||
version = "0.1.14" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters