Skip to content

Instantly share code, notes, and snippets.

View julik's full-sized avatar
💭
🎺

Julik Tarkhanov julik

💭
🎺
View GitHub Profile
@julik
julik / cornerpin_centroid.py
Created January 23, 2013 16:02
This baby will compute the center pivot of a CornerPin node in Nuke
import nuke
def run():
cornerpin = nuke.selectedNode()
xform = nuke.nodes.TransformMasked()
xform["center"].setAnimated()
f = nuke.frame()
center = xform["center"]
xanim = center.animations()[0]
@julik
julik / manual_mount.rb
Created October 7, 2012 13:17
Manually mount HFS shares on OSX
#!/usr/bin/env ruby
require 'fileutils'
MOUNTZ = %w(
some-server.company.local:/mnt/raiddisk/commercial /mnt/commercial
)
SERVERS = Hash[*MOUNTZ]
MAGIC_OPTS = %w( soft resvport intr rsize=8192 wsize=8192 timeo=900 retrans=3 proto=tcp )
@julik
julik / slip nuke anims
Created September 8, 2012 11:24
slips.py
import nuke, re
def slip_animations_of_node(node, by_offset):
"""
This function will slip all the animations of the passed node by a passed
offset in frames
The animations are offset in the passed TCL curve command.
In this script every frame at which keys are placed is marked by x<FRAME_NUMBER>,
and these are only placed at the start of a non-continuous segment.
@julik
julik / slip.py
Created July 30, 2012 15:07
Offset and slip ALL OF EM KEYFRAMES on nodes
import nuke, re
def start_anim_at(node, frame):
"""
Will move all the animations of the passed node so that they start at the passed frame instead of the
current ont
"""
slip_by = frame - first_keyframe_location(node)
slip_animations_of_node(node, slip_by)
@julik
julik / consolidate.rb
Created July 9, 2012 15:57
Consolidate all used takes (first in point to last out point) from all EDLs in this directory (writes to STDOUT)
require 'edl'
class ConsolidatedClip
attr_reader :in, :out, :reel, :members
def initialize(members)
@in = members.map {|e| e.capture_from_tc }.sort[0]
@out = members.map {|e| e.capture_to_tc }.sort[-1]
@reel = members[0].reel
@members = members
end
@julik
julik / flip2d.szl
Created July 5, 2012 13:05
Flip your trackers in the image plane in 2D
//SIZZLET Flip Selected Trackers In 2D
obj = Scene.activeObj
shot = obj.shot
frameFrom = shot.start
frameTo = shot.stop
for (tk in obj.trk)
if (tk.isSel == 1)
tk.isDone = 0
@julik
julik / auto_menu_func.py
Created June 28, 2012 11:38
Automatically deduce the path to a Python function to use in Nuke UI
def do_something_useful():
print "Making comp pretty"
pass
#... when defining menus
menu.addCommand("Make comp pretty", do_something_useful, icon = os.path.join(ICONS_PATH, "dick.png"))
@julik
julik / init.py
Created June 28, 2012 07:40
Conditionally configure Nuke's cache path
# Use the RAID for caches if available
RAID = "/Volumes/FASZT"
if os.path.exists(RAID):
os.environ["NUKE_TEMP_DIR"] = RAID + "/NukeCache"
@julik
julik / package_batch_imports.rb
Created March 31, 2012 13:07
Automatically package all Batch Import node sources from network disks
#!/usr/bin/env ruby
require "rexml/document"
require 'sequencer'
require 'progressbar'
require "fileutils"
class Collector
def collect_import_node(node, setup_path)
@julik
julik / gist:1961385
Created March 2, 2012 21:04 — forked from tvandervossen/gist:1958155
How to define a 400 by 200 px sprite image with a 800 by 400 px retina display version
.ui
{
  background-image: url(sprite.png);
}
@media only screen and (-webkit-min-device-pixel-ratio: 2) {
  .ui
  {
    background-image: url(sprite2x.png);
    background-size: 400px 200px;
  }