Skip to content

Instantly share code, notes, and snippets.

View bazarus's full-sized avatar

Elizar bazarus

  • Moscow
View GitHub Profile
@fredrikaverpil
fredrikaverpil / get_set_values.py
Last active May 20, 2024 20:31
Get and set knob values #nuke
# Get all nodes of type Read
readnodes = nuke.allNodes('Read')
for readnode in readnodes:
print readnode
# List all knobs for selected node
print( nuke.toNode('Read1') )
# List all knobs for specific node
print( nuke.selectedNode() )
@jedypod
jedypod / Link Tools
Last active November 24, 2021 11:49
@billroy
billroy / jsonio.py
Created September 21, 2012 13:38
Read/write JSON object from file in python
import simplejson
import json
def put(data, filename):
try:
jsondata = simplejson.dumps(data, indent=4, skipkeys=True, sort_keys=True)
fd = open(filename, 'w')
fd.write(jsondata)
fd.close()
except:
@julik
julik / reducer.py
Created September 16, 2011 16:22
Iteratively reduce keyframes on linear segments in Nuke
import math
DELTA = 0.0001
def is_linear_segment(before, current, after, delta):
dx = after.x - before.x
dy = after.y - before.y
t = (current.x - before.x) / dx
linear_y = before.y + (dy * t)
return math.fabs(linear_y - current.y) < delta
@stchris
stchris / getimg.py
Created February 19, 2011 13:34
Improved version of getimg.sh - gets the 'image of the day' from NASA, writes the summary onto the image and sets it as the Gnome wallpaper.
#!/usr/bin/env python
"""
getimg.py
Gets the current image of the day from NASA and sets it as the
background in Gnome. The summary / description text is written
to the image.
Requires:
PIL (apt-get install python-imaging or pip install PIL)