mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
nuke fixing deadline submission
This commit is contained in:
parent
71e63ec3e9
commit
a9257df48e
5 changed files with 29 additions and 19 deletions
|
|
@ -1460,14 +1460,13 @@ class ExporterReviewMov(ExporterReview):
|
|||
self.log.info("Rendered...")
|
||||
|
||||
def save_file(self):
|
||||
import shutil
|
||||
with anlib.maintained_selection():
|
||||
self.log.info("Saving nodes as file... ")
|
||||
# select temp nodes
|
||||
anlib.select_nodes(self._temp_nodes)
|
||||
# create nk path
|
||||
path = os.path.splitext(self.path)[0] + ".nk"
|
||||
# save file to the path
|
||||
nuke.nodeCopy(path)
|
||||
shutil.copyfile(self.instance.context.data["currentFile"], path)
|
||||
|
||||
self.log.info("Nodes exported...")
|
||||
return path
|
||||
|
|
@ -1524,6 +1523,7 @@ class ExporterReviewMov(ExporterReview):
|
|||
|
||||
# ---------- render or save to nk
|
||||
if farm:
|
||||
nuke.scriptSave()
|
||||
path_nk = self.save_file()
|
||||
self.data.update({
|
||||
"bakeScriptPath": path_nk,
|
||||
|
|
@ -1542,7 +1542,7 @@ class ExporterReviewMov(ExporterReview):
|
|||
|
||||
#---------- Clean up
|
||||
self.clean_nodes()
|
||||
|
||||
nuke.scriptSave()
|
||||
return self.data
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -16,23 +16,26 @@ class ExtractReviewDataMov(pype.api.Extractor):
|
|||
order = pyblish.api.ExtractorOrder + 0.01
|
||||
label = "Extract Review Data Mov"
|
||||
|
||||
families = ["review"]
|
||||
families = ["review", "render", "render.local"]
|
||||
hosts = ["nuke"]
|
||||
|
||||
def process(self, instance):
|
||||
families = instance.data["families"]
|
||||
|
||||
self.log.info("Creating staging dir...")
|
||||
self.log.debug(
|
||||
"__ representations: `{}`".format(
|
||||
instance.data["representations"]))
|
||||
if "representations" in instance.data:
|
||||
staging_dir = instance.data[
|
||||
"representations"][0]["stagingDir"].replace("\\", "/")
|
||||
instance.data["stagingDir"] = staging_dir
|
||||
instance.data["representations"][0]["tags"] = []
|
||||
else:
|
||||
instance.data["representations"] = []
|
||||
# get output path
|
||||
render_path = instance.data['path']
|
||||
staging_dir = os.path.normpath(os.path.dirname(render_path))
|
||||
instance.data["stagingDir"] = staging_dir
|
||||
if instance.data["representations"] == []:
|
||||
render_path = instance.data['path']
|
||||
staging_dir = os.path.normpath(os.path.dirname(render_path))
|
||||
instance.data["stagingDir"] = staging_dir
|
||||
else:
|
||||
staging_dir = instance.data[
|
||||
"representations"][0]["stagingDir"].replace("\\", "/")
|
||||
instance.data["representations"][0]["tags"] = []
|
||||
instance.data["stagingDir"] = staging_dir
|
||||
|
||||
self.log.info(
|
||||
"StagingDir `{0}`...".format(instance.data["stagingDir"]))
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ class ExtractSlateFrame(pype.api.Extractor):
|
|||
|
||||
# fill slate node with comments
|
||||
self.add_comment_slate_node(instance)
|
||||
|
||||
|
||||
# Render frames
|
||||
nuke.execute(write_node.name(), int(first_frame), int(last_frame))
|
||||
|
||||
|
|
@ -149,3 +149,4 @@ class ExtractSlateFrame(pype.api.Extractor):
|
|||
node["f_submitting_for"].setValue(intent)
|
||||
except NameError:
|
||||
return
|
||||
instance.data.pop("slateNode")
|
||||
|
|
|
|||
|
|
@ -30,9 +30,15 @@ class ExtractThumbnail(pype.api.Extractor):
|
|||
def render_thumbnail(self, instance):
|
||||
node = instance[0] # group node
|
||||
self.log.info("Creating staging dir...")
|
||||
self.log.debug(
|
||||
"_ representations `{0}`".format(instance.data["representations"]))
|
||||
if "representations" in instance.data:
|
||||
staging_dir = instance.data[
|
||||
"representations"][0]["stagingDir"].replace("\\", "/")
|
||||
try:
|
||||
staging_dir = instance.data[
|
||||
"representations"][0]["stagingDir"].replace("\\", "/")
|
||||
except IndexError:
|
||||
path = instance.data["path"]
|
||||
staging_dir = os.path.dirname(path)
|
||||
instance.data["stagingDir"] = staging_dir
|
||||
else:
|
||||
instance.data["representations"] = []
|
||||
|
|
|
|||
|
|
@ -16,6 +16,6 @@ log = Logger().get_logger(__name__, "nuke")
|
|||
nuke.addOnScriptSave(onScriptLoad)
|
||||
nuke.addOnScriptLoad(checkInventoryVersions)
|
||||
nuke.addOnScriptSave(checkInventoryVersions)
|
||||
nuke.addOnScriptSave(writes_version_sync)
|
||||
# nuke.addOnScriptSave(writes_version_sync)
|
||||
|
||||
log.info('Automatic syncing of write file knob to script version')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue