Skip to content

Instantly share code, notes, and snippets.

@jeangjenq
jeangjenq / README.md
Created October 17, 2019 05:51 — forked from jedypod/README.md
Nuke ffmpeg Render

Nuke ffmpeg Render

Writeffmpeg is a python script and a node that allows you to render from Nuke directly into ffmpeg. Instead of a 2 step process where you render from Nuke to a temporary image sequence that you then transcode using ffmpeg, this solution writes to a single uint16 cache tiff file and this data gets piped into ffmpeg.

I've included a little screen recordingto help demo how it works.

Files

ffmpeg_render.py Writeffmpeg.nk

Dependencies

@jeangjenq
jeangjenq / tcl_snippets.tcl
Last active July 6, 2024 18:25
TCL snippets for Nuke.
# Get input node name
[value this.input0.name][python nuke.thisNode().input(0).name()]
# Set a variable in expression with TCL:
[set VARIABLENAME VALUE; return]
# Use a variable
$VARIABLENAME
# String Operation that return the 5th character from top input name
@jeangjenq
jeangjenq / python_snippets.py
Created March 20, 2022 03:41
Python snippets for Nuke.
# Get the last letter/section from node name, separated by "_":
nuke.thisNode().name().rsplit("_").__getitem__(2)
# From the above, can be modified to acquire file extension
nuke.thisNode()['file'].getValue().rsplit(".").__getitem__(2)
# Set expression with python found in the link below, especially useful when setting expression to a dropdown menu which is usually not accessible
# http://nuke.yellow-ant.net/set-expression-via-python/
nuke.selectedNode()['antialiasing'].setExpression('$gui? 0:3')
@jeangjenq
jeangjenq / OpenFolder.py
Last active March 20, 2022 04:27
Improved OpenFolder from Pr_Suite for Nuke.
def open_folder(path):
"""
Open folder based on OS.
:param path: Directory path
:type path: str
:return: None
:rtype: None
"""
if platform.system() == "Windows":
os.startfile(os.path.abspath(path))
@jeangjenq
jeangjenq / ReadFromWrite.py
Created March 20, 2022 04:27
Improved ReadFromWrite from Pr_Suite for Nuke.
def read_from_write():
"""
Create Read node from selected Write node.
:return: None
:rtype: None
"""
selected = nuke.selectedNodes()
writeNodes = []
for node in selected:
if node.Class() == 'Write':
@jeangjenq
jeangjenq / ShuffeEXRPasses.py
Created March 20, 2022 04:29
Improved ShuffleEXRPasses from Pr_Suite for Nuke.
for layer in extract:
shuffle = nuke.nodes.Shuffle(label='[value in]')
shuffle["in"].setValue(layer)
shuffle.setInput(0, self.node)
@jeangjenq
jeangjenq / find.inPython.py
Last active March 20, 2022 07:38
List all directory, subdirectory and files
l = []
for root, directories, filenames in os.walk('./'):
for directory in directories:
l.append(os.path.join(root, directory))
for filename in filenames:
l.append(os.path.join(root, filename))
@jeangjenq
jeangjenq / listDir.py
Created March 20, 2022 07:39
A list off all directory.
[val for sublist in [[os.path.join(i[0], j) for j in i[2]] for i in os.walk('./')] for val in sublist]
import os
from subprocess import call
#gather a list of files/directories/subdirectories
list = []
for root, directories, filenames in os.environ['OneDrive']:
for directory in directories:
list.append(os.path.join(root, directory))
for filename in filenames:
list.append(os.path.join(root, filename))