cleaning up plugins/nuke/publish/*, updating collecting writes and render local

This commit is contained in:
Jakub Jezek 2018-11-29 18:41:47 +01:00
parent fe2162cbd2
commit cb69f0dce1
15 changed files with 24 additions and 25 deletions

View file

@ -125,7 +125,7 @@ class SubmitDependentImageSequenceJobDeadline(pyblish.api.InstancePlugin):
hosts = ["fusion", "maya", "nuke"]
families = [
"saver.deadline",
"render",
"renderlayer",
"imagesequence"
]

View file

@ -1,7 +1,7 @@
from avalon import api
class NukeSelectContainers(api.InventoryAction):
class SelectContainers(api.InventoryAction):
label = "Select Containers"
icon = "mouse-pointer"

View file

@ -5,7 +5,7 @@
from avalon import api
class NukeSetFrameRangeLoader(api.Loader):
class SetFrameRangeLoader(api.Loader):
"""Specific loader of Alembic for the avalon.animation family"""
families = ["animation",
@ -38,7 +38,7 @@ class NukeSetFrameRangeLoader(api.Loader):
lib.update_frame_range(start, end)
class NukeSetFrameRangeWithHandlesLoader(api.Loader):
class SetFrameRangeWithHandlesLoader(api.Loader):
"""Specific loader of Alembic for the avalon.animation family"""
families = ["animation",

View file

@ -118,7 +118,7 @@ def loader_shift(node, frame, relative=True):
return int(shift)
class NukeLoadSequence(api.Loader):
class LoadSequence(api.Loader):
"""Load image sequence into Nuke"""
families = ["imagesequence"]

View file

@ -34,24 +34,24 @@ class CollectNukeWrites(pyblish.api.ContextPlugin):
output_type = "mov"
# Get frame range
start_frame = int(nuke.root()["first_frame"].getValue())
end_frame = int(nuke.root()["last_frame"].getValue())
first_frame = int(nuke.root()["first_frame"].getValue())
last_frame = int(nuke.root()["last_frame"].getValue())
if node["use_limit"].getValue():
start_frame = int(node["first"].getValue())
end_frame = int(node["last"].getValue())
first_frame = int(node["first"].getValue())
last_frame = int(node["last"].getValue())
# Add collection
collection = None
path = nuke.filename(node)
path += " [{0}-{1}]".format(start_frame, end_frame)
path += " [{0}-{1}]".format(first_frame, last_frame)
collection = clique.parse(path)
subset = node.name()
# Include start and end render frame in label
label = "{subset} ({start}-{end})".format(subset=subset,
start=int(start_frame),
end=int(end_frame))
start=int(first_frame),
end=int(last_frame))
# Create instance
instance = context.create_instance(subset)
@ -71,7 +71,6 @@ class CollectNukeWrites(pyblish.api.ContextPlugin):
else:
value = False
instance.data.update({
"asset": os.environ["AVALON_ASSET"], # todo: not a constant
"path": nuke.filename(node),
@ -83,12 +82,11 @@ class CollectNukeWrites(pyblish.api.ContextPlugin):
"family": "write",
"publish": value,
"collection": collection,
"start_frame": start_frame,
"end_frame": end_frame,
"first_frame": first_frame,
"last_frame": last_frame,
"output_type": output_type
})
instances.append(instance)
self.log.info("writeNode collected: {}".format(subset))
context.data["write_instances"] = instances

View file

@ -20,7 +20,7 @@ class ExtractOutputDirectory(pyblish.api.InstancePlugin):
path = instance.data["collection"].format()
if "output_path" in instance.data.keys():
path = instance.data["output_path"]
path = instance.data["path"]
if not path:
return

View file

@ -1,6 +1,5 @@
import pyblish.api
import avalon.fusion as fusion
import nuke
class NukeRenderLocal(pyblish.api.InstancePlugin):
@ -28,17 +27,19 @@ class NukeRenderLocal(pyblish.api.InstancePlugin):
else:
context.data[key] = True
current_comp = context.data["currentFile"]
start_frame = instance.data["startFrame"]
end_frame = instance.data["end_frame"]
self.log.debug("instance collected: {}".format(instance.data))
first_frame = instance.data.get("first_frame", None)
last_frame = instance.data.get("last_frame", None)
node_subset_name = instance.data.get("subset", None)
self.log.info("Starting render")
self.log.info("Start frame: {}".format(start_frame))
self.log.info("End frame: {}".format(end_frame))
self.log.info("Start frame: {}".format(first_frame))
self.log.info("End frame: {}".format(last_frame))
# Render frames
result = nuke.execute(
node.name(),
node_subset_name,
int(first_frame),
int(last_frame)
)