Merge branch 'develop' into bugfix/OP-5944_nuke_few_fixes

This commit is contained in:
Jakub Ježek 2023-06-07 11:55:25 +02:00 committed by GitHub
commit da750e3772
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 86 additions and 3 deletions

View file

@ -0,0 +1,76 @@
import os
import nuke
from openpype.hosts.nuke.api.lib import set_node_knobs_from_settings
frame_padding = 5
temp_rendering_path_template = (
"{work}/renders/nuke/{subset}/{subset}.{frame}.{ext}")
knobs_setting = {
"knobs": [
{
"type": "text",
"name": "file_type",
"value": "exr"
},
{
"type": "text",
"name": "datatype",
"value": "16 bit half"
},
{
"type": "text",
"name": "compression",
"value": "Zip (1 scanline)"
},
{
"type": "bool",
"name": "autocrop",
"value": True
},
{
"type": "color_gui",
"name": "tile_color",
"value": [
186,
35,
35,
255
]
},
{
"type": "text",
"name": "channels",
"value": "rgb"
},
{
"type": "bool",
"name": "create_directories",
"value": True
}
]
}
def main():
write_selected_nodes = [
s for s in nuke.selectedNodes() if s.Class() == "Write"]
ext = None
knobs = knobs_setting["knobs"]
for knob in knobs:
if knob["name"] == "file_type":
ext = knob["value"]
for w in write_selected_nodes:
# data for mapping the path
data = {
"work": os.getenv("AVALON_WORKDIR"),
"subset": w["name"].value(),
"frame": "#" * frame_padding,
"ext": ext
}
file_path = temp_rendering_path_template.format(**data)
file_path = file_path.replace("\\", "/")
w["file"].setValue(file_path)
set_node_knobs_from_settings(w, knobs)

View file

@ -229,6 +229,13 @@
"title": "Set Frame Start (Read Node)",
"command": "from openpype.hosts.nuke.startup.frame_setting_for_read_nodes import main;main();",
"tooltip": "Set frame start for read node(s)"
},
{
"type": "action",
"sourcetype": "python",
"title": "Set non publish output for Write Node",
"command": "from openpype.hosts.nuke.startup.custom_write_node import main;main();",
"tooltip": "Open the OpenPype Nuke user doc page"
}
]
},

View file

@ -273,7 +273,7 @@ class ActionModel(QtGui.QStandardItemModel):
# Sort by order and name
return sorted(
compatible,
key=lambda action: (action.order, action.name)
key=lambda action: (action.order, lib.get_action_label(action))
)
def update_force_not_open_workfile_settings(self, is_checked, action_id):

View file

@ -1,3 +1,3 @@
# -*- coding: utf-8 -*-
"""Package declaring Pype version."""
__version__ = "3.15.10-nightly.1"
__version__ = "3.15.10-nightly.2"