mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
Merge pull request #4556 from ynput/feature/OP-5006_Nuke-publish-colorspaceData-from-rendered-images
This commit is contained in:
commit
f5ef4597b2
6 changed files with 61 additions and 44 deletions
|
|
@ -3,12 +3,14 @@ from pprint import pformat
|
|||
import nuke
|
||||
import pyblish.api
|
||||
from openpype.hosts.nuke import api as napi
|
||||
from openpype.pipeline import publish
|
||||
|
||||
|
||||
class CollectNukeWrites(pyblish.api.InstancePlugin):
|
||||
class CollectNukeWrites(pyblish.api.InstancePlugin,
|
||||
publish.ColormanagedPyblishPluginMixin):
|
||||
"""Collect all write nodes."""
|
||||
|
||||
order = pyblish.api.CollectorOrder - 0.48
|
||||
order = pyblish.api.CollectorOrder + 0.0021
|
||||
label = "Collect Writes"
|
||||
hosts = ["nuke", "nukeassist"]
|
||||
families = ["render", "prerender", "image"]
|
||||
|
|
@ -66,6 +68,9 @@ class CollectNukeWrites(pyblish.api.InstancePlugin):
|
|||
write_file_path = nuke.filename(write_node)
|
||||
output_dir = os.path.dirname(write_file_path)
|
||||
|
||||
# get colorspace and add to version data
|
||||
colorspace = napi.get_colorspace_from_node(write_node)
|
||||
|
||||
self.log.debug('output dir: {}'.format(output_dir))
|
||||
|
||||
if render_target == "frames":
|
||||
|
|
@ -128,6 +133,12 @@ class CollectNukeWrites(pyblish.api.InstancePlugin):
|
|||
else:
|
||||
representation['files'] = collected_frames
|
||||
|
||||
# inject colorspace data
|
||||
self.set_representation_colorspace(
|
||||
representation, instance.context,
|
||||
colorspace=colorspace
|
||||
)
|
||||
|
||||
instance.data["representations"].append(representation)
|
||||
self.log.info("Publishing rendered frames ...")
|
||||
|
||||
|
|
@ -145,8 +156,7 @@ class CollectNukeWrites(pyblish.api.InstancePlugin):
|
|||
instance.data["farm"] = True
|
||||
self.log.info("Farm rendering ON ...")
|
||||
|
||||
# get colorspace and add to version data
|
||||
colorspace = napi.get_colorspace_from_node(write_node)
|
||||
# TODO: remove this when we have proper colorspace support
|
||||
version_data = {
|
||||
"colorspace": colorspace
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,12 +4,13 @@ import shutil
|
|||
import pyblish.api
|
||||
import clique
|
||||
import nuke
|
||||
|
||||
from openpype.hosts.nuke import api as napi
|
||||
from openpype.pipeline import publish
|
||||
from openpype.lib import collect_frames
|
||||
|
||||
|
||||
class NukeRenderLocal(publish.ExtractorColormanaged):
|
||||
class NukeRenderLocal(publish.Extractor,
|
||||
publish.ColormanagedPyblishPluginMixin):
|
||||
"""Render the current Nuke composition locally.
|
||||
|
||||
Extract the result of savers by starting a comp render
|
||||
|
|
@ -85,7 +86,7 @@ class NukeRenderLocal(publish.ExtractorColormanaged):
|
|||
)
|
||||
|
||||
ext = node["file_type"].value()
|
||||
colorspace = node["colorspace"].value()
|
||||
colorspace = napi.get_colorspace_from_node(node)
|
||||
|
||||
if "representations" not in instance.data:
|
||||
instance.data["representations"] = []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue