Skip to content

Instantly share code, notes, and snippets.

View julik's full-sized avatar
💭
🎺

Julik Tarkhanov julik

💭
🎺
View GitHub Profile
@julik
julik / grow.py
Created August 24, 2011 08:47
Automatically grow the bbox of a Nuke node unioning animation
import nuke,os
"""
Will make a Crop node that crops the frame to the union of the animated BBox of the nude currently selected.
For example, if you have a Tracker node that stabilizes an image this function will grow your bounding box
to include the whole stabilized image
"""
def grow_bbox():
sel = nuke.selectedNode()
xmin = 0
@julik
julik / cornerpin_to_matrix.py
Created August 23, 2011 08:12
Nuke corner pin to matrix
# and here is the script in case anyone is interested :)
import nuke
def getTheCornerpinAsMatrix():
projectionMatrixTo = nuke.math.Matrix4()
projectionMatrixFrom = nuke.math.Matrix4()
#dir(projectionMatrix)
theCornerpinNode = nuke.selectedNode()
imageWidth = float(theCornerpinNode.width())
imageHeight = float(theCornerpinNode.height())
require 'uri'
module Julik
module AbsolutizeHelper
def canonicalize_hyperlinks(htmlcontent, root, host = nil, prot = nil)
htmlcontent.gsub(/(<(img|a)\b[^>]*(src|href)=)(["'])(.*?)\4/) do
md = $~
prefix = (host && prot) ? (prot + host) : ''
prefix.gsub!(/\/$/, '')
singleLineInput = None
filenameSearch = None
clipnameSearch = None
multilineTextInput = None
notepad = None
booleanCheckBox = None
rgbColorChip = 0x0
enumerationPulldown = "first second third"
textFontPulldown = None
expressionInput = "[python -eval 3*2]"
@julik
julik / worst_gui_api_ever.py
Created August 11, 2011 13:01
Why the values are not retreived?
panel = nuke.Panel("Create")
panel.addSingleLineInput("start", int(nuke.root()["first_frame"].getValue()))
panel.addSingleLineInput("finish", int(nuke.root()["last_frame"].getValue()))
panel.addSingleLineInput("step", int(nuke.root().fps()))
panel.addButton("Create")
obscure_status_int = panel.show()
@julik
julik / parser_example.rb
Created August 9, 2011 20:12
Example for flame channel parser use
require "rubygems"
require "flame_channel_parser"
# Parse the setup into channels
channels = File.open("TW_Setup.timewarp") do | f |
FlameChannelParser.parse(f)
end
# Find the channel that we are interested in, in this case
# this is the "Timing" channel from any Timewarp setup
@julik
julik / sequencer_usage.rb
Created August 9, 2011 19:57
Sequencer usage
require "sequencer"
s = Sequencer.from_single_file("/RAID/Film/CONFORM.092183.dpx")
s.file_count #=> 3201
s.gaps? #=> true
s.missing_frames #=> 15, somebody was careless
s.pattern #=> "CONFORM.%06d.dpx", usable with printf right away
g++-4.0 -c -fPIC -DUSE_GLEW -I/Applications/Nuke6.3v1/Nuke6.3v1.app/Contents/MacOS/include -msse -O3 -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch x86_64 -c SyLens.cpp
g++-4.0 -o SyLens.dylib -bundle -undefined warning -flat_namespace -shared -rdynamic -nodefaultlibs-ggdb -lDDImage -lGLEW -L/Applications/Nuke6.3v1/Nuke6.3v1.app/Contents/MacOS -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -arch x86_64 -lDDImage -lGLEW SyLens.o
@julik
julik / rackup2.rb
Created July 18, 2011 00:50
bundle+rackup replacement that actually fucking tells you what's happening
#!/usr/local/rvm/rubies/ruby-1.9.2-p180/bin/ruby
#
# This file was generated by Julik.
begin
require 'rubygems'
version = ">= 0"
if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then
version = $1
@julik
julik / rackup2.rb
Created July 18, 2011 00:50
bundle+rackup replacement that actually fucking tells you what's happening
#!/usr/local/rvm/rubies/ruby-1.9.2-p180/bin/ruby
#
# This file was generated by Julik.
begin
require 'rubygems'
version = ">= 0"
if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then
version = $1