Skip to content

Instantly share code, notes, and snippets.

@tokejepsen
tokejepsen / nukestudio_frame_exporter.py
Last active February 9, 2024 16:43
NukeStudio Frame Exporter
"""
Place in [NUKE_PATH]/Python/StartupUI
"""
import os
from PySide2 import QtCore, QtWidgets
import hiero.core.nuke as nuke
import hiero.core.nuke.Node
@tokejepsen
tokejepsen / otio_to_ffmpeg.py
Last active November 24, 2020 08:48
OTIO to FFMPEG
import subprocess
import sys
import os
import json
import shutil
import requests
import opentimelineio as otio
@tokejepsen
tokejepsen / nrr.py
Last active September 10, 2020 19:12
Nuke Recursive Read
import os
import clique
def recursive_read():
path = nuke.getClipname("Choose Folder", multiple=False)
collection_names = {}
@tokejepsen
tokejepsen / lbh.py
Last active September 11, 2020 17:09
Luminance Batch HDR
"""
python C:\Users\admin\Desktop\luminance_batch_hdr.py "C:\Program Files\Luminance HDR\v.2.6.0\luminance-hdr-cli.exe" C:\Users\admin\Desktop\sorted 13
"""
import os
import sys
import subprocess
def is_whole(n):
return n % 1 == 0
@tokejepsen
tokejepsen / nctfsc.py
Last active November 23, 2020 15:30
NukeStudio: Copy tags from source clip
import hiero
seq = hiero.ui.activeSequence()
selection = hiero.selection
source_track = "edit"
data = {}
for video_track in seq.videoTracks():
@tokejepsen
tokejepsen / nrt.py
Created September 22, 2020 13:09
NukeStudio: Remove tag
import hiero
seq = hiero.ui.activeSequence()
selection = hiero.selection
for item in selection:
if isinstance(item, hiero.core.EffectTrackItem):
continue
@tokejepsen
tokejepsen / ntrs.py
Last active November 23, 2020 15:31
NukeStudio: Tag reuse shots
import hiero
selection = hiero.selection
comment_tag = None
for item in selection[0].project().tagsBin().items():
if item.name() == "Comment":
comment_tag = item
break
@tokejepsen
tokejepsen / nssfoet.py
Last active November 5, 2021 14:56
Nuke: Start, middle and end frame of each TimeClip
"""
Select all TimeClips and run code.
Will produce a frame hold with start middle and end of the time clips.
"""
import nuke
frames = []
for node in nuke.selectedNodes():
node["selected"].setValue(False)
@tokejepsen
tokejepsen / npsg.py
Last active November 25, 2020 10:30
Nuke: Per Shot Grade
import nuke
def main(node):
node["selected"].setValue(False)
average_intensity = 0
keys = 0
for channel in node["intensitydata"].animations():
for key in channel.keys():
average_intensity += key.y
@tokejepsen
tokejepsen / fcf.py
Created January 4, 2021 15:47
ffmpeg concat filter
import subprocess
import os
chunk_frames = 25
chunk_amount = 3
framerate = 25
duration = chunk_frames / framerate