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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import nuke, nukescripts, nuke.rotopaint as rp, _curvelib as cl | |
''' | |
## LINK TOOLS | |
Utility functions for creating linked nodes. This script can create roto linked to trackers, | |
transform linked to trackers, or cameras linked to each other, or held on a projection frame. | |
Installation: | |
Put link_tools.py somewhere in your nuke path. | |
You can add the script as commands to your Nodes panel. This code creates a custom menu entry called "Scripts". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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': |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for layer in extract: | |
shuffle = nuke.nodes.Shuffle(label='[value in]') | |
shuffle["in"].setValue(layer) | |
shuffle.setInput(0, self.node) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[val for sublist in [[os.path.join(i[0], j) for j in i[2]] for i in os.walk('./')] for val in sublist] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |
OlderNewer