mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 13:24:54 +01:00
Merged in tokejepsen/pype/hotfix/publish_new_writes (pull request #246)
Fix publishing for new write instances.
This commit is contained in:
commit
bfdb1bc379
3 changed files with 23 additions and 17 deletions
|
|
@ -49,7 +49,14 @@ class CollectNukeInstances(pyblish.api.ContextPlugin):
|
|||
|
||||
# Create instance
|
||||
instance = context.create_instance(subset)
|
||||
instance.add(node)
|
||||
instance.append(node)
|
||||
|
||||
# Add all nodes in group instances.
|
||||
if node.Class() == "Group":
|
||||
node.begin()
|
||||
for i in nuke.allNodes():
|
||||
instance.append(i)
|
||||
node.end()
|
||||
|
||||
family = avalon_knob_data["families"]
|
||||
if node["render"].value():
|
||||
|
|
|
|||
|
|
@ -14,24 +14,17 @@ class CollectNukeWrites(pyblish.api.InstancePlugin):
|
|||
families = ["render", "render.local", "render.farm"]
|
||||
|
||||
def process(self, instance):
|
||||
# if not instance.data["publish"]:
|
||||
# continue
|
||||
|
||||
group = instance[0]
|
||||
node = None
|
||||
for x in instance:
|
||||
if x.Class() == "Write":
|
||||
node = x
|
||||
|
||||
if group.Class() != "Group":
|
||||
if node is None:
|
||||
return
|
||||
|
||||
self.log.debug("checking instance: {}".format(instance))
|
||||
|
||||
group.begin()
|
||||
|
||||
for n in nuke.allNodes():
|
||||
if n.Class() != "Write":
|
||||
continue
|
||||
node = n
|
||||
group.end()
|
||||
|
||||
# Determine defined file type
|
||||
ext = node["file_type"].value()
|
||||
|
||||
|
|
@ -120,7 +113,5 @@ class CollectNukeWrites(pyblish.api.InstancePlugin):
|
|||
"outputType": output_type,
|
||||
"colorspace": node["colorspace"].value(),
|
||||
})
|
||||
|
||||
instance.insert(1, instance[0])
|
||||
instance[0] = node
|
||||
|
||||
self.log.debug("instance.data: {}".format(instance.data))
|
||||
|
|
|
|||
|
|
@ -20,7 +20,10 @@ class NukeRenderLocal(pype.api.Extractor):
|
|||
families = ["render.local"]
|
||||
|
||||
def process(self, instance):
|
||||
node = instance[0]
|
||||
node = None
|
||||
for x in instance:
|
||||
if x.Class() == "Write":
|
||||
node = x
|
||||
|
||||
self.log.debug("instance collected: {}".format(instance.data))
|
||||
|
||||
|
|
@ -32,6 +35,11 @@ class NukeRenderLocal(pype.api.Extractor):
|
|||
self.log.info("Start frame: {}".format(first_frame))
|
||||
self.log.info("End frame: {}".format(last_frame))
|
||||
|
||||
# Ensure output directory exists.
|
||||
directory = os.path.dirname(node["file"].value())
|
||||
if not os.path.exists(directory):
|
||||
os.makedirs(directory)
|
||||
|
||||
# Render frames
|
||||
nuke.execute(
|
||||
node_subset_name,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue