Skip to content

Commit

Permalink
Changed naming in autorender script, fixed bug for deadline renderfarm.
Browse files Browse the repository at this point in the history
  • Loading branch information
gillesvink committed Sep 25, 2020
1 parent 8af906f commit 0040d42
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gizmos/WriteTank.gizmo
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,9 @@ Gizmo {
Write {
file "\[python __import__('nuke')._shotgun_write_node_handler.on_compute_path_gizmo_callback() if hasattr(__import__('nuke'), '_shotgun_write_node_handler') else nuke.thisParent().knob('cached_path').value()]"
proxy "\[python __import__('nuke')._shotgun_write_node_handler.on_compute_proxy_path_gizmo_callback() if hasattr(__import__('nuke'), '_shotgun_write_node_handler') else nuke.thisParent().knob('tk_cached_proxy_path').value()]"
beforeRender "#Before render\nimport shutil\nimport os\n\nNFA_Write = nuke.thisNode()\ncreatedirectories = NFA_Write.knob('create_directories').getValue()\n\nread = 'source'\nwrite = 'render'\n\n\n#setting paths to other location for rendering\nshotgunpath = NFA_Write.knob('file').getValue()\nrenderpath = nuke.thisParent().knob('cached_path').value()\n\nwritepath = renderpath.replace(read, write, 2)\nNFA_Write.knob('file').setValue(writepath)\nNFA_Write.knob('create_directories').setValue(1)"
afterFrameRender "#After each frame\n#converts the, for example, '%04d' to a readable format\npadding_length = re.findall(r'\\d+', writepath)\[-1]\npadding = '%' + padding_length + 'd'\n\nframenr = padding % nuke.frame()\n\nwritepath_framenr = writepath.replace(padding, framenr, 1)\n\n#copy the rendered file back to the original location\nfolder_render = os.path.dirname(renderpath)\n\n#detecting if folder exists and creating if necessary\nfolder_render_exists = os.path.isdir(folder_render)\n\nif folder_render_exists == False:\n try:\n os.makedirs(folder_render)\n except:\n print(\"an error has occured\")\n\ncopyfile = shutil.copy(writepath_framenr, folder_render)\n"
afterRender "#After render\n#setting render path back to start state\nNFA_Write.knob('file').setValue(shotgunpath)\nNFA_Write.knob('create_directories').setValue(createdirectories)"
beforeRender "#Before render\nimport shutil\nimport os\nimport re\n\nNFA_Write = nuke.thisNode()\ncreateDirectories = NFA_Write.knob('create_directories').getValue()\n\nreadServer = 'source'\nwriteServer = 'render'\n\n\n#setting paths to other location for rendering\nshotgunPath = NFA_Write.knob('file').getValue()\nrenderPath = nuke.thisParent().knob('cached_path').value()\n\nwritePath = renderPath.replace(readServer, writeServer, 2)\nNFA_Write.knob('file').setValue(writePath)\nNFA_Write.knob('create_directories').setValue(1)"
afterFrameRender "#After each frame\n#converts the, for example, '%04d' to a readable format\npaddingLength = re.findall(r'\\d+', writePath)\[-1]\npadding = '%' + paddingLength + 'd'\n\nframenr = padding % nuke.frame()\n\nwritepath_framenr = writePath.replace(padding, framenr, 1)\n\n#copy the rendered file back to the original location\nfolder_render = os.path.dirname(renderPath)\n\n#detecting if folder exists and creating if necessary\nfolder_render_exists = os.path.isdir(folder_render)\n\nif not folder_render_exists:\n try:\n os.makedirs(folder_render)\n except:\n print(\"an error has occured\")\n\ncopyFile = shutil.copy(writepath_framenr, folder_render)"
afterRender "#After render\n#setting render path back to start state\nNFA_Write.knob('file').setValue(shotgunPath)\nNFA_Write.knob('create_directories').setValue(createDirectories)"
name Write1
xpos 195
ypos -34
Expand Down

0 comments on commit 0040d42

Please sign in to comment.