Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nuke: Publish intermediate files on demand #501

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions client/ayon_core/hosts/nuke/api/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ def save_file(self):
self.log.info("Nodes exported...")
return path

def generate_mov(self, farm=False, **kwargs):
def generate_mov(self, farm=False, delete=True, **kwargs):
# colorspace data
colorspace = None
# get colorspace settings
Expand Down Expand Up @@ -990,8 +990,13 @@ def generate_mov(self, farm=False, **kwargs):
self.render(write_node.name())

# ---------- generate representation data
tags = ["review", "need_thumbnail"]

if delete:
tags.append("delete")

self.get_representation_data(
tags=["review", "need_thumbnail", "delete"] + add_tags,
tags=tags + add_tags,
custom_tags=add_custom_tags,
range=True,
colorspace=colorspace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,16 @@ def process(self, instance):
self, instance, o_name, o_data["extension"],
multiple_presets)

o_data["add_custom_tags"].append("intermediate")
delete = not o_data.get("publish", False)

if instance.data.get("farm"):
if "review" in instance.data["families"]:
instance.data["families"].remove("review")

data = exporter.generate_mov(farm=True, **o_data)
data = exporter.generate_mov(
farm=True, delete=delete, **o_data
)

self.log.debug(
"_ data: {}".format(data))
Expand All @@ -154,7 +159,7 @@ def process(self, instance):
"bakeWriteNodeName": data.get("bakeWriteNodeName")
})
else:
data = exporter.generate_mov(**o_data)
data = exporter.generate_mov(delete=delete, **o_data)

# add representation generated by exporter
generated_repres.extend(data["representations"])
Expand Down
2 changes: 1 addition & 1 deletion server_addon/nuke/package.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
name = "nuke"
title = "Nuke"
version = "0.1.11"
version = "0.1.12"
3 changes: 3 additions & 0 deletions server_addon/nuke/server/settings/publish_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ class ReformatNodesConfigModel(BaseSettingsModel):

class IntermediateOutputModel(BaseSettingsModel):
name: str = SettingsField(title="Output name")
publish: bool = SettingsField(title="Publish")
filter: BakingStreamFilterModel = SettingsField(
title="Filter", default_factory=BakingStreamFilterModel)
read_raw: bool = SettingsField(
Expand Down Expand Up @@ -346,6 +347,7 @@ class PublishPluginsModel(BaseSettingsModel):
"outputs": [
{
"name": "baking",
"publish": False,
"filter": {
"task_types": [],
"product_types": [],
Expand Down Expand Up @@ -401,6 +403,7 @@ class PublishPluginsModel(BaseSettingsModel):
"outputs": [
{
"name": "baking",
"publish": False,
"filter": {
"task_types": [],
"product_types": [],
Expand Down