mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
Merge branch 'develop' into enhancement/validate-version-based-on-profiles
This commit is contained in:
commit
c65fe6dcd2
161 changed files with 595 additions and 150 deletions
|
|
@ -54,8 +54,10 @@ MOVED_ADDON_MILESTONE_VERSIONS = {
|
|||
"clockify": VersionInfo(0, 2, 0),
|
||||
"traypublisher": VersionInfo(0, 2, 0),
|
||||
"tvpaint": VersionInfo(0, 2, 0),
|
||||
"nuke": VersionInfo(0, 2, 0),
|
||||
}
|
||||
|
||||
|
||||
# Inherit from `object` for Python 2 hosts
|
||||
class _ModuleClass(object):
|
||||
"""Fake module class for storing AYON addons.
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ import re
|
|||
import json
|
||||
from collections import defaultdict
|
||||
|
||||
import contextlib
|
||||
import substance_painter
|
||||
import substance_painter.project
|
||||
import substance_painter.resource
|
||||
import substance_painter.js
|
||||
|
|
@ -640,3 +642,88 @@ def prompt_new_file_with_mesh(mesh_filepath):
|
|||
return
|
||||
|
||||
return project_mesh
|
||||
|
||||
|
||||
def get_filtered_export_preset(export_preset_name, channel_type_names):
|
||||
"""Return export presets included with specific channels
|
||||
requested by users.
|
||||
|
||||
Args:
|
||||
export_preset_name (str): Name of export preset
|
||||
channel_type_list (list): A list of channel type requested by users
|
||||
|
||||
Returns:
|
||||
dict: export preset data
|
||||
"""
|
||||
|
||||
target_maps = []
|
||||
|
||||
export_presets = get_export_presets()
|
||||
export_preset_nice_name = export_presets[export_preset_name]
|
||||
resource_presets = substance_painter.export.list_resource_export_presets()
|
||||
preset = next(
|
||||
(
|
||||
preset for preset in resource_presets
|
||||
if preset.resource_id.name == export_preset_nice_name
|
||||
), None
|
||||
)
|
||||
if preset is None:
|
||||
return {}
|
||||
|
||||
maps = preset.list_output_maps()
|
||||
for channel_map in maps:
|
||||
for channel_name in channel_type_names:
|
||||
if not channel_map.get("fileName"):
|
||||
continue
|
||||
|
||||
if channel_name in channel_map["fileName"]:
|
||||
target_maps.append(channel_map)
|
||||
# Create a new preset
|
||||
return {
|
||||
"exportPresets": [
|
||||
{
|
||||
"name": export_preset_name,
|
||||
"maps": target_maps
|
||||
}
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def set_layer_stack_opacity(node_ids, channel_types):
|
||||
"""Function to set the opacity of the layer stack during
|
||||
context
|
||||
Args:
|
||||
node_ids (list[int]): Substance painter root layer node ids
|
||||
channel_types (list[str]): Channel type names as defined as
|
||||
attributes in `substance_painter.textureset.ChannelType`
|
||||
"""
|
||||
# Do nothing
|
||||
if not node_ids or not channel_types:
|
||||
yield
|
||||
return
|
||||
|
||||
stack = substance_painter.textureset.get_active_stack()
|
||||
stack_root_layers = (
|
||||
substance_painter.layerstack.get_root_layer_nodes(stack)
|
||||
)
|
||||
node_ids = set(node_ids) # lookup
|
||||
excluded_nodes = [
|
||||
node for node in stack_root_layers
|
||||
if node.uid() not in node_ids
|
||||
]
|
||||
|
||||
original_opacity_values = []
|
||||
for node in excluded_nodes:
|
||||
for channel in channel_types:
|
||||
chan = getattr(substance_painter.textureset.ChannelType, channel)
|
||||
original_opacity_values.append((chan, node.get_opacity(chan)))
|
||||
try:
|
||||
for node in excluded_nodes:
|
||||
for channel, _ in original_opacity_values:
|
||||
node.set_opacity(0.0, channel)
|
||||
yield
|
||||
finally:
|
||||
for node in excluded_nodes:
|
||||
for channel, opacity in original_opacity_values:
|
||||
node.set_opacity(opacity, channel)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""Creator plugin for creating textures."""
|
||||
|
||||
from ayon_core.pipeline import CreatedInstance, Creator, CreatorError
|
||||
from ayon_core.lib import (
|
||||
EnumDef,
|
||||
|
|
@ -17,6 +16,7 @@ from ayon_core.hosts.substancepainter.api.pipeline import (
|
|||
)
|
||||
from ayon_core.hosts.substancepainter.api.lib import get_export_presets
|
||||
|
||||
import substance_painter
|
||||
import substance_painter.project
|
||||
|
||||
|
||||
|
|
@ -28,9 +28,16 @@ class CreateTextures(Creator):
|
|||
icon = "picture-o"
|
||||
|
||||
default_variant = "Main"
|
||||
channel_mapping = []
|
||||
|
||||
def apply_settings(self, project_settings):
|
||||
settings = project_settings["substancepainter"].get("create", []) # noqa
|
||||
if settings:
|
||||
self.channel_mapping = settings["CreateTextures"].get(
|
||||
"channel_mapping", [])
|
||||
|
||||
|
||||
def create(self, product_name, instance_data, pre_create_data):
|
||||
|
||||
if not substance_painter.project.is_open():
|
||||
raise CreatorError("Can't create a Texture Set instance without "
|
||||
"an open project.")
|
||||
|
|
@ -42,11 +49,20 @@ class CreateTextures(Creator):
|
|||
"exportFileFormat",
|
||||
"exportSize",
|
||||
"exportPadding",
|
||||
"exportDilationDistance"
|
||||
"exportDilationDistance",
|
||||
"useCustomExportPreset",
|
||||
"exportChannel"
|
||||
]:
|
||||
if key in pre_create_data:
|
||||
creator_attributes[key] = pre_create_data[key]
|
||||
|
||||
if pre_create_data.get("use_selection"):
|
||||
stack = substance_painter.textureset.get_active_stack()
|
||||
|
||||
instance_data["selected_node_id"] = [
|
||||
node_number.uid() for node_number in
|
||||
substance_painter.layerstack.get_selected_nodes(stack)]
|
||||
|
||||
instance = self.create_instance_in_context(product_name,
|
||||
instance_data)
|
||||
set_instance(
|
||||
|
|
@ -88,8 +104,53 @@ class CreateTextures(Creator):
|
|||
return instance
|
||||
|
||||
def get_instance_attr_defs(self):
|
||||
if self.channel_mapping:
|
||||
export_channel_enum = {
|
||||
item["value"]: item["name"]
|
||||
for item in self.channel_mapping
|
||||
}
|
||||
else:
|
||||
export_channel_enum = {
|
||||
"BaseColor": "Base Color",
|
||||
"Metallic": "Metallic",
|
||||
"Roughness": "Roughness",
|
||||
"SpecularEdgeColor": "Specular Edge Color",
|
||||
"Emissive": "Emissive",
|
||||
"Opacity": "Opacity",
|
||||
"Displacement": "Displacement",
|
||||
"Glossiness": "Glossiness",
|
||||
"Anisotropylevel": "Anisotropy Level",
|
||||
"AO": "Ambient Occulsion",
|
||||
"Anisotropyangle": "Anisotropy Angle",
|
||||
"Transmissive": "Transmissive",
|
||||
"Reflection": "Reflection",
|
||||
"Diffuse": "Diffuse",
|
||||
"Ior": "Index of Refraction",
|
||||
"Specularlevel": "Specular Level",
|
||||
"BlendingMask": "Blending Mask",
|
||||
"Translucency": "Translucency",
|
||||
"Scattering": "Scattering",
|
||||
"ScatterColor": "Scatter Color",
|
||||
"SheenOpacity": "Sheen Opacity",
|
||||
"SheenRoughness": "Sheen Roughness",
|
||||
"SheenColor": "Sheen Color",
|
||||
"CoatOpacity": "Coat Opacity",
|
||||
"CoatColor": "Coat Color",
|
||||
"CoatRoughness": "Coat Roughness",
|
||||
"CoatSpecularLevel": "Coat Specular Level",
|
||||
"CoatNormal": "Coat Normal",
|
||||
}
|
||||
|
||||
return [
|
||||
EnumDef("exportChannel",
|
||||
items=export_channel_enum,
|
||||
multiselection=True,
|
||||
default=None,
|
||||
label="Export Channel(s)",
|
||||
tooltip="Choose the channel which you "
|
||||
"want to solely export. The value "
|
||||
"is 'None' by default which exports "
|
||||
"all channels"),
|
||||
EnumDef("exportPresetUrl",
|
||||
items=get_export_presets(),
|
||||
label="Output Template"),
|
||||
|
|
@ -149,7 +210,6 @@ class CreateTextures(Creator):
|
|||
},
|
||||
default=None,
|
||||
label="Size"),
|
||||
|
||||
EnumDef("exportPadding",
|
||||
items={
|
||||
"passthrough": "No padding (passthrough)",
|
||||
|
|
@ -172,4 +232,10 @@ class CreateTextures(Creator):
|
|||
|
||||
def get_pre_create_attr_defs(self):
|
||||
# Use same attributes as for instance attributes
|
||||
return self.get_instance_attr_defs()
|
||||
attr_defs = []
|
||||
if substance_painter.application.version_info()[0] >= 10:
|
||||
attr_defs.append(
|
||||
BoolDef("use_selection", label="Use selection",
|
||||
tooltip="Select Layer Stack(s) for exporting")
|
||||
)
|
||||
return attr_defs + self.get_instance_attr_defs()
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import substance_painter.textureset
|
|||
from ayon_core.pipeline import publish
|
||||
from ayon_core.hosts.substancepainter.api.lib import (
|
||||
get_parsed_export_maps,
|
||||
get_filtered_export_preset,
|
||||
strip_template
|
||||
)
|
||||
from ayon_core.pipeline.create import get_product_name
|
||||
|
|
@ -207,5 +208,8 @@ class CollectTextureSet(pyblish.api.InstancePlugin):
|
|||
for key, value in dict(parameters).items():
|
||||
if value is None:
|
||||
parameters.pop(key)
|
||||
|
||||
channel_layer = creator_attrs.get("exportChannel", [])
|
||||
if channel_layer:
|
||||
maps = get_filtered_export_preset(preset_url, channel_layer)
|
||||
config.update(maps)
|
||||
return config
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import substance_painter.export
|
||||
|
||||
from ayon_core.pipeline import KnownPublishError, publish
|
||||
from ayon_core.hosts.substancepainter.api.lib import set_layer_stack_opacity
|
||||
|
||||
|
||||
class ExtractTextures(publish.Extractor,
|
||||
|
|
@ -25,19 +25,24 @@ class ExtractTextures(publish.Extractor,
|
|||
def process(self, instance):
|
||||
|
||||
config = instance.data["exportConfig"]
|
||||
result = substance_painter.export.export_project_textures(config)
|
||||
creator_attrs = instance.data["creator_attributes"]
|
||||
export_channel = creator_attrs.get("exportChannel", [])
|
||||
node_ids = instance.data.get("selected_node_id", [])
|
||||
|
||||
if result.status != substance_painter.export.ExportStatus.Success:
|
||||
raise KnownPublishError(
|
||||
"Failed to export texture set: {}".format(result.message)
|
||||
)
|
||||
with set_layer_stack_opacity(node_ids, export_channel):
|
||||
result = substance_painter.export.export_project_textures(config)
|
||||
|
||||
# Log what files we generated
|
||||
for (texture_set_name, stack_name), maps in result.textures.items():
|
||||
# Log our texture outputs
|
||||
self.log.info(f"Exported stack: {texture_set_name} {stack_name}")
|
||||
for texture_map in maps:
|
||||
self.log.info(f"Exported texture: {texture_map}")
|
||||
if result.status != substance_painter.export.ExportStatus.Success:
|
||||
raise KnownPublishError(
|
||||
"Failed to export texture set: {}".format(result.message)
|
||||
)
|
||||
|
||||
# Log what files we generated
|
||||
for (texture_set_name, stack_name), maps in result.textures.items():
|
||||
# Log our texture outputs
|
||||
self.log.info(f"Exported stack: {texture_set_name} {stack_name}")
|
||||
for texture_map in maps:
|
||||
self.log.info(f"Exported texture: {texture_map}")
|
||||
|
||||
# We'll insert the color space data for each image instance that we
|
||||
# added into this texture set. The collector couldn't do so because
|
||||
|
|
|
|||
|
|
@ -30,11 +30,16 @@ class ValidateOutputMaps(pyblish.api.InstancePlugin):
|
|||
# it will generate without actually exporting the files. So we try to
|
||||
# generate the smallest size / fastest export as possible
|
||||
config = copy.deepcopy(config)
|
||||
invalid_channels = self.get_invalid_channels(instance, config)
|
||||
if invalid_channels:
|
||||
raise PublishValidationError(
|
||||
"Invalid Channel(s): {} found in texture set {}".format(
|
||||
invalid_channels, instance.name
|
||||
))
|
||||
parameters = config["exportParameters"][0]["parameters"]
|
||||
parameters["sizeLog2"] = [1, 1] # output 2x2 images (smallest)
|
||||
parameters["paddingAlgorithm"] = "passthrough" # no dilation (faster)
|
||||
parameters["dithering"] = False # no dithering (faster)
|
||||
|
||||
result = substance_painter.export.export_project_textures(config)
|
||||
if result.status != substance_painter.export.ExportStatus.Success:
|
||||
raise PublishValidationError(
|
||||
|
|
@ -108,3 +113,41 @@ class ValidateOutputMaps(pyblish.api.InstancePlugin):
|
|||
message=message,
|
||||
title="Missing output maps"
|
||||
)
|
||||
|
||||
def get_invalid_channels(self, instance, config):
|
||||
"""Function to get invalid channel(s) from export channel
|
||||
filtering
|
||||
|
||||
Args:
|
||||
instance (pyblish.api.Instance): Instance
|
||||
config (dict): export config
|
||||
|
||||
Raises:
|
||||
PublishValidationError: raise Publish Validation
|
||||
Error if any invalid channel(s) found
|
||||
|
||||
Returns:
|
||||
list: invalid channel(s)
|
||||
"""
|
||||
creator_attrs = instance.data["creator_attributes"]
|
||||
export_channel = creator_attrs.get("exportChannel", [])
|
||||
tmp_export_channel = copy.deepcopy(export_channel)
|
||||
invalid_channel = []
|
||||
if export_channel:
|
||||
for export_preset in config.get("exportPresets", {}):
|
||||
if not export_preset.get("maps", {}):
|
||||
raise PublishValidationError(
|
||||
"No Texture Map Exported with texture set: {}.".format(
|
||||
instance.name)
|
||||
)
|
||||
map_names = [channel_map["fileName"] for channel_map
|
||||
in export_preset["maps"]]
|
||||
for channel in tmp_export_channel:
|
||||
# Check if channel is found in at least one map
|
||||
for map_name in map_names:
|
||||
if channel in map_name:
|
||||
break
|
||||
else:
|
||||
invalid_channel.append(channel)
|
||||
|
||||
return invalid_channel
|
||||
|
|
|
|||
|
|
@ -681,7 +681,7 @@ class PublishAttributeValues(AttributeValues):
|
|||
|
||||
@property
|
||||
def parent(self):
|
||||
self.publish_attributes.parent
|
||||
return self.publish_attributes.parent
|
||||
|
||||
|
||||
class PublishAttributes:
|
||||
|
|
|
|||
|
|
@ -107,7 +107,10 @@ class VersionDelegate(QtWidgets.QStyledItemDelegate):
|
|||
style = QtWidgets.QApplication.style()
|
||||
|
||||
style.drawControl(
|
||||
style.CE_ItemViewItem, option, painter, option.widget
|
||||
QtWidgets.QCommonStyle.CE_ItemViewItem,
|
||||
option,
|
||||
painter,
|
||||
option.widget
|
||||
)
|
||||
|
||||
painter.save()
|
||||
|
|
@ -119,9 +122,14 @@ class VersionDelegate(QtWidgets.QStyledItemDelegate):
|
|||
pen.setColor(fg_color)
|
||||
painter.setPen(pen)
|
||||
|
||||
text_rect = style.subElementRect(style.SE_ItemViewItemText, option)
|
||||
text_rect = style.subElementRect(
|
||||
QtWidgets.QCommonStyle.SE_ItemViewItemText,
|
||||
option
|
||||
)
|
||||
text_margin = style.proxy().pixelMetric(
|
||||
style.PM_FocusFrameHMargin, option, option.widget
|
||||
QtWidgets.QCommonStyle.PM_FocusFrameHMargin,
|
||||
option,
|
||||
option.widget
|
||||
) + 1
|
||||
|
||||
painter.drawText(
|
||||
|
|
@ -207,14 +215,22 @@ class StatusDelegate(QtWidgets.QStyledItemDelegate):
|
|||
style = QtWidgets.QApplication.style()
|
||||
|
||||
style.drawControl(
|
||||
style.CE_ItemViewItem, option, painter, option.widget
|
||||
QtWidgets.QCommonStyle.CE_ItemViewItem,
|
||||
option,
|
||||
painter,
|
||||
option.widget
|
||||
)
|
||||
|
||||
painter.save()
|
||||
|
||||
text_rect = style.subElementRect(style.SE_ItemViewItemText, option)
|
||||
text_rect = style.subElementRect(
|
||||
QtWidgets.QCommonStyle.SE_ItemViewItemText,
|
||||
option
|
||||
)
|
||||
text_margin = style.proxy().pixelMetric(
|
||||
style.PM_FocusFrameHMargin, option, option.widget
|
||||
QtWidgets.QCommonStyle.PM_FocusFrameHMargin,
|
||||
option,
|
||||
option.widget
|
||||
) + 1
|
||||
padded_text_rect = text_rect.adjusted(
|
||||
text_margin, 0, - text_margin, 0
|
||||
|
|
|
|||
|
|
@ -212,7 +212,13 @@ class ApplicationsAddonSettings(BaseSettingsModel):
|
|||
scope=["studio"]
|
||||
)
|
||||
only_available: bool = SettingsField(
|
||||
True, title="Show only available applications")
|
||||
True,
|
||||
title="Show only available applications",
|
||||
description="Enable to show only applications in AYON Launcher"
|
||||
" for which the executable paths are found on the running machine."
|
||||
" This applies as an additional filter to the applications defined in a "
|
||||
" project's anatomy settings to ignore unavailable applications."
|
||||
)
|
||||
|
||||
@validator("tool_groups")
|
||||
def validate_unique_name(cls, value):
|
||||
|
|
|
|||
|
|
@ -354,7 +354,7 @@ def imprint(node, data, tab=None):
|
|||
Examples:
|
||||
```
|
||||
import nuke
|
||||
from ayon_core.hosts.nuke.api import lib
|
||||
from ayon_nuke.api import lib
|
||||
|
||||
node = nuke.createNode("NoOp")
|
||||
data = {
|
||||
|
|
@ -419,7 +419,7 @@ def add_publish_knob(node):
|
|||
return node
|
||||
|
||||
|
||||
@deprecated("ayon_core.hosts.nuke.api.lib.set_node_data")
|
||||
@deprecated("ayon_nuke.api.lib.set_node_data")
|
||||
def set_avalon_knob_data(node, data=None, prefix="avalon:"):
|
||||
"""[DEPRECATED] Sets data into nodes's avalon knob
|
||||
|
||||
|
|
@ -485,7 +485,7 @@ def set_avalon_knob_data(node, data=None, prefix="avalon:"):
|
|||
return node
|
||||
|
||||
|
||||
@deprecated("ayon_core.hosts.nuke.api.lib.get_node_data")
|
||||
@deprecated("ayon_nuke.api.lib.get_node_data")
|
||||
def get_avalon_knob_data(node, prefix="avalon:", create=True):
|
||||
"""[DEPRECATED] Gets a data from nodes's avalon knob
|
||||
|
||||
|
|
@ -1028,7 +1028,7 @@ def add_button_render_on_farm(node):
|
|||
name = "renderOnFarm"
|
||||
label = "Render On Farm"
|
||||
value = (
|
||||
"from ayon_core.hosts.nuke.api.utils import submit_render_on_farm;"
|
||||
"from ayon_nuke.api.utils import submit_render_on_farm;"
|
||||
"submit_render_on_farm(nuke.thisNode())"
|
||||
)
|
||||
knob = nuke.PyScript_Knob(name, label, value)
|
||||
|
|
@ -2469,7 +2469,7 @@ def _launch_workfile_app():
|
|||
host_tools.show_workfiles(parent=None, on_top=True)
|
||||
|
||||
|
||||
@deprecated("ayon_core.hosts.nuke.api.lib.start_workfile_template_builder")
|
||||
@deprecated("ayon_nuke.api.lib.start_workfile_template_builder")
|
||||
def process_workfile_builder():
|
||||
""" [DEPRECATED] Process workfile builder on nuke start
|
||||
|
||||
|
|
@ -28,7 +28,7 @@ from ayon_core.pipeline import (
|
|||
)
|
||||
from ayon_core.pipeline.workfile import BuildWorkfile
|
||||
from ayon_core.tools.utils import host_tools
|
||||
from ayon_core.hosts.nuke import NUKE_ROOT_DIR
|
||||
from ayon_nuke import NUKE_ROOT_DIR
|
||||
from ayon_core.tools.workfile_template_build import open_template_ui
|
||||
|
||||
from .lib import (
|
||||
|
|
@ -188,10 +188,10 @@ def reload_config():
|
|||
"""
|
||||
|
||||
for module in (
|
||||
"ayon_core.hosts.nuke.api.actions",
|
||||
"ayon_core.hosts.nuke.api.menu",
|
||||
"ayon_core.hosts.nuke.api.plugin",
|
||||
"ayon_core.hosts.nuke.api.lib",
|
||||
"ayon_nuke.api.actions",
|
||||
"ayon_nuke.api.menu",
|
||||
"ayon_nuke.api.plugin",
|
||||
"ayon_nuke.api.lib",
|
||||
):
|
||||
log.info("Reloading module: {}...".format(module))
|
||||
|
||||
|
|
@ -572,8 +572,11 @@ class ExporterReview(object):
|
|||
self.fhead = self.fhead.replace("#", "")[:-1]
|
||||
|
||||
def get_representation_data(
|
||||
self, tags=None, range=False,
|
||||
custom_tags=None, colorspace=None
|
||||
self,
|
||||
tags=None,
|
||||
range=False,
|
||||
custom_tags=None,
|
||||
colorspace=None,
|
||||
):
|
||||
""" Add representation data to self.data
|
||||
|
||||
|
|
@ -584,6 +587,8 @@ class ExporterReview(object):
|
|||
Defaults to False.
|
||||
custom_tags (list[str], optional): user inputted custom tags.
|
||||
Defaults to None.
|
||||
colorspace (str, optional): colorspace name.
|
||||
Defaults to None.
|
||||
"""
|
||||
add_tags = tags or []
|
||||
repre = {
|
||||
|
|
@ -591,7 +596,13 @@ class ExporterReview(object):
|
|||
"ext": self.ext,
|
||||
"files": self.file,
|
||||
"stagingDir": self.staging_dir,
|
||||
"tags": [self.name.replace("_", "-")] + add_tags
|
||||
"tags": [self.name.replace("_", "-")] + add_tags,
|
||||
"data": {
|
||||
# making sure that once intermediate file is published
|
||||
# as representation, we will be able to then identify it
|
||||
# from representation.data.isIntermediate
|
||||
"isIntermediate": True
|
||||
},
|
||||
}
|
||||
|
||||
if custom_tags:
|
||||
|
|
@ -837,7 +848,8 @@ class ExporterReviewMov(ExporterReview):
|
|||
|
||||
def generate_mov(self, farm=False, delete=True, **kwargs):
|
||||
# colorspace data
|
||||
colorspace = None
|
||||
colorspace = self.write_colorspace
|
||||
|
||||
# get colorspace settings
|
||||
# get colorspace data from context
|
||||
config_data, _ = get_colorspace_settings_from_publish_context(
|
||||
|
|
@ -999,7 +1011,7 @@ class ExporterReviewMov(ExporterReview):
|
|||
tags=tags + add_tags,
|
||||
custom_tags=add_custom_tags,
|
||||
range=True,
|
||||
colorspace=colorspace
|
||||
colorspace=colorspace,
|
||||
)
|
||||
|
||||
self.log.debug("Representation... `{}`".format(self.data))
|
||||
|
|
@ -1038,7 +1050,7 @@ def convert_to_valid_instaces():
|
|||
}
|
||||
return mapping[product_type]
|
||||
|
||||
from ayon_core.hosts.nuke.api import workio
|
||||
from ayon_nuke.api import workio
|
||||
|
||||
task_name = get_current_task_name()
|
||||
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
from ayon_core.pipeline import AYON_INSTANCE_ID, AVALON_INSTANCE_ID
|
||||
from ayon_core.pipeline.create.creator_plugins import ProductConvertorPlugin
|
||||
from ayon_core.hosts.nuke.api.lib import (
|
||||
from ayon_nuke.api.lib import (
|
||||
INSTANCE_DATA_KNOB,
|
||||
get_node_data,
|
||||
get_avalon_knob_data,
|
||||
NODE_TAB_NAME,
|
||||
)
|
||||
from ayon_core.hosts.nuke.api.plugin import convert_to_valid_instaces
|
||||
from ayon_nuke.api.plugin import convert_to_valid_instaces
|
||||
|
||||
import nuke
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
from nukescripts import autoBackdrop
|
||||
|
||||
from ayon_core.hosts.nuke.api import (
|
||||
from ayon_nuke.api import (
|
||||
NukeCreator,
|
||||
maintained_selection,
|
||||
select_nodes
|
||||
|
|
@ -10,6 +10,8 @@ from ayon_core.hosts.nuke.api import (
|
|||
class CreateBackdrop(NukeCreator):
|
||||
"""Add Publishable Backdrop"""
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
identifier = "create_backdrop"
|
||||
label = "Nukenodes (backdrop)"
|
||||
product_type = "nukenodes"
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
import nuke
|
||||
from ayon_core.hosts.nuke.api import (
|
||||
from ayon_nuke.api import (
|
||||
NukeCreator,
|
||||
NukeCreatorError,
|
||||
maintained_selection
|
||||
)
|
||||
from ayon_core.hosts.nuke.api.lib import (
|
||||
from ayon_nuke.api.lib import (
|
||||
create_camera_node_by_version
|
||||
)
|
||||
|
||||
|
|
@ -12,6 +12,8 @@ from ayon_core.hosts.nuke.api.lib import (
|
|||
class CreateCamera(NukeCreator):
|
||||
"""Add Publishable Camera"""
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
identifier = "create_camera"
|
||||
label = "Camera (3d)"
|
||||
product_type = "camera"
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import nuke
|
||||
from ayon_core.hosts.nuke.api import (
|
||||
from ayon_nuke.api import (
|
||||
NukeCreator,
|
||||
NukeCreatorError,
|
||||
maintained_selection
|
||||
|
|
@ -9,6 +9,8 @@ from ayon_core.hosts.nuke.api import (
|
|||
class CreateGizmo(NukeCreator):
|
||||
"""Add Publishable Group as gizmo"""
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
identifier = "create_gizmo"
|
||||
label = "Gizmo (group)"
|
||||
product_type = "gizmo"
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import nuke
|
||||
from ayon_core.hosts.nuke.api import (
|
||||
from ayon_nuke.api import (
|
||||
NukeCreator,
|
||||
NukeCreatorError,
|
||||
maintained_selection
|
||||
|
|
@ -9,6 +9,8 @@ from ayon_core.hosts.nuke.api import (
|
|||
class CreateModel(NukeCreator):
|
||||
"""Add Publishable Camera"""
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
identifier = "create_model"
|
||||
label = "Model (3d)"
|
||||
product_type = "model"
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import nuke
|
||||
import six
|
||||
import sys
|
||||
from ayon_core.hosts.nuke.api import (
|
||||
from ayon_nuke.api import (
|
||||
INSTANCE_DATA_KNOB,
|
||||
NukeCreator,
|
||||
NukeCreatorError,
|
||||
|
|
@ -15,6 +15,8 @@ from ayon_core.pipeline import (
|
|||
class CreateSource(NukeCreator):
|
||||
"""Add Publishable Read with source"""
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
identifier = "create_source"
|
||||
label = "Source (read)"
|
||||
product_type = "source"
|
||||
|
|
@ -11,11 +11,14 @@ from ayon_core.lib import (
|
|||
UISeparatorDef,
|
||||
EnumDef
|
||||
)
|
||||
from ayon_core.hosts.nuke import api as napi
|
||||
from ayon_core.hosts.nuke.api.plugin import exposed_write_knobs
|
||||
from ayon_nuke import api as napi
|
||||
from ayon_nuke.api.plugin import exposed_write_knobs
|
||||
|
||||
|
||||
class CreateWriteImage(napi.NukeWriteCreator):
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
identifier = "create_write_image"
|
||||
label = "Image (write)"
|
||||
product_type = "image"
|
||||
|
|
@ -8,11 +8,14 @@ from ayon_core.pipeline import (
|
|||
from ayon_core.lib import (
|
||||
BoolDef
|
||||
)
|
||||
from ayon_core.hosts.nuke import api as napi
|
||||
from ayon_core.hosts.nuke.api.plugin import exposed_write_knobs
|
||||
from ayon_nuke import api as napi
|
||||
from ayon_nuke.api.plugin import exposed_write_knobs
|
||||
|
||||
|
||||
class CreateWritePrerender(napi.NukeWriteCreator):
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
identifier = "create_write_prerender"
|
||||
label = "Prerender (write)"
|
||||
product_type = "prerender"
|
||||
|
|
@ -8,11 +8,14 @@ from ayon_core.pipeline import (
|
|||
from ayon_core.lib import (
|
||||
BoolDef
|
||||
)
|
||||
from ayon_core.hosts.nuke import api as napi
|
||||
from ayon_core.hosts.nuke.api.plugin import exposed_write_knobs
|
||||
from ayon_nuke import api as napi
|
||||
from ayon_nuke.api.plugin import exposed_write_knobs
|
||||
|
||||
|
||||
class CreateWriteRender(napi.NukeWriteCreator):
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
identifier = "create_write_render"
|
||||
label = "Render (write)"
|
||||
product_type = "render"
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
import ayon_api
|
||||
|
||||
import ayon_core.hosts.nuke.api as api
|
||||
import ayon_nuke.api as api
|
||||
from ayon_core.pipeline import (
|
||||
AutoCreator,
|
||||
CreatedInstance,
|
||||
)
|
||||
from ayon_core.hosts.nuke.api import (
|
||||
from ayon_nuke.api import (
|
||||
INSTANCE_DATA_KNOB,
|
||||
set_node_data
|
||||
)
|
||||
|
|
@ -13,6 +13,9 @@ import nuke
|
|||
|
||||
|
||||
class WorkfileCreator(AutoCreator):
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
identifier = "workfile"
|
||||
product_type = "workfile"
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
from ayon_core.lib import Logger
|
||||
from ayon_core.pipeline import InventoryAction
|
||||
from ayon_core.hosts.nuke.api.lib import set_avalon_knob_data
|
||||
from ayon_nuke.api.lib import set_avalon_knob_data
|
||||
|
||||
|
||||
class RepairOldLoaders(InventoryAction):
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
from ayon_core.pipeline import InventoryAction
|
||||
from ayon_core.hosts.nuke.api.command import viewer_update_and_undo_stop
|
||||
from ayon_nuke.api.command import viewer_update_and_undo_stop
|
||||
|
||||
|
||||
class SelectContainers(InventoryAction):
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
from ayon_core.lib import Logger
|
||||
from ayon_core.pipeline import load
|
||||
from ayon_core.hosts.nuke.api import lib
|
||||
from ayon_nuke.api import lib
|
||||
|
||||
log = Logger.get_logger(__name__)
|
||||
|
||||
|
|
@ -6,7 +6,7 @@ from ayon_core.pipeline import (
|
|||
load,
|
||||
get_representation_path,
|
||||
)
|
||||
from ayon_core.hosts.nuke.api.lib import (
|
||||
from ayon_nuke.api.lib import (
|
||||
find_free_space_to_paste_nodes,
|
||||
maintained_selection,
|
||||
reset_selection,
|
||||
|
|
@ -14,8 +14,8 @@ from ayon_core.hosts.nuke.api.lib import (
|
|||
get_avalon_knob_data,
|
||||
set_avalon_knob_data
|
||||
)
|
||||
from ayon_core.hosts.nuke.api.command import viewer_update_and_undo_stop
|
||||
from ayon_core.hosts.nuke.api import containerise, update_container
|
||||
from ayon_nuke.api.command import viewer_update_and_undo_stop
|
||||
from ayon_nuke.api import containerise, update_container
|
||||
|
||||
|
||||
class LoadBackdropNodes(load.LoaderPlugin):
|
||||
|
|
@ -25,6 +25,8 @@ class LoadBackdropNodes(load.LoaderPlugin):
|
|||
representations = {"*"}
|
||||
extensions = {"nk"}
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
label = "Import Nuke Nodes"
|
||||
order = 0
|
||||
icon = "eye"
|
||||
|
|
@ -5,12 +5,12 @@ from ayon_core.pipeline import (
|
|||
load,
|
||||
get_representation_path,
|
||||
)
|
||||
from ayon_core.hosts.nuke.api import (
|
||||
from ayon_nuke.api import (
|
||||
containerise,
|
||||
update_container,
|
||||
viewer_update_and_undo_stop
|
||||
)
|
||||
from ayon_core.hosts.nuke.api.lib import (
|
||||
from ayon_nuke.api.lib import (
|
||||
maintained_selection
|
||||
)
|
||||
|
||||
|
|
@ -24,6 +24,8 @@ class AlembicCameraLoader(load.LoaderPlugin):
|
|||
representations = {"*"}
|
||||
extensions = {"abc"}
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
label = "Load Alembic Camera"
|
||||
icon = "camera"
|
||||
color = "orange"
|
||||
|
|
@ -12,11 +12,11 @@ from ayon_core.pipeline.colorspace import (
|
|||
get_imageio_file_rules_colorspace_from_filepath,
|
||||
get_current_context_imageio_config_preset,
|
||||
)
|
||||
from ayon_core.hosts.nuke.api.lib import (
|
||||
from ayon_nuke.api.lib import (
|
||||
get_imageio_input_colorspace,
|
||||
maintained_selection
|
||||
)
|
||||
from ayon_core.hosts.nuke.api import (
|
||||
from ayon_nuke.api import (
|
||||
containerise,
|
||||
update_container,
|
||||
viewer_update_and_undo_stop,
|
||||
|
|
@ -26,7 +26,7 @@ from ayon_core.lib.transcoding import (
|
|||
VIDEO_EXTENSIONS,
|
||||
IMAGE_EXTENSIONS
|
||||
)
|
||||
from ayon_core.hosts.nuke.api import plugin
|
||||
from ayon_nuke.api import plugin
|
||||
|
||||
|
||||
class LoadClip(plugin.NukeLoader):
|
||||
|
|
@ -48,6 +48,8 @@ class LoadClip(plugin.NukeLoader):
|
|||
ext.lstrip(".") for ext in IMAGE_EXTENSIONS.union(VIDEO_EXTENSIONS)
|
||||
)
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
label = "Load Clip"
|
||||
order = -20
|
||||
icon = "file-video-o"
|
||||
|
|
@ -61,7 +63,8 @@ class LoadClip(plugin.NukeLoader):
|
|||
# option gui
|
||||
options_defaults = {
|
||||
"start_at_workfile": True,
|
||||
"add_retime": True
|
||||
"add_retime": True,
|
||||
"deep_exr": False
|
||||
}
|
||||
|
||||
node_name_template = "{class_name}_{ext}"
|
||||
|
|
@ -78,6 +81,11 @@ class LoadClip(plugin.NukeLoader):
|
|||
"add_retime",
|
||||
help="Load with retime",
|
||||
default=cls.options_defaults["add_retime"]
|
||||
),
|
||||
qargparse.Boolean(
|
||||
"deep_exr",
|
||||
help="Read with deep exr",
|
||||
default=cls.options_defaults["deep_exr"]
|
||||
)
|
||||
]
|
||||
|
||||
|
|
@ -113,6 +121,9 @@ class LoadClip(plugin.NukeLoader):
|
|||
add_retime = options.get(
|
||||
"add_retime", self.options_defaults["add_retime"])
|
||||
|
||||
deep_exr = options.get(
|
||||
"deep_exr", self.options_defaults["deep_exr"])
|
||||
|
||||
repre_id = repre_entity["id"]
|
||||
|
||||
self.log.debug(
|
||||
|
|
@ -153,13 +164,21 @@ class LoadClip(plugin.NukeLoader):
|
|||
return
|
||||
|
||||
read_name = self._get_node_name(context)
|
||||
|
||||
# Create the Loader with the filename path set
|
||||
read_node = nuke.createNode(
|
||||
"Read",
|
||||
"name {}".format(read_name),
|
||||
inpanel=False
|
||||
)
|
||||
read_node = None
|
||||
if deep_exr:
|
||||
# Create the Loader with the filename path set
|
||||
read_node = nuke.createNode(
|
||||
"DeepRead",
|
||||
"name {}".format(read_name),
|
||||
inpanel=False
|
||||
)
|
||||
else:
|
||||
# Create the Loader with the filename path set
|
||||
read_node = nuke.createNode(
|
||||
"Read",
|
||||
"name {}".format(read_name),
|
||||
inpanel=False
|
||||
)
|
||||
|
||||
# get colorspace
|
||||
colorspace = (
|
||||
|
|
@ -171,14 +190,14 @@ class LoadClip(plugin.NukeLoader):
|
|||
# we will switch off undo-ing
|
||||
with viewer_update_and_undo_stop():
|
||||
read_node["file"].setValue(filepath)
|
||||
|
||||
self.set_colorspace_to_node(
|
||||
read_node,
|
||||
filepath,
|
||||
project_name,
|
||||
version_entity,
|
||||
repre_entity
|
||||
)
|
||||
if read_node.Class() == "Read":
|
||||
self.set_colorspace_to_node(
|
||||
read_node,
|
||||
filepath,
|
||||
project_name,
|
||||
version_entity,
|
||||
repre_entity
|
||||
)
|
||||
|
||||
self._set_range_to_node(
|
||||
read_node, first, last, start_at_workfile, slate_frames
|
||||
|
|
@ -328,13 +347,14 @@ class LoadClip(plugin.NukeLoader):
|
|||
# to avoid multiple undo steps for rest of process
|
||||
# we will switch off undo-ing
|
||||
with viewer_update_and_undo_stop():
|
||||
self.set_colorspace_to_node(
|
||||
read_node,
|
||||
filepath,
|
||||
project_name,
|
||||
version_entity,
|
||||
repre_entity
|
||||
)
|
||||
if read_node.Class() == "Read":
|
||||
self.set_colorspace_to_node(
|
||||
read_node,
|
||||
filepath,
|
||||
project_name,
|
||||
version_entity,
|
||||
repre_entity
|
||||
)
|
||||
|
||||
self._set_range_to_node(read_node, first, last, start_at_workfile)
|
||||
|
||||
|
|
@ -8,7 +8,7 @@ from ayon_core.pipeline import (
|
|||
load,
|
||||
get_representation_path,
|
||||
)
|
||||
from ayon_core.hosts.nuke.api import (
|
||||
from ayon_nuke.api import (
|
||||
containerise,
|
||||
update_container,
|
||||
viewer_update_and_undo_stop
|
||||
|
|
@ -22,13 +22,14 @@ class LoadEffects(load.LoaderPlugin):
|
|||
representations = {"*"}
|
||||
extensions = {"json"}
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
label = "Load Effects - nodes"
|
||||
order = 0
|
||||
icon = "cc"
|
||||
color = "white"
|
||||
ignore_attr = ["useLifetime"]
|
||||
|
||||
|
||||
def load(self, context, name, namespace, data):
|
||||
"""
|
||||
Loading function to get the soft effects to particular read node
|
||||
|
|
@ -8,8 +8,8 @@ from ayon_core.pipeline import (
|
|||
load,
|
||||
get_representation_path,
|
||||
)
|
||||
from ayon_core.hosts.nuke.api import lib
|
||||
from ayon_core.hosts.nuke.api import (
|
||||
from ayon_nuke.api import lib
|
||||
from ayon_nuke.api import (
|
||||
containerise,
|
||||
update_container,
|
||||
viewer_update_and_undo_stop
|
||||
|
|
@ -23,6 +23,8 @@ class LoadEffectsInputProcess(load.LoaderPlugin):
|
|||
representations = {"*"}
|
||||
extensions = {"json"}
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
label = "Load Effects - Input Process"
|
||||
order = 0
|
||||
icon = "eye"
|
||||
|
|
@ -5,13 +5,13 @@ from ayon_core.pipeline import (
|
|||
load,
|
||||
get_representation_path,
|
||||
)
|
||||
from ayon_core.hosts.nuke.api.lib import (
|
||||
from ayon_nuke.api.lib import (
|
||||
maintained_selection,
|
||||
get_avalon_knob_data,
|
||||
set_avalon_knob_data,
|
||||
swap_node_with_dependency,
|
||||
)
|
||||
from ayon_core.hosts.nuke.api import (
|
||||
from ayon_nuke.api import (
|
||||
containerise,
|
||||
update_container,
|
||||
viewer_update_and_undo_stop
|
||||
|
|
@ -25,6 +25,8 @@ class LoadGizmo(load.LoaderPlugin):
|
|||
representations = {"*"}
|
||||
extensions = {"nk"}
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
label = "Load Gizmo"
|
||||
order = 0
|
||||
icon = "dropbox"
|
||||
|
|
@ -6,14 +6,14 @@ from ayon_core.pipeline import (
|
|||
load,
|
||||
get_representation_path,
|
||||
)
|
||||
from ayon_core.hosts.nuke.api.lib import (
|
||||
from ayon_nuke.api.lib import (
|
||||
maintained_selection,
|
||||
create_backdrop,
|
||||
get_avalon_knob_data,
|
||||
set_avalon_knob_data,
|
||||
swap_node_with_dependency,
|
||||
)
|
||||
from ayon_core.hosts.nuke.api import (
|
||||
from ayon_nuke.api import (
|
||||
containerise,
|
||||
update_container,
|
||||
viewer_update_and_undo_stop
|
||||
|
|
@ -27,6 +27,8 @@ class LoadGizmoInputProcess(load.LoaderPlugin):
|
|||
representations = {"*"}
|
||||
extensions = {"nk"}
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
label = "Load Gizmo - Input Process"
|
||||
order = 0
|
||||
icon = "eye"
|
||||
|
|
@ -7,10 +7,10 @@ from ayon_core.pipeline import (
|
|||
load,
|
||||
get_representation_path,
|
||||
)
|
||||
from ayon_core.hosts.nuke.api.lib import (
|
||||
from ayon_nuke.api.lib import (
|
||||
get_imageio_input_colorspace
|
||||
)
|
||||
from ayon_core.hosts.nuke.api import (
|
||||
from ayon_nuke.api import (
|
||||
containerise,
|
||||
update_container,
|
||||
viewer_update_and_undo_stop
|
||||
|
|
@ -33,9 +33,9 @@ class LoadImage(load.LoaderPlugin):
|
|||
"image",
|
||||
}
|
||||
representations = {"*"}
|
||||
extensions = set(
|
||||
ext.lstrip(".") for ext in IMAGE_EXTENSIONS
|
||||
)
|
||||
extensions = set(ext.lstrip(".") for ext in IMAGE_EXTENSIONS)
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
label = "Load Image"
|
||||
order = -10
|
||||
|
|
@ -11,6 +11,8 @@ class MatchmoveLoader(load.LoaderPlugin):
|
|||
representations = {"*"}
|
||||
extensions = {"py"}
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
defaults = ["Camera", "Object"]
|
||||
|
||||
label = "Run matchmove script"
|
||||
|
|
@ -5,8 +5,8 @@ from ayon_core.pipeline import (
|
|||
load,
|
||||
get_representation_path,
|
||||
)
|
||||
from ayon_core.hosts.nuke.api.lib import maintained_selection
|
||||
from ayon_core.hosts.nuke.api import (
|
||||
from ayon_nuke.api.lib import maintained_selection
|
||||
from ayon_nuke.api import (
|
||||
containerise,
|
||||
update_container,
|
||||
viewer_update_and_undo_stop
|
||||
|
|
@ -22,6 +22,8 @@ class AlembicModelLoader(load.LoaderPlugin):
|
|||
representations = {"*"}
|
||||
extensions = {"abc"}
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
label = "Load Alembic"
|
||||
icon = "cube"
|
||||
color = "orange"
|
||||
|
|
@ -10,7 +10,7 @@ from ayon_core.pipeline import (
|
|||
load,
|
||||
get_representation_path,
|
||||
)
|
||||
from ayon_core.hosts.nuke.api import (
|
||||
from ayon_nuke.api import (
|
||||
containerise,
|
||||
viewer_update_and_undo_stop,
|
||||
update_container,
|
||||
|
|
@ -24,6 +24,8 @@ class LoadOcioLookNodes(load.LoaderPlugin):
|
|||
representations = {"*"}
|
||||
extensions = {"json"}
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
label = "Load OcioLook [nodes]"
|
||||
order = 0
|
||||
icon = "cc"
|
||||
|
|
@ -5,8 +5,8 @@ from ayon_core.pipeline import (
|
|||
load,
|
||||
get_representation_path,
|
||||
)
|
||||
from ayon_core.hosts.nuke.api.lib import get_avalon_knob_data
|
||||
from ayon_core.hosts.nuke.api import (
|
||||
from ayon_nuke.api.lib import get_avalon_knob_data
|
||||
from ayon_nuke.api import (
|
||||
containerise,
|
||||
update_container,
|
||||
viewer_update_and_undo_stop
|
||||
|
|
@ -20,6 +20,8 @@ class LinkAsGroup(load.LoaderPlugin):
|
|||
representations = {"*"}
|
||||
extensions = {"nk"}
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
label = "Load Precomp"
|
||||
order = 0
|
||||
icon = "file"
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
from pprint import pformat
|
||||
import pyblish.api
|
||||
from ayon_core.hosts.nuke.api import lib as pnlib
|
||||
from ayon_nuke.api import lib as pnlib
|
||||
import nuke
|
||||
|
||||
|
||||
|
|
@ -13,6 +13,8 @@ class CollectBackdrops(pyblish.api.InstancePlugin):
|
|||
hosts = ["nuke"]
|
||||
families = ["nukenodes"]
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
def process(self, instance):
|
||||
self.log.debug(pformat(instance.data))
|
||||
|
||||
|
|
@ -2,7 +2,7 @@ import os
|
|||
import nuke
|
||||
import pyblish.api
|
||||
from ayon_core.lib import get_version_from_path
|
||||
import ayon_core.hosts.nuke.api as napi
|
||||
import ayon_nuke.api as napi
|
||||
from ayon_core.pipeline import KnownPublishError
|
||||
|
||||
|
||||
|
|
@ -13,6 +13,8 @@ class CollectContextData(pyblish.api.ContextPlugin):
|
|||
label = "Collect context data"
|
||||
hosts = ['nuke']
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
def process(self, context): # sourcery skip: avoid-builtin-shadow
|
||||
root_node = nuke.root()
|
||||
|
||||
|
|
@ -13,5 +13,7 @@ class CollectFramerate(pyblish.api.ContextPlugin):
|
|||
"nukeassist"
|
||||
]
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
def process(self, context):
|
||||
context.data["fps"] = nuke.root()["fps"].getValue()
|
||||
|
|
@ -11,6 +11,8 @@ class CollectGizmo(pyblish.api.InstancePlugin):
|
|||
hosts = ["nuke"]
|
||||
families = ["gizmo"]
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
def process(self, instance):
|
||||
|
||||
gizmo_node = instance.data["transientData"]["node"]
|
||||
|
|
@ -13,6 +13,8 @@ class CollectRenderOnFarm(pyblish.api.ContextPlugin):
|
|||
label = "Collect Render On Farm"
|
||||
hosts = ["nuke"]
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
def process(self, context):
|
||||
if not context.data.get("render_on_farm", False):
|
||||
return
|
||||
|
|
@ -11,6 +11,8 @@ class CollectModel(pyblish.api.InstancePlugin):
|
|||
hosts = ["nuke"]
|
||||
families = ["model"]
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
def process(self, instance):
|
||||
|
||||
geo_node = instance.data["transientData"]["node"]
|
||||
|
|
@ -11,6 +11,8 @@ class CollectInstanceData(pyblish.api.InstancePlugin):
|
|||
label = "Collect Nuke Instance Data"
|
||||
hosts = ["nuke", "nukeassist"]
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
# presets
|
||||
sync_workfile_version_on_families = []
|
||||
|
||||
|
|
@ -12,6 +12,8 @@ class CollectNukeReads(pyblish.api.InstancePlugin):
|
|||
hosts = ["nuke", "nukeassist"]
|
||||
families = ["source"]
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
def process(self, instance):
|
||||
self.log.debug("checking instance: {}".format(instance))
|
||||
|
||||
|
|
@ -10,6 +10,8 @@ class CollectSlate(pyblish.api.InstancePlugin):
|
|||
hosts = ["nuke"]
|
||||
families = ["render"]
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
def process(self, instance):
|
||||
node = instance.data["transientData"]["node"]
|
||||
|
||||
|
|
@ -11,6 +11,8 @@ class CollectWorkfile(pyblish.api.InstancePlugin):
|
|||
hosts = ['nuke']
|
||||
families = ["workfile"]
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
def process(self, instance): # sourcery skip: avoid-builtin-shadow
|
||||
|
||||
script_data = instance.context.data["scriptData"]
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import os
|
||||
import nuke
|
||||
import pyblish.api
|
||||
from ayon_core.hosts.nuke import api as napi
|
||||
from ayon_nuke import api as napi
|
||||
from ayon_core.pipeline import publish
|
||||
|
||||
|
||||
|
|
@ -14,6 +14,8 @@ class CollectNukeWrites(pyblish.api.InstancePlugin,
|
|||
hosts = ["nuke", "nukeassist"]
|
||||
families = ["render", "prerender", "image"]
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
# cache
|
||||
_write_nodes = {}
|
||||
_frame_ranges = {}
|
||||
|
|
@ -5,7 +5,7 @@ import nuke
|
|||
import pyblish.api
|
||||
|
||||
from ayon_core.pipeline import publish
|
||||
from ayon_core.hosts.nuke.api.lib import (
|
||||
from ayon_nuke.api.lib import (
|
||||
maintained_selection,
|
||||
reset_selection,
|
||||
select_nodes
|
||||
|
|
@ -25,6 +25,8 @@ class ExtractBackdropNode(publish.Extractor):
|
|||
hosts = ["nuke"]
|
||||
families = ["nukenodes"]
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
def process(self, instance):
|
||||
tmp_nodes = []
|
||||
child_nodes = instance.data["transientData"]["childNodes"]
|
||||
|
|
@ -6,7 +6,7 @@ import nuke
|
|||
import pyblish.api
|
||||
|
||||
from ayon_core.pipeline import publish
|
||||
from ayon_core.hosts.nuke.api.lib import maintained_selection
|
||||
from ayon_nuke.api.lib import maintained_selection
|
||||
|
||||
|
||||
class ExtractCamera(publish.Extractor):
|
||||
|
|
@ -17,6 +17,8 @@ class ExtractCamera(publish.Extractor):
|
|||
families = ["camera"]
|
||||
hosts = ["nuke"]
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
# presets
|
||||
write_geo_knobs = [
|
||||
("file_type", "abc"),
|
||||
|
|
@ -4,8 +4,8 @@ import nuke
|
|||
import pyblish.api
|
||||
|
||||
from ayon_core.pipeline import publish
|
||||
from ayon_core.hosts.nuke.api import utils as pnutils
|
||||
from ayon_core.hosts.nuke.api.lib import (
|
||||
from ayon_nuke.api import utils as pnutils
|
||||
from ayon_nuke.api.lib import (
|
||||
maintained_selection,
|
||||
reset_selection,
|
||||
select_nodes
|
||||
|
|
@ -23,6 +23,8 @@ class ExtractGizmo(publish.Extractor):
|
|||
hosts = ["nuke"]
|
||||
families = ["gizmo"]
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
def process(self, instance):
|
||||
tmp_nodes = []
|
||||
orig_grpn = instance.data["transientData"]["node"]
|
||||
|
|
@ -15,6 +15,8 @@ class ExtractRenderOnFarm(pyblish.api.InstancePlugin):
|
|||
hosts = ["nuke"]
|
||||
families = ["render_on_farm"]
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
def process(self, instance):
|
||||
if not instance.context.data.get("render_on_farm", False):
|
||||
return
|
||||
|
|
@ -4,7 +4,7 @@ import nuke
|
|||
import pyblish.api
|
||||
|
||||
from ayon_core.pipeline import publish
|
||||
from ayon_core.hosts.nuke.api.lib import (
|
||||
from ayon_nuke.api.lib import (
|
||||
maintained_selection,
|
||||
select_nodes
|
||||
)
|
||||
|
|
@ -18,6 +18,8 @@ class ExtractModel(publish.Extractor):
|
|||
families = ["model"]
|
||||
hosts = ["nuke"]
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
# presets
|
||||
write_geo_knobs = [
|
||||
("file_type", "abc"),
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import nuke
|
||||
import pyblish.api
|
||||
from ayon_core.hosts.nuke.api.lib import maintained_selection
|
||||
from ayon_nuke.api.lib import maintained_selection
|
||||
|
||||
|
||||
class CreateOutputNode(pyblish.api.ContextPlugin):
|
||||
|
|
@ -11,7 +11,9 @@ class CreateOutputNode(pyblish.api.ContextPlugin):
|
|||
label = 'Output Node Create'
|
||||
order = pyblish.api.ExtractorOrder + 0.4
|
||||
families = ["workfile"]
|
||||
hosts = ['nuke']
|
||||
hosts = ["nuke"]
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
def process(self, context):
|
||||
# capture selection state
|
||||
|
|
@ -10,7 +10,7 @@ class ExtractOutputDirectory(pyblish.api.InstancePlugin):
|
|||
label = "Output Directory"
|
||||
optional = True
|
||||
|
||||
# targets = ["process"]
|
||||
settings_category = "nuke"
|
||||
|
||||
def process(self, instance):
|
||||
|
||||
|
|
@ -4,7 +4,7 @@ import shutil
|
|||
import pyblish.api
|
||||
import clique
|
||||
import nuke
|
||||
from ayon_core.hosts.nuke import api as napi
|
||||
from ayon_nuke import api as napi
|
||||
from ayon_core.pipeline import publish
|
||||
from ayon_core.lib import collect_frames
|
||||
|
||||
|
|
@ -25,6 +25,8 @@ class NukeRenderLocal(publish.Extractor,
|
|||
hosts = ["nuke"]
|
||||
families = ["render.local", "prerender.local", "image.local"]
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
def process(self, instance):
|
||||
child_nodes = (
|
||||
instance.data.get("transientData", {}).get("childNodes")
|
||||
|
|
@ -16,6 +16,8 @@ class ExtractReviewData(publish.Extractor):
|
|||
families = ["review"]
|
||||
hosts = ["nuke"]
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
def process(self, instance):
|
||||
fpath = instance.data["path"]
|
||||
ext = os.path.splitext(fpath)[-1][1:]
|
||||
|
|
@ -2,8 +2,8 @@ import os
|
|||
import pyblish.api
|
||||
|
||||
from ayon_core.pipeline import publish
|
||||
from ayon_core.hosts.nuke.api import plugin
|
||||
from ayon_core.hosts.nuke.api.lib import maintained_selection
|
||||
from ayon_nuke.api import plugin
|
||||
from ayon_nuke.api.lib import maintained_selection
|
||||
|
||||
|
||||
class ExtractReviewDataLut(publish.Extractor):
|
||||
|
|
@ -19,6 +19,8 @@ class ExtractReviewDataLut(publish.Extractor):
|
|||
families = ["review"]
|
||||
hosts = ["nuke"]
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
def process(self, instance):
|
||||
self.log.debug("Creating staging dir...")
|
||||
if "representations" in instance.data:
|
||||
|
|
@ -4,8 +4,8 @@ from pprint import pformat
|
|||
import pyblish.api
|
||||
|
||||
from ayon_core.pipeline import publish
|
||||
from ayon_core.hosts.nuke.api import plugin
|
||||
from ayon_core.hosts.nuke.api.lib import maintained_selection
|
||||
from ayon_nuke.api import plugin
|
||||
from ayon_nuke.api.lib import maintained_selection
|
||||
|
||||
|
||||
class ExtractReviewIntermediates(publish.Extractor):
|
||||
|
|
@ -22,6 +22,8 @@ class ExtractReviewIntermediates(publish.Extractor):
|
|||
families = ["review"]
|
||||
hosts = ["nuke"]
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
# presets
|
||||
viewer_lut_raw = None
|
||||
outputs = {}
|
||||
|
|
@ -136,7 +138,6 @@ class ExtractReviewIntermediates(publish.Extractor):
|
|||
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"):
|
||||
|
|
@ -6,7 +6,9 @@ class ExtractScriptSave(pyblish.api.InstancePlugin):
|
|||
"""Save current Nuke workfile script"""
|
||||
label = 'Script Save'
|
||||
order = pyblish.api.ExtractorOrder - 0.1
|
||||
hosts = ['nuke']
|
||||
hosts = ["nuke"]
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
def process(self, instance):
|
||||
|
||||
|
|
@ -7,7 +7,7 @@ import pyblish.api
|
|||
import six
|
||||
|
||||
from ayon_core.pipeline import publish
|
||||
from ayon_core.hosts.nuke.api import (
|
||||
from ayon_nuke.api import (
|
||||
maintained_selection,
|
||||
duplicate_node,
|
||||
get_view_process_node
|
||||
|
|
@ -27,6 +27,8 @@ class ExtractSlateFrame(publish.Extractor):
|
|||
families = ["slate"]
|
||||
hosts = ["nuke"]
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
# Settings values
|
||||
key_value_mapping = {
|
||||
"f_submission_note": {
|
||||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
import nuke
|
||||
import pyblish.api
|
||||
|
||||
|
|
@ -10,7 +9,9 @@ class IncrementScriptVersion(pyblish.api.ContextPlugin):
|
|||
label = "Increment Script Version"
|
||||
optional = True
|
||||
families = ["workfile"]
|
||||
hosts = ['nuke']
|
||||
hosts = ["nuke"]
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
def process(self, context):
|
||||
if not context.data.get("increment_script_version", True):
|
||||
|
|
@ -9,7 +9,9 @@ class RemoveOutputNode(pyblish.api.ContextPlugin):
|
|||
label = 'Output Node Remove'
|
||||
order = pyblish.api.IntegratorOrder + 0.4
|
||||
families = ["workfile"]
|
||||
hosts = ['nuke']
|
||||
hosts = ["nuke"]
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
def process(self, context):
|
||||
try:
|
||||
|
|
@ -10,7 +10,7 @@ from ayon_core.pipeline.publish import (
|
|||
PublishXmlValidationError,
|
||||
OptionalPyblishPluginMixin
|
||||
)
|
||||
from ayon_core.hosts.nuke.api import SelectInstanceNodeAction
|
||||
from ayon_nuke.api import SelectInstanceNodeAction
|
||||
|
||||
|
||||
class ValidateCorrectAssetContext(
|
||||
|
|
@ -34,6 +34,8 @@ class ValidateCorrectAssetContext(
|
|||
]
|
||||
optional = True
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
@classmethod
|
||||
def apply_settings(cls, project_settings):
|
||||
"""Apply deprecated settings from project settings.
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import nuke
|
||||
import pyblish
|
||||
from ayon_core.hosts.nuke import api as napi
|
||||
from ayon_nuke import api as napi
|
||||
|
||||
from ayon_core.pipeline.publish import (
|
||||
ValidateContentsOrder,
|
||||
|
|
@ -65,6 +65,8 @@ class ValidateBackdrop(
|
|||
hosts = ["nuke"]
|
||||
actions = [SelectCenterInNodeGraph]
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
def process(self, instance):
|
||||
if not self.is_active(instance.data):
|
||||
return
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import pyblish.api
|
||||
|
||||
from ayon_core.pipeline.publish import get_errored_instances_from_context
|
||||
from ayon_core.hosts.nuke.api.lib import link_knobs
|
||||
from ayon_nuke.api.lib import link_knobs
|
||||
from ayon_core.pipeline.publish import (
|
||||
OptionalPyblishPluginMixin,
|
||||
PublishValidationError
|
||||
|
|
@ -52,6 +52,9 @@ class ValidateExposedKnobs(
|
|||
label = "Validate Exposed Knobs"
|
||||
actions = [RepairExposedKnobs]
|
||||
hosts = ["nuke"]
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
product_types_mapping = {
|
||||
"render": "CreateWriteRender",
|
||||
"prerender": "CreateWritePrerender",
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import pyblish
|
||||
from ayon_core.pipeline import PublishXmlValidationError
|
||||
from ayon_core.hosts.nuke import api as napi
|
||||
from ayon_nuke import api as napi
|
||||
import nuke
|
||||
|
||||
|
||||
|
|
@ -43,6 +43,8 @@ class ValidateGizmo(pyblish.api.InstancePlugin):
|
|||
hosts = ["nuke"]
|
||||
actions = [OpenFailedGroupNode]
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
def process(self, instance):
|
||||
grpn = instance.data["transientData"]["node"]
|
||||
|
||||
|
|
@ -32,6 +32,8 @@ class ValidateKnobs(pyblish.api.ContextPlugin):
|
|||
actions = [RepairContextAction]
|
||||
optional = True
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
knobs = "{}"
|
||||
|
||||
def process(self, context):
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import pyblish.api
|
||||
|
||||
from ayon_core.hosts.nuke import api as napi
|
||||
from ayon_nuke import api as napi
|
||||
from ayon_core.pipeline.publish import RepairAction
|
||||
from ayon_core.pipeline import (
|
||||
PublishXmlValidationError,
|
||||
|
|
@ -27,6 +27,8 @@ class ValidateOutputResolution(
|
|||
hosts = ["nuke"]
|
||||
actions = [RepairAction]
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
missing_msg = "Missing Reformat node in render group node"
|
||||
resolution_msg = "Reformat is set to wrong format"
|
||||
|
||||
|
|
@ -25,6 +25,8 @@ class ValidateProxyMode(pyblish.api.ContextPlugin):
|
|||
hosts = ["nuke"]
|
||||
actions = [FixProxyMode]
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
def process(self, context):
|
||||
|
||||
rootNode = nuke.root()
|
||||
|
|
@ -54,6 +54,8 @@ class ValidateRenderedFrames(pyblish.api.InstancePlugin):
|
|||
hosts = ["nuke", "nukestudio"]
|
||||
actions = [RepairCollectionActionToLocal, RepairCollectionActionToFarm]
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
def process(self, instance):
|
||||
node = instance.data["transientData"]["node"]
|
||||
|
||||
|
|
@ -5,7 +5,7 @@ from ayon_core.pipeline import (
|
|||
OptionalPyblishPluginMixin
|
||||
)
|
||||
from ayon_core.pipeline.publish import RepairAction
|
||||
from ayon_core.hosts.nuke.api.lib import (
|
||||
from ayon_nuke.api.lib import (
|
||||
WorkfileSettings
|
||||
)
|
||||
|
||||
|
|
@ -23,6 +23,8 @@ class ValidateScriptAttributes(
|
|||
optional = True
|
||||
actions = [RepairAction]
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
def process(self, instance):
|
||||
if not self.is_active(instance.data):
|
||||
return
|
||||
|
|
@ -2,7 +2,7 @@ from collections import defaultdict
|
|||
|
||||
import pyblish.api
|
||||
from ayon_core.pipeline.publish import get_errored_instances_from_context
|
||||
from ayon_core.hosts.nuke.api.lib import (
|
||||
from ayon_nuke.api.lib import (
|
||||
get_write_node_template_attr,
|
||||
set_node_knobs_from_settings,
|
||||
color_gui_to_int
|
||||
|
|
@ -59,6 +59,8 @@ class ValidateNukeWriteNode(
|
|||
actions = [RepairNukeWriteNodeAction]
|
||||
hosts = ["nuke"]
|
||||
|
||||
settings_category = "nuke"
|
||||
|
||||
def process(self, instance):
|
||||
if not self.is_active(instance.data):
|
||||
return
|
||||
|
|
@ -4,7 +4,7 @@ from ayon_core.pipeline.workfile.workfile_template_builder import (
|
|||
CreatePlaceholderItem,
|
||||
PlaceholderCreateMixin,
|
||||
)
|
||||
from ayon_core.hosts.nuke.api.lib import (
|
||||
from ayon_nuke.api.lib import (
|
||||
find_free_space_to_paste_nodes,
|
||||
get_extreme_positions,
|
||||
get_group_io_nodes,
|
||||
|
|
@ -18,7 +18,7 @@ from ayon_core.hosts.nuke.api.lib import (
|
|||
duplicate_node,
|
||||
node_tempfile,
|
||||
)
|
||||
from ayon_core.hosts.nuke.api.workfile_template_builder import (
|
||||
from ayon_nuke.api.workfile_template_builder import (
|
||||
NukePlaceholderPlugin
|
||||
)
|
||||
|
||||
|
|
@ -4,7 +4,7 @@ from ayon_core.pipeline.workfile.workfile_template_builder import (
|
|||
LoadPlaceholderItem,
|
||||
PlaceholderLoadMixin,
|
||||
)
|
||||
from ayon_core.hosts.nuke.api.lib import (
|
||||
from ayon_nuke.api.lib import (
|
||||
find_free_space_to_paste_nodes,
|
||||
get_extreme_positions,
|
||||
get_group_io_nodes,
|
||||
|
|
@ -18,7 +18,7 @@ from ayon_core.hosts.nuke.api.lib import (
|
|||
duplicate_node,
|
||||
node_tempfile,
|
||||
)
|
||||
from ayon_core.hosts.nuke.api.workfile_template_builder import (
|
||||
from ayon_nuke.api.workfile_template_builder import (
|
||||
NukePlaceholderPlugin
|
||||
)
|
||||
|
||||
|
|
@ -3,7 +3,7 @@ import os
|
|||
import nuke
|
||||
import nukescripts
|
||||
from ayon_core.pipeline import Anatomy, get_current_project_name
|
||||
from ayon_core.hosts.nuke.api.lib import (
|
||||
from ayon_nuke.api.lib import (
|
||||
set_node_knobs_from_settings,
|
||||
get_nuke_imageio_settings
|
||||
)
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue