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

Nuke: Multiple format supports for ExtractReviewDataMov #5623

Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
c03326f
Jakub's comment on the review plugin
moonyuet Sep 19, 2023
e0fba97
hound
moonyuet Sep 19, 2023
e61515d
Merge branch 'develop' into enhancement/OP-6451_Nuke---ExctractReview…
jakubjezek001 Sep 21, 2023
174ef45
jakub's comment on apply_settings and fix the bug of not being extrac…
moonyuet Sep 22, 2023
98065e0
Merge branch 'develop' into enhancement/OP-6451_Nuke---ExctractReview…
moonyuet Sep 22, 2023
dd2255f
jakub's comment
moonyuet Sep 22, 2023
84e914d
Merge branch 'develop' into enhancement/OP-6451_Nuke---ExctractReview…
moonyuet Sep 22, 2023
d744a48
edit the settings where deprecated_setting used when it enabled; curr…
moonyuet Sep 22, 2023
21d547a
introduce the function for checking the filename to see if it consist…
moonyuet Sep 24, 2023
6f858a8
hound
moonyuet Sep 24, 2023
cf56c4d
Merge branch 'develop' into enhancement/OP-6451_Nuke---ExctractReview…
moonyuet Sep 24, 2023
5f7f4f0
fix the slate in
moonyuet Sep 25, 2023
b749cbf
resolve conflict
moonyuet Sep 25, 2023
41e81ef
rename the function and the elaborate the docstring
moonyuet Sep 25, 2023
22ce181
make sure the deprecated setting used when it enabled while the curre…
moonyuet Sep 25, 2023
3da4bac
typo in lib
moonyuet Sep 25, 2023
8b76238
fixing get_head_filename_without_hashes not being able to get multipl…
moonyuet Sep 25, 2023
e2509a9
hound
moonyuet Sep 25, 2023
ed18c90
Merge branch 'develop' into enhancement/OP-6451_Nuke---ExctractReview…
moonyuet Sep 25, 2023
0c62e19
Merge branch 'develop' into enhancement/OP-6451_Nuke---ExctractReview…
moonyuet Sep 25, 2023
0595afe
add % check on the fhead in the lib.py
moonyuet Sep 25, 2023
65bfe02
transform the files with frame hashes to the list of filenames when p…
moonyuet Sep 25, 2023
9ffc657
Merge branches 'enhancement/OP-6451_Nuke---ExctractReviewDataMov-plug…
moonyuet Sep 26, 2023
6deb933
fix the typo of rstrip
moonyuet Sep 27, 2023
ebdcc49
implement more concise function for getting filenames with hashes
moonyuet Sep 27, 2023
abef01c
edit docstring
moonyuet Sep 27, 2023
e493886
improve docstring on lib.py and add comment on the condition of setti…
moonyuet Sep 27, 2023
973e480
make sure not using .replace
moonyuet Sep 27, 2023
356f05f
docstring tweaks
moonyuet Sep 28, 2023
6c1e066
Rename ExtractReviewDataBakingStreams to ExtractReviewIntermediate
moonyuet Sep 28, 2023
ef12a52
plural form for extract_review_intermediate
moonyuet Sep 28, 2023
f45552f
label tweak
moonyuet Sep 28, 2023
f57c1eb
edit docsting and rename BakingStreamModel as IntermediateOutputModel
moonyuet Sep 28, 2023
a6522b3
Merge branch 'develop' into enhancement/OP-6451_Nuke---ExctractReview…
moonyuet Sep 29, 2023
bc0f95d
Merge branch 'develop' into enhancement/OP-6451_Nuke---ExctractReview…
moonyuet Sep 29, 2023
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
12 changes: 11 additions & 1 deletion openpype/hosts/nuke/api/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
CreatedInstance,
get_current_task_name
)
from openpype.lib.transcoding import (
VIDEO_EXTENSIONS
jakubjezek001 marked this conversation as resolved.
Show resolved Hide resolved
)
from .lib import (
INSTANCE_DATA_KNOB,
Knobby,
Expand Down Expand Up @@ -801,6 +804,13 @@ def __init__(self,
self.log.info("File info was set...")

self.file = self.fhead + self.name + ".{}".format(self.ext)
if ".{}".format(self.ext) not in VIDEO_EXTENSIONS:
filename = os.path.basename(self.path_in)
self.file = filename
if ".{}".format(self.ext) not in self.file:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect that we're always expecting the file should END with the extension - right? So we should still change the extension if the extension .exr for the filename was originally hello.exr.0001.png.

This should've been:

if not self.file.endswith(".{}".format(ext)):
    # Swap the extension
    ...

wrg_ext = filename.split(".")[-1]
moonyuet marked this conversation as resolved.
Show resolved Hide resolved
self.file = filename.replace(wrg_ext, self.ext)

self.path = os.path.join(
self.staging_dir, self.file).replace("\\", "/")

Expand Down Expand Up @@ -921,7 +931,7 @@ def generate_mov(self, farm=False, **kwargs):
self.log.debug("Path: {}".format(self.path))
write_node["file"].setValue(str(self.path))
write_node["file_type"].setValue(str(self.ext))

self.log.debug("{0}".format(self.ext))
# Knobs `meta_codec` and `mov64_codec` are not available on centos.
# TODO shouldn't this come from settings on outputs?
try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
from openpype.hosts.nuke.api.lib import maintained_selection


class ExtractReviewDataMov(publish.Extractor):
class ExtractReviewDataBakingStreams(publish.Extractor):
"""Extracts movie and thumbnail with baked in luts
moonyuet marked this conversation as resolved.
Show resolved Hide resolved

must be run after extract_render_local.py

"""

order = pyblish.api.ExtractorOrder + 0.01
label = "Extract Review Data Mov"
label = "Extract Review Data Baking Streams"
moonyuet marked this conversation as resolved.
Show resolved Hide resolved

families = ["review"]
hosts = ["nuke"]
Expand All @@ -25,6 +25,34 @@ class ExtractReviewDataMov(publish.Extractor):
viewer_lut_raw = None
outputs = {}

@classmethod
def apply_settings(cls, project_settings):
"""just in case there are some old presets
moonyuet marked this conversation as resolved.
Show resolved Hide resolved
in deprecrated ExtractReviewDataMov Plugins
moonyuet marked this conversation as resolved.
Show resolved Hide resolved
"""
nuke_publish = project_settings["nuke"]["publish"]
deprecrated_review_settings = nuke_publish["ExtractReviewDataMov"]
current_review_settings = (
nuke_publish["ExtractReviewDataBakingStreams"]
)
if deprecrated_review_settings["viewer_lut_raw"] == (
current_review_settings["viewer_lut_raw"]
):
cls.viewer_lut_raw = (
current_review_settings["viewer_lut_raw"]
)
else:
cls.viewer_lut_raw = (
deprecrated_review_settings["viewer_lut_raw"]
)

if deprecrated_review_settings["outputs"] == (
current_review_settings["outputs"]
):
cls.outputs = current_review_settings["outputs"]
else:
cls.outputs = deprecrated_review_settings["outputs"]
moonyuet marked this conversation as resolved.
Show resolved Hide resolved

def process(self, instance):
families = set(instance.data["families"])

Expand Down
23 changes: 21 additions & 2 deletions openpype/settings/ayon_settings.py
moonyuet marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,20 @@ def _convert_nuke_project_settings(ayon_settings, output):
)

new_review_data_outputs = {}
for item in ayon_publish["ExtractReviewDataMov"]["outputs"]:
outputs_settings = None
# just in case that the users having old presets in outputs setting
moonyuet marked this conversation as resolved.
Show resolved Hide resolved
deprecrated_review_settings = ayon_publish["ExtractReviewDataMov"]
current_review_settings = (
ayon_publish["ExtractReviewDataBakingStreams"]
)
if deprecrated_review_settings["outputs"] == (
moonyuet marked this conversation as resolved.
Show resolved Hide resolved
current_review_settings["outputs"]
):
outputs_settings = current_review_settings["outputs"]
else:
outputs_settings = deprecrated_review_settings["outputs"]

for item in outputs_settings:
item_filter = item["filter"]
if "product_names" in item_filter:
item_filter["subsets"] = item_filter.pop("product_names")
Expand All @@ -767,7 +780,13 @@ def _convert_nuke_project_settings(ayon_settings, output):

name = item.pop("name")
new_review_data_outputs[name] = item
ayon_publish["ExtractReviewDataMov"]["outputs"] = new_review_data_outputs

if deprecrated_review_settings["outputs"] == (
current_review_settings["outputs"]
):
current_review_settings["outputs"] = new_review_data_outputs
moonyuet marked this conversation as resolved.
Show resolved Hide resolved
else:
deprecrated_review_settings["outputs"] = new_review_data_outputs

collect_instance_data = ayon_publish["CollectInstanceData"]
if "sync_workfile_version_on_product_types" in collect_instance_data:
Expand Down
54 changes: 54 additions & 0 deletions openpype/settings/defaults/project_settings/nuke.json
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,60 @@
}
}
},
"ExtractReviewDataBakingStreams": {
"enabled": true,
"viewer_lut_raw": false,
"outputs": {
"baking": {
"filter": {
"task_types": [],
"families": [],
"subsets": []
},
"read_raw": false,
"viewer_process_override": "",
"bake_viewer_process": true,
"bake_viewer_input_process": true,
"reformat_nodes_config": {
"enabled": false,
"reposition_nodes": [
{
"node_class": "Reformat",
"knobs": [
{
"type": "text",
"name": "type",
"value": "to format"
},
{
"type": "text",
"name": "format",
"value": "HD_1080"
},
{
"type": "text",
"name": "filter",
"value": "Lanczos6"
},
{
"type": "bool",
"name": "black_outside",
"value": true
},
{
"type": "bool",
"name": "pbb",
"value": false
}
]
}
]
},
"extension": "mov",
"add_custom_tags": []
}
}
},
"ExtractSlateFrame": {
"viewer_lut_raw": false,
"key_value_mapping": {
Expand Down
moonyuet marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,151 @@

]
},
{
"type": "label",
"label": "^ Settings and for <span style=\"color:#FF0000\";><b>ExtractReviewDataMov</b></span> is deprecated and will be soon removed. <br> Please use <b>ExtractReviewDataBakingStreams</b> instead."
jakubjezek001 marked this conversation as resolved.
Show resolved Hide resolved
},
{
"type": "dict",
"collapsible": true,
"checkbox_key": "enabled",
"key": "ExtractReviewDataBakingStreams",
"label": "ExtractReviewDataBakingStreams",
"is_group": true,
"children": [
{
"type": "boolean",
"key": "enabled",
"label": "Enabled"
},
{
"type": "boolean",
"key": "viewer_lut_raw",
"label": "Viewer LUT raw"
},
{
"key": "outputs",
"label": "Output Definitions",
"type": "dict-modifiable",
"highlight_content": true,
"object_type": {
"type": "dict",
"children": [
{
"type": "dict",
"collapsible": false,
"key": "filter",
"label": "Filtering",
"children": [
{
"key": "task_types",
"label": "Task types",
"type": "task-types-enum"
},
{
"key": "families",
"label": "Families",
"type": "list",
"object_type": "text"
},
{
"key": "subsets",
"label": "Subsets",
"type": "list",
"object_type": "text"
}
]
},
{
"type": "separator"
},
{
"type": "boolean",
"key": "read_raw",
"label": "Read colorspace RAW",
"default": false
},
{
"type": "text",
"key": "viewer_process_override",
"label": "Viewer Process colorspace profile override"
},
{
"type": "boolean",
"key": "bake_viewer_process",
"label": "Bake Viewer Process"
},
{
"type": "boolean",
"key": "bake_viewer_input_process",
"label": "Bake Viewer Input Process (LUTs)"
},
{
"type": "separator"
},
{
"key": "reformat_nodes_config",
"type": "dict",
"label": "Reformat Nodes",
"collapsible": true,
"checkbox_key": "enabled",
"children": [
{
"type": "boolean",
"key": "enabled",
"label": "Enabled"
},
{
"type": "label",
"label": "Reposition knobs supported only.<br/>You can add multiple reformat nodes <br/>and set their knobs. Order of reformat <br/>nodes is important. First reformat node <br/>will be applied first and last reformat <br/>node will be applied last."
},
{
"key": "reposition_nodes",
"type": "list",
"label": "Reposition nodes",
"object_type": {
"type": "dict",
"children": [
{
"key": "node_class",
"label": "Node class",
"type": "text"
},
{
"type": "schema_template",
"name": "template_nuke_knob_inputs",
"template_data": [
{
"label": "Node knobs",
"key": "knobs"
}
]
}
]
}
}
]
},
{
"type": "separator"
},
{
"type": "text",
"key": "extension",
"label": "Write node file type"
},
{
"key": "add_custom_tags",
"label": "Add custom tags",
"type": "list",
"object_type": "text"
}
]
}
}

]
},
{
"type": "dict",
"collapsible": true,
Expand Down
Loading
Loading