nuke python/tcl notes

•May 9, 2015 • Leave a Comment

– use node.setName(name) instead of node[‘name’].setValue(name), and nuke will handle multiple nodes with that name gracefully.

– Enumeration_Knob is the gui Pulldown knob.. ie. nuke.Enumeration_Knob(‘dir’, ‘direction’, [‘distort’, ‘undistort/correct’])

– start a tab this way: g.addKnob(nuke.Tab_Knob(‘LensDistort’))

– use tcl [exists input], returns if input is connected or not

– use Link_Knob to expose knobs internal to the group, or can be used to ‘instance’ other nodes’ knobs

link = nuke.Link_Knob(‘filter’)
link.setLink(internalnode.fullName() + ‘.filter’)

– g[’tile_color’].setValue( int(‘0xa57aaaff’, 16) ) – convert hex colors to “ColorChip-friendly integer”

– [topnode] gets the top node of tree. ie. [value [topnode].label]

– nuke.runIn( ‘MyGizmo’, ‘getAllNodes()’ ) – to set the context for calls like thisNode(), thisKnob(), etc.

– use python in labels with [python getLensDist.evalRes()]

– nuke.menu(‘Nuke’).findItem(‘OCIO/Publish Selected Node as Grade’).script()  gets the python that that MenuItem calls.  also: call the module directly after import to get what file it’s sourced from:  ie.

import Publish
Publish

Result: <module ‘os’ from ‘/tools/blah/blah/python/2.7.3/platform-linux/arch-x86_64/os-Ubuntu-12.04/ocio/Publish.py’>

rv setup

•July 29, 2014 • Leave a Comment

rv .rvrc.mu setup (save in ~) :

require rvui;
require app_utils;
require rvtypes;
require commands;
require extra_commands;

print("jb .rvrc\n");

\: initialize (object;)
{
    //
    //  To override default bindings just set them after you call this,
    //  otherwise, you need to provide all of the bindings if you
    //  replace it.
    //

    rvui.defineDefaultBindings();

    //
    //  You can add to rvui.mainMenu before calling this
    //


    defineModeMenu("default", rvui.buildMainMenu());

    //
    //  Make a new State object. Any object can be returned here
    //  (tuple, etc). In this case we're going to provide the default
    //  State object.
    //

    return rvui.newStateObject();
}

function: setup(void;)
{
    app_utils.bind("key-down--0", \:(void; Event event)
    {

        rvui.cycleStackForward(nil);
    });

    app_utils.bind("key-down--9", \:(void; Event event)
    {
        rvui.cycleStackBackward(nil);
    });

    app_utils.bind("key-down--s", \:(void; Event event)
    {
	//rvui.toggleFileLUT(nil);
	rvui.toggleLUT("Color", "File");
	rvui.toggleSRGBDisplay(nil);
    });

    app_utils.bind("key-down--control--a", rvui.pixelAspectFunc(2.0), "Anamorphic 2:1");
}

nuke setup

•July 28, 2014 • Leave a Comment

oft used init.py / menu.py stuff:


t = nuke.toolbar("Nodes")
# merges
t.addCommand("Merge/Merges/Mask", "nuke.createNode('Merge2', 'operation mask name Mask bbox intersection')")
t.addCommand("Merge/Merges/Stencil", "nuke.createNode('Merge2', 'operation stencil name Stencil bbox B')")
t.addCommand("Merge/Merges/From", "nuke.createNode('Merge2', 'operation from name From bbox union')")
t.addCommand("Merge/Merges/Max", "nuke.createNode('Merge2', 'operation max name Max bbox union')")

# 2d/3d switch
def transformThis():
  try:
    if 'render_mode' in nuke.selectedNode().knobs():
      return nuke.createNode ( 'TransformGeo' )
    else:
      raise ValueError
  except:
    return nuke.createNode ( 'Transform' )

nuke.menu('Nodes').addCommand( 'Transform/Transform', 'transformThis()', 't')

def mergeThis():
  try:
    if 'render_mode' in nuke.selectedNode().knobs():
      return nuke.createNode ( 'MergeGeo' )
    else:
      raise ValueError
  except:
    return nuke.createNode ( 'Merge2' )

nuke.menu('Nodes').addCommand( 'Merge/Merge', 'mergeThis()', 'm')

t = nuke.toolbar("Nodes")
m = nuke.menu("Nuke")

# personal
t.addCommand("Channel/Shuffle", "nuke.createNode('Shuffle')", "z")
t.addCommand("Color/HueCorrect", "nuke.createNode('HueCorrect')", "h")
t.addCommand("Merge/Unpremult", "nuke.createNode('Unpremult')", "u")
t.addCommand("Merge/Premult", "nuke.createNode('Premult')", "y")

m.addCommand("Edit/Extract", "nuke.extractSelected()", "e")

# personal init.py
nuke.pluginAddPath( './jb' )

nuke.knobDefault('Roto.output', 'rgba')
nuke.knobDefault('VectorBlur.channels', 'rgba')
nuke.knobDefault('Invert.channels', 'rgba')
nuke.knobDefault('Reformat.resize', 'width')


MS Exchange = Poopz, Davmail = Solution

•November 23, 2010 • Leave a Comment

…provided you can install java right.
a) need java 5 or 6, aka jre 1.5.x or 1.6.x, aka j2se.
b) set $JAVA_HOME to java install dir.
c) use java -version to check the above works.
d) get davmail, untar, edit davmail.sh to include the !# and optionally hardcode the java binary path.

e) set your _decent mail client to look for localhost, with the ports same as davmail’s settings.

Quantum Computing

•December 1, 2009 • Leave a Comment

Not having heard anything about this for quite some time, I was a bit surprised to see that research is being carried out on it at Cambridge and Oxford, and also that it’s being treated like it’s not an ‘in theory’ thought experiment but a practicable phenomenon a few years from being put to use.

Some nice details on the implementation of a basic unit of quantum computing can be found here, and more on the Quantiki (what else?). Or for those scared of the maths, here’s some of the good bits (pni):

A particle, in this case a photon, impinges on a beam-splitter (BS1), and, with some probability amplitudes, propagates via two different paths to another beam-splitter (BS2) which directs the particle to one of the two detectors. Along each path between the two beam-splitters, is a phase shifter (PS).

The roles of the three key ingredients in this experiment are clear. The first beam splitter prepares a superposition of possible paths, the phase shifters modify quantum phases in different paths and the second beam-splitter combines all the paths together erasing all information about which path was actually taken by the particle between the two beam-splitters.

Thus in principle we know how to build a quantum computer; we can start with simple quantum logic gates and try to integrate them together into quantum networks. However, if we keep on putting quantum gates together into networks we will quickly run into some serious practical problems. The more interacting qubits are involved the harder it tends to be to engineer the interaction that would display the quantum interference. Apart from the technical difficulties of working at single-atom and single-photon scales, one of the most important problems is that of preventing the surrounding environment from learning about which computational path was taken in the multi-particle interferometer. This “welcher Weg information can destroy the interference and the power of quantum computing.

 

videos

•November 30, 2009 • Leave a Comment

http://www.xlr8r.com/videos/drop_the_lime/hear_me/

http://www.dropthelime.com/

http://www.xlr8r.com/videos/grizzly_bear/the_knife/

canadian copyright crapination

•December 1, 2007 • Leave a Comment

damn you “New” Government:


http://excesscopyright.blogspot.com/2007/11/canadas-copyright-law-is-stronger-and.html


http://www.cbc.ca/searchengine/blog/2007/11/last_chance_to_ask_the_industr.html

heatwave mix: an england story

•May 16, 2007 • Leave a Comment

Heatwave do up a big mix of UK carribbean-influenced dancehall, reggae, ragga, and garage, reaching back to 1984. For the bloggaridims mix series.

Grab it here.

•May 9, 2007 • 1 Comment

gerry2

“Isold X. Villarreal” or machine angst

•November 24, 2006 • Leave a Comment

mail_snap

Why does randomly generated Markov-chain spam make so much (poetic) sense?

From jxerdt@sibername.biz Thu Nov 23 02:15:30 2006
From: “Isold X. Villarreal” <jxerdt@sibername.biz>
Subject: stockpile part
Date: Thu, 23 Nov 2006 11:13:36 +0200
X-Spam-Status: No, hits=4.4 tagged_above=-200.0 required=6.3 tests=BAYES_00,
HELO_DYNAMIC_DHCP, HELO_DYNAMIC_HCC, HTML_30_40, HTML_MESSAGE, RCVD_IN_SORBS_DUL
X-Spam-Level: ****

It smells like roasting corn, raw sewage, fish sauce, frying hamburgers and exhaust. Hell of a night all around.
It’s ugly, preposterous and inhuman, interspersed with all-too-rare pockets of serenity and beauty.
” All this nonsense about “the violence is getting worse because they’re trying to influence our election. It sounds like the whooshing of cars, and if you close your eyes, you can delude yourself into believing they’re waves lapping at a beach.