<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Adam Teale: News From Above &#187; VFX</title>
	<atom:link href="http://adamteale.com/tag/vfx/feed/" rel="self" type="application/rss+xml" />
	<link>http://adamteale.com</link>
	<description>ramblings of a 2 metre man</description>
	<lastBuildDate>Wed, 23 May 2012 18:14:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>some Nuke Python snippets</title>
		<link>http://adamteale.com/1413/</link>
		<comments>http://adamteale.com/1413/#comments</comments>
		<pubDate>Tue, 11 May 2010 04:54:44 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Extremely Cool]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[VFX]]></category>
		<category><![CDATA[bbox]]></category>
		<category><![CDATA[node]]></category>
		<category><![CDATA[nuke]]></category>

		<guid isPermaLink="false">http://adamteale.com/?p=1413</guid>
		<description><![CDATA[Seeing as I&#8217;ve found very little reference for the use of python in nuke on the web I thought I&#8217;d create this post and add to it with little code snippets. If anyone has some cool snippets to share please &#8230; <a href="http://adamteale.com/1413/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Seeing as I&#8217;ve found very little reference for the use of python in nuke on the web I thought I&#8217;d create this post and add to it with little code snippets.</p>
<p>If anyone has some cool snippets to share please feel free to leave them in a comment below.</p>
<p><em>*lastupdated: 23 May 2012</em></p>
<p><strong>&#8220;Autowrite&#8221; node</strong><br />
Copy the following line into the python &#8220;beforeRender&#8221; field in a write node.<br />
The write node&#8217;s &#8220;file&#8221; field will be filled based on the script&#8217;s name/path.<br />
Obviously this all depends on your pipeline etc.</p>
<p>For my current situation each vfx shot has it&#8217;s own directory, which is then populated with &#8220;renders&#8221; &#038; &#8220;scripts&#8221; subdirectories.<br />
So for me I can do this:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">nuke.<span style="color: black;">thisNode</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">&quot;file&quot;</span><span style="color: black;">&#93;</span>.<span style="color: black;">setValue</span><span style="color: black;">&#40;</span>nuke.<span style="color: black;">root</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>.<span style="color: black;">name</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>.<span style="color: black;">replace</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;scripts&quot;</span>,<span style="color: #483d8b;">&quot;renders&quot;</span><span style="color: black;">&#41;</span>.<span style="color: black;">replace</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;.nk&quot;</span>,<span style="color: #483d8b;">&quot;.mov&quot;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></div></div>

<p><strong>delete all nodes that are not selected</strong></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">s = nuke.<span style="color: black;">selectedNodes</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
b = nuke.<span style="color: black;">allNodes</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">for</span> n <span style="color: #ff7700;font-weight:bold;">in</span> b:
    <span style="color: #ff7700;font-weight:bold;">if</span> n <span style="color: #ff7700;font-weight:bold;">not</span> <span style="color: #ff7700;font-weight:bold;">in</span> s:
        nuke.<span style="color: black;">delete</span><span style="color: black;">&#40;</span>n<span style="color: black;">&#41;</span></pre></div></div>

<p><strong>selects all dependencies (input nodes &#038; their parents) from a selected node</strong></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">a = nuke.<span style="color: black;">selectedNode</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
nodesToSelect = <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span>
&nbsp;
nodesToSelect.<span style="color: black;">append</span><span style="color: black;">&#40;</span>a<span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">def</span> climb<span style="color: black;">&#40;</span>node<span style="color: black;">&#41;</span>:
    <span style="color: #808080; font-style: italic;"># print node.name()</span>
    <span style="color: #ff7700;font-weight:bold;">for</span> n <span style="color: #ff7700;font-weight:bold;">in</span> node.<span style="color: black;">dependencies</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
        nodesToSelect.<span style="color: black;">append</span><span style="color: black;">&#40;</span>a<span style="color: black;">&#41;</span>
        climb<span style="color: black;">&#40;</span>n<span style="color: black;">&#41;</span>
&nbsp;
climb<span style="color: black;">&#40;</span>a<span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">for</span> x <span style="color: #ff7700;font-weight:bold;">in</span> nodesToSelect:
	<span style="color: #ff7700;font-weight:bold;">print</span> x.<span style="color: black;">name</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    <span style="color: #808080; font-style: italic;"># x.setSelected(1)</span></pre></div></div>

<p><strong>set all Read nodes to cache locally</strong></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">for</span> a <span style="color: #ff7700;font-weight:bold;">in</span> nuke.<span style="color: black;">allNodes</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">if</span> a.<span style="color: black;">Class</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>==<span style="color: #483d8b;">'Read'</span>:
        a<span style="color: black;">&#91;</span><span style="color: #483d8b;">'cached'</span><span style="color: black;">&#93;</span>.<span style="color: black;">setValue</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>
        a<span style="color: black;">&#91;</span><span style="color: #483d8b;">'cacheLocal'</span><span style="color: black;">&#93;</span>.<span style="color: black;">setValue</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span></pre></div></div>

<p><strong>print last frame of script</strong></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">print</span> nuke.<span style="color: black;">root</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'last_frame'</span><span style="color: black;">&#93;</span>.<span style="color: black;">value</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

<p><strong>create a backdrop based on selected Nodes</strong></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">margin = <span style="color: #ff4500;">100</span>
xpMax = nuke.<span style="color: black;">selectedNode</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>.<span style="color: black;">xpos</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
xpMin = nuke.<span style="color: black;">selectedNode</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>.<span style="color: black;">xpos</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
ypMax = nuke.<span style="color: black;">selectedNode</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>.<span style="color: black;">ypos</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
ypMin = nuke.<span style="color: black;">selectedNode</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>.<span style="color: black;">ypos</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">for</span> a <span style="color: #ff7700;font-weight:bold;">in</span> nuke.<span style="color: black;">selectedNodes</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">if</span> a.<span style="color: black;">xpos</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> <span style="color: #66cc66;">&gt;</span> xpMax:
        xpMax = a.<span style="color: black;">xpos</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> a.<span style="color: black;">xpos</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> <span style="color: #66cc66;">&lt;</span> xpMin:
        xpMin = a.<span style="color: black;">xpos</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> a.<span style="color: black;">ypos</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> <span style="color: #66cc66;">&gt;</span> ypMax:
        ypMax = a.<span style="color: black;">ypos</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> a.<span style="color: black;">ypos</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> <span style="color: #66cc66;">&lt;</span> ypMin:
        ypMin = a.<span style="color: black;">ypos</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
bd = nuke.<span style="color: black;">nodes</span>.<span style="color: black;">BackdropNode</span><span style="color: black;">&#40;</span>bdwidth=<span style="color: black;">&#40;</span>xpMax-xpMin<span style="color: black;">&#41;</span>+margin, bdheight=<span style="color: black;">&#40;</span>ypMax-ypMin<span style="color: black;">&#41;</span>+margin<span style="color: black;">&#41;</span> 
bd.<span style="color: black;">setXpos</span><span style="color: black;">&#40;</span>xpMin-margin/<span style="color: #ff4500;">2</span><span style="color: black;">&#41;</span>
bd.<span style="color: black;">setYpos</span><span style="color: black;">&#40;</span>ypMin-margin/<span style="color: #ff4500;">2</span><span style="color: black;">&#41;</span></pre></div></div>

<p><strong>disable &#8220;postage stamps&#8221; on only &#8220;Read&#8221; nodes</strong></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">for</span> a <span style="color: #ff7700;font-weight:bold;">in</span> nuke.<span style="color: black;">allNodes</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
   <span style="color: #ff7700;font-weight:bold;">if</span> a.<span style="color: black;">Class</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>==<span style="color: #483d8b;">'Read'</span>:
       a<span style="color: black;">&#91;</span><span style="color: #483d8b;">'postage_stamp'</span><span style="color: black;">&#93;</span>.<span style="color: black;">setValue</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span></pre></div></div>

<p><strong>disable &#8220;postage stamps&#8221; on all nodes</strong></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">for</span> a <span style="color: #ff7700;font-weight:bold;">in</span> nuke.<span style="color: black;">allNodes</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">try</span>:
        a<span style="color: black;">&#91;</span><span style="color: #483d8b;">'postage_stamp'</span><span style="color: black;">&#93;</span>.<span style="color: black;">setValue</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">except</span>:
        <span style="color: #ff7700;font-weight:bold;">pass</span></pre></div></div>

<p><strong>&#8220;unhide&#8221; all nodes&#8217; inputs &#8211; useful when receiving a sneaky comp/lighting script</strong></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">for</span> a <span style="color: #ff7700;font-weight:bold;">in</span> nuke.<span style="color: black;">allNodes</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">try</span>:
        a<span style="color: black;">&#91;</span><span style="color: #483d8b;">'hide_input'</span><span style="color: black;">&#93;</span>.<span style="color: black;">setValue</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">except</span>:
        <span style="color: #ff7700;font-weight:bold;">pass</span></pre></div></div>

<p><strong>change the &#8220;first&#8221; frame of all selected nodes that are &#8220;Read&#8221; nodes:</strong><br />
<em>(example changes the first frame to 1018)</em></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">for</span> a <span style="color: #ff7700;font-weight:bold;">in</span> nuke.<span style="color: black;">selectedNodes</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">if</span> a.<span style="color: black;">Class</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> == <span style="color: #483d8b;">'Read'</span>:
        a<span style="color: black;">&#91;</span><span style="color: #483d8b;">'first'</span><span style="color: black;">&#93;</span>.<span style="color: black;">setValue</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">1018</span><span style="color: black;">&#41;</span></pre></div></div>

<p><strong>print a selected nodes&#8217; methods</strong></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">struct</span>
node = nuke.<span style="color: black;">selectedNode</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">for</span> a <span style="color: #ff7700;font-weight:bold;">in</span> node<span style="color: black;">&#91;</span><span style="color: #483d8b;">'lookup'</span><span style="color: black;">&#93;</span>.<span style="color: black;">animations</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #008000;">dir</span><span style="color: black;">&#40;</span>a<span style="color: black;">&#41;</span></pre></div></div>

<p><strong>print inputs (dependencies) of a selected node:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">for</span> a <span style="color: #ff7700;font-weight:bold;">in</span> nuke.<span style="color: black;">selectedNode</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>.<span style="color: black;">dependencies</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">print</span> a.<span style="color: black;">name</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

<p><strong>print outputs (dependents) of a selected node:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">for</span> a <span style="color: #ff7700;font-weight:bold;">in</span> nuke.<span style="color: black;">selectedNode</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>.<span style="color: black;">dependent</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">print</span> a.<span style="color: black;">name</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

<p><strong>find all the TimeOffset nodes in a Group called &#8220;Group2&#8243;, and change the value of each offset based on it&#8217;s position in the array of found time offsets<br />
</strong></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">tos = <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span>
<span style="color: #ff7700;font-weight:bold;">for</span> a <span style="color: #ff7700;font-weight:bold;">in</span> nuke.<span style="color: black;">toNode</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'Group2'</span><span style="color: black;">&#41;</span>.<span style="color: black;">nodes</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
	<span style="color: #ff7700;font-weight:bold;">if</span> a.<span style="color: black;">Class</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>==<span style="color: #483d8b;">'TimeOffset'</span>:
		tos.<span style="color: black;">append</span><span style="color: black;">&#40;</span>a<span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">for</span> b <span style="color: #ff7700;font-weight:bold;">in</span> tos:
	b<span style="color: black;">&#91;</span><span style="color: #483d8b;">'time_offset'</span><span style="color: black;">&#93;</span>.<span style="color: black;">setValue</span><span style="color: black;">&#40;</span>tos.<span style="color: black;">index</span><span style="color: black;">&#40;</span>b<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></div></div>

<p><strong>set the &#8216;bbox&#8217; for any selected Merge, Keymix &amp; Copy nodes to &#8220;B&#8221;</strong></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">for</span> a <span style="color: #ff7700;font-weight:bold;">in</span> nuke.<span style="color: black;">selectedNodes</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
	classTypes = <span style="color: black;">&#91;</span><span style="color: #483d8b;">'Merge'</span> , <span style="color: #483d8b;">'Keymix'</span>, <span style="color: #483d8b;">'Copy'</span>, <span style="color: black;">&#93;</span>
	<span style="color: #ff7700;font-weight:bold;">for</span> n <span style="color: #ff7700;font-weight:bold;">in</span> classTypes:
		<span style="color: #ff7700;font-weight:bold;">if</span> n <span style="color: #ff7700;font-weight:bold;">in</span> a.<span style="color: black;">Class</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
			<span style="color: #ff7700;font-weight:bold;">for</span> p <span style="color: #ff7700;font-weight:bold;">in</span> a<span style="color: black;">&#91;</span><span style="color: #483d8b;">'bbox'</span><span style="color: black;">&#93;</span>.<span style="color: black;">values</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
				<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #483d8b;">'B'</span> <span style="color: #ff7700;font-weight:bold;">in</span> p:
					a<span style="color: black;">&#91;</span><span style="color: #483d8b;">'bbox'</span><span style="color: black;">&#93;</span>.<span style="color: black;">setValue</span><span style="color: black;">&#40;</span>a<span style="color: black;">&#91;</span><span style="color: #483d8b;">'bbox'</span><span style="color: black;">&#93;</span>.<span style="color: black;">values</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>.<span style="color: black;">index</span><span style="color: black;">&#40;</span>p<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></div></div>

<p><strong>remove all animation from a selected nodes</strong></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">for</span> a <span style="color: #ff7700;font-weight:bold;">in</span> nuke.<span style="color: black;">selectedNode</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>.<span style="color: black;">knobs</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
	nuke.<span style="color: black;">selectedNode</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span>a<span style="color: black;">&#93;</span>.<span style="color: black;">clearAnimated</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

<p><strong>add keyframes &#8211; animate a mix</strong></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">for</span> a <span style="color: #ff7700;font-weight:bold;">in</span> nuke.<span style="color: black;">selectedNodes</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
	a<span style="color: black;">&#91;</span><span style="color: #483d8b;">'mix'</span><span style="color: black;">&#93;</span>.<span style="color: black;">setAnimated</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
	a<span style="color: black;">&#91;</span><span style="color: #483d8b;">'mix'</span><span style="color: black;">&#93;</span>.<span style="color: black;">setValueAt</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span>,nuke.<span style="color: black;">frame</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
	a<span style="color: black;">&#91;</span><span style="color: #483d8b;">'mix'</span><span style="color: black;">&#93;</span>.<span style="color: black;">setValueAt</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0</span>,<span style="color: black;">&#40;</span>nuke.<span style="color: black;">frame</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> - <span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></div></div>

<p><strong>half the colour value of all the Constant nodes in a script</strong></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">for</span> a <span style="color: #ff7700;font-weight:bold;">in</span> nuke.<span style="color: black;">allNodes</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
	<span style="color: #ff7700;font-weight:bold;">if</span> a.<span style="color: black;">Class</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> == <span style="color: #483d8b;">&quot;Constant&quot;</span>:
		a<span style="color: black;">&#91;</span><span style="color: #483d8b;">'color'</span><span style="color: black;">&#93;</span>.<span style="color: black;">setValue</span><span style="color: black;">&#40;</span>a<span style="color: black;">&#91;</span><span style="color: #483d8b;">'color'</span><span style="color: black;">&#93;</span>.<span style="color: black;">value</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span> / <span style="color: #ff4500;">2</span> , <span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span>
		a<span style="color: black;">&#91;</span><span style="color: #483d8b;">'color'</span><span style="color: black;">&#93;</span>.<span style="color: black;">setValue</span><span style="color: black;">&#40;</span>a<span style="color: black;">&#91;</span><span style="color: #483d8b;">'color'</span><span style="color: black;">&#93;</span>.<span style="color: black;">value</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span> / <span style="color: #ff4500;">2</span> , <span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>
		a<span style="color: black;">&#91;</span><span style="color: #483d8b;">'color'</span><span style="color: black;">&#93;</span>.<span style="color: black;">setValue</span><span style="color: black;">&#40;</span>a<span style="color: black;">&#91;</span><span style="color: #483d8b;">'color'</span><span style="color: black;">&#93;</span>.<span style="color: black;">value</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span> / <span style="color: #ff4500;">2</span> , <span style="color: #ff4500;">2</span><span style="color: black;">&#41;</span></pre></div></div>

<p><strong>find all the transform nodes in a script, and if their input is a Crop, set the &#8216;scale&#8217; value to be twice it&#8217;s current value (also checks if the scale is a list/array or a float)</strong></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">for</span> a <span style="color: #ff7700;font-weight:bold;">in</span> nuke.<span style="color: black;">allNodes</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
	<span style="color: #ff7700;font-weight:bold;">if</span> a.<span style="color: black;">Class</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> == <span style="color: #483d8b;">&quot;Transform&quot;</span>:
		<span style="color: #ff7700;font-weight:bold;">if</span> a.<span style="color: #008000;">input</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span>.<span style="color: black;">Class</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> == <span style="color: #483d8b;">&quot;Crop&quot;</span>:
			x = a<span style="color: black;">&#91;</span><span style="color: #483d8b;">'scale'</span><span style="color: black;">&#93;</span>.<span style="color: black;">value</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
			<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">type</span><span style="color: black;">&#40;</span>x<span style="color: black;">&#41;</span>.__name__ == <span style="color: #483d8b;">'list'</span>:
				a<span style="color: black;">&#91;</span><span style="color: #483d8b;">'scale'</span><span style="color: black;">&#93;</span>.<span style="color: black;">setValue</span><span style="color: black;">&#40;</span>x<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">2</span> , <span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span>
				a<span style="color: black;">&#91;</span><span style="color: #483d8b;">'scale'</span><span style="color: black;">&#93;</span>.<span style="color: black;">setValue</span><span style="color: black;">&#40;</span>x<span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">2</span> , <span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>
			<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">type</span><span style="color: black;">&#40;</span>x<span style="color: black;">&#41;</span>.__name__ == <span style="color: #483d8b;">'float'</span>:
				a<span style="color: black;">&#91;</span><span style="color: #483d8b;">'scale'</span><span style="color: black;">&#93;</span>.<span style="color: black;">setValue</span><span style="color: black;">&#40;</span>x<span style="color: #66cc66;">*</span><span style="color: #ff4500;">2</span><span style="color: black;">&#41;</span></pre></div></div>

<p><strong>set all the gain values of all ColorCorrect nodes to be twice their current value</strong></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">for</span> a <span style="color: #ff7700;font-weight:bold;">in</span> nuke.<span style="color: black;">allNodes</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
	<span style="color: #ff7700;font-weight:bold;">if</span> a.<span style="color: black;">Class</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> == <span style="color: #483d8b;">&quot;ColorCorrect&quot;</span>:
		a<span style="color: black;">&#91;</span><span style="color: #483d8b;">'gain'</span><span style="color: black;">&#93;</span>.<span style="color: black;">setValue</span><span style="color: black;">&#40;</span>a<span style="color: black;">&#91;</span><span style="color: #483d8b;">'gain'</span><span style="color: black;">&#93;</span>.<span style="color: black;">value</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">2</span><span style="color: black;">&#41;</span></pre></div></div>

<p><strong>print files with &#8216;mov&#8217; in filename</strong></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">for</span> a <span style="color: #ff7700;font-weight:bold;">in</span> nuke.<span style="color: black;">allNodes</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
	<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #483d8b;">'Read'</span> <span style="color: #ff7700;font-weight:bold;">in</span> a<span style="color: black;">&#91;</span><span style="color: #483d8b;">'name'</span><span style="color: black;">&#93;</span>.<span style="color: black;">value</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
		<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #483d8b;">'mov'</span> <span style="color: #ff7700;font-weight:bold;">in</span> a<span style="color: black;">&#91;</span><span style="color: #483d8b;">'file'</span><span style="color: black;">&#93;</span>.<span style="color: black;">value</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
			<span style="color: #ff7700;font-weight:bold;">print</span> a<span style="color: black;">&#91;</span><span style="color: #483d8b;">'file'</span><span style="color: black;">&#93;</span>.<span style="color: black;">value</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

<p><strong>change font size of all &#8220;write&#8221; nodes in script</strong></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">for</span> a <span style="color: #ff7700;font-weight:bold;">in</span> nuke.<span style="color: black;">selectedNodes</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
	<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #483d8b;">&quot;Write&quot;</span> <span style="color: #ff7700;font-weight:bold;">in</span> a<span style="color: black;">&#91;</span><span style="color: #483d8b;">'name'</span><span style="color: black;">&#93;</span>.<span style="color: black;">value</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
		a<span style="color: black;">&#91;</span><span style="color: #483d8b;">'note_font_size'</span><span style="color: black;">&#93;</span>.<span style="color: black;">setValue</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">60</span><span style="color: black;">&#41;</span></pre></div></div>

<p><strong>create 20 constants with incrementing colour values</strong></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">def</span> makeConstants<span style="color: black;">&#40;</span>amount<span style="color: black;">&#41;</span>:
	<span style="color: #ff7700;font-weight:bold;">for</span> i <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span>amount<span style="color: black;">&#41;</span>:
		a= nuke.<span style="color: black;">nodes</span>.<span style="color: black;">Constant</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
		color= <span style="color: #008000;">float</span><span style="color: black;">&#40;</span> <span style="color: #008000;">float</span><span style="color: black;">&#40;</span>i<span style="color: black;">&#41;</span> / <span style="color: #008000;">float</span><span style="color: black;">&#40;</span>amount<span style="color: black;">&#41;</span> <span style="color: black;">&#41;</span>
		a<span style="color: black;">&#91;</span><span style="color: #483d8b;">'color'</span><span style="color: black;">&#93;</span>.<span style="color: black;">setValue</span><span style="color: black;">&#40;</span>color<span style="color: black;">&#41;</span>
makeConstants<span style="color: black;">&#40;</span><span style="color: #ff4500;">20</span><span style="color: black;">&#41;</span></pre></div></div>

<p><strong>change the name of all Text nodes to contents the text &#8220;message&#8221;</strong></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">for</span> a <span style="color: #ff7700;font-weight:bold;">in</span> nuke.<span style="color: black;">allNodes</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">if</span> a.<span style="color: black;">Class</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>==<span style="color: #483d8b;">'Text'</span>:
        a.<span style="color: black;">setName</span><span style="color: black;">&#40;</span>a<span style="color: black;">&#91;</span><span style="color: #483d8b;">'message'</span><span style="color: black;">&#93;</span>.<span style="color: black;">value</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>##Expressions<br />
(in an expression node) &#8211; alpha channel &#8211; if the y value of the pixel is even, make it 0, else make it 1 (for viewing fields?)<br />
y%2==1?0:1</p>
<hr><h2>19 Comments</h2> <ul><li><p>At <a href="http://adamteale.com/1413/#comment-16271">Thu 27, May 2010</a>, <span class='eg-image' style='float:right; margin-left:10px; display:block; width:80px' ><a rel='external nofollow' href='http://adamteale.com'><img alt='' src='http://1.gravatar.com/avatar/d4866d87a0ada27ce67b707bc56e460b?s=80&amp;d=http%3A%2F%2Fuse.perl.org%2Fimages%2Fpix.gif%3Fs%3D80&amp;r=G' class='avatar avatar-80 photo' height='80' width='80' /></a></span><a href="http://adamteale.com"   rel='external nofollow' class='url'>Adam</a> wrote:</p><p>some helpful code:</p><p></p><p>http://francoislord.com/blog/tag/python</p></li><li><p>At <a href="http://adamteale.com/1413/#comment-16411">Wed 16, June 2010</a>, <span class='eg-image' style='float:right; margin-left:10px; display:block; width:80px' ><a rel='external nofollow' href='http://adamteale.com'><img alt='' src='http://1.gravatar.com/avatar/d4866d87a0ada27ce67b707bc56e460b?s=80&amp;d=http%3A%2F%2Fuse.perl.org%2Fimages%2Fpix.gif%3Fs%3D80&amp;r=G' class='avatar avatar-80 photo' height='80' width='80' /></a></span><a href="http://adamteale.com"   rel='external nofollow' class='url'>Adam</a> wrote:</p><p>Changing the value of a specific node in a group through python?</p><p>http://www.gfxtalk.com/forum/showthread.php?p=91701</p></li><li><p>At <a href="http://adamteale.com/1413/#comment-17349">Tue 7, September 2010</a>, <span class='eg-image' style='float:right; margin-left:10px; display:block; width:80px' ><img alt='' src='http://0.gravatar.com/avatar/27b64593c59e91c0b7c316f9987d82ac?s=80&amp;d=http%3A%2F%2Fuse.perl.org%2Fimages%2Fpix.gif%3Fs%3D80&amp;r=G' class='avatar avatar-80 photo' height='80' width='80' /></span>Chapman wrote:</p><p>Hey Adam, nice one - I was doing some post Sucker experimenting with Nuke+python,  found this then realised it was you.</p><p></p><p>Cheers,</p><p>AC.</p></li><li><p>At <a href="http://adamteale.com/1413/#comment-17452">Mon 13, September 2010</a>, <span class='eg-image' style='float:right; margin-left:10px; display:block; width:80px' ><a rel='external nofollow' href='http://adamteale.com'><img alt='' src='http://1.gravatar.com/avatar/d4866d87a0ada27ce67b707bc56e460b?s=80&amp;d=http%3A%2F%2Fuse.perl.org%2Fimages%2Fpix.gif%3Fs%3D80&amp;r=G' class='avatar avatar-80 photo' height='80' width='80' /></a></span><a href="http://adamteale.com"   rel='external nofollow' class='url'>Adam</a> wrote:</p><p>Thanks Chapman!</p><p></p><p>Found some cool nuke python trickery?</p><p>If you do feel free to put something up as a comment on this post!</p><p>Hope all is well back in Sydney!</p></li><li><p>At <a href="http://adamteale.com/1413/#comment-17572">Fri 24, September 2010</a>, <span class='eg-image' style='float:right; margin-left:10px; display:block; width:80px' ><img alt='' src='http://1.gravatar.com/avatar/dbb808aff70d447704c54456ae3e2fe2?s=80&amp;d=http%3A%2F%2Fuse.perl.org%2Fimages%2Fpix.gif%3Fs%3D80&amp;r=G' class='avatar avatar-80 photo' height='80' width='80' /></span>Steve wrote:</p><p>How do you disable Read node thumbnails only?</p><p></p><p>Thanks.</p></li><li><p>At <a href="http://adamteale.com/1413/#comment-17625">Tue 28, September 2010</a>, <span class='eg-image' style='float:right; margin-left:10px; display:block; width:80px' ><a rel='external nofollow' href='http://adamteale.com'><img alt='' src='http://1.gravatar.com/avatar/d4866d87a0ada27ce67b707bc56e460b?s=80&amp;d=http%3A%2F%2Fuse.perl.org%2Fimages%2Fpix.gif%3Fs%3D80&amp;r=G' class='avatar avatar-80 photo' height='80' width='80' /></a></span><a href="http://adamteale.com"   rel='external nofollow' class='url'>Adam</a> wrote:</p><p>Hey Steve sorry for the delay, am currently doing some travel in Mexico.  </p><p></p><p>Try this:</p><p></p><p>for a in nuke.allNodes():</p><p>   if a.Class()=='Read':</p><p>       a['postage_stamp'].setValue(0)</p></li><li><p>At <a href="http://adamteale.com/1413/#comment-21878">Sun 13, February 2011</a>, <span class='eg-image' style='float:right; margin-left:10px; display:block; width:80px' ><a rel='external nofollow' href='http://www.agoston-princz.com'><img alt='' src='http://0.gravatar.com/avatar/089fbca05634e3703151eed11871a830?s=80&amp;d=http%3A%2F%2Fuse.perl.org%2Fimages%2Fpix.gif%3Fs%3D80&amp;r=G' class='avatar avatar-80 photo' height='80' width='80' /></a></span><a href="http://www.agoston-princz.com" onclick="javascript:_gaq.push(['_trackEvent','outbound-commentauthor','http://www.agoston-princz.com']);"  rel='external nofollow' class='url'>Agoston</a> wrote:</p><p>#Set Read Nodes Missing Frames Nearest Frame</p><p></p><p>r = nuke.selectedNodes()</p><p>for i in r:</p><p>    i['on_error'].setValue("nearest_frame")</p><p></p><p></p><p>#Set Shuffle Nodes Write Their Incoming Channels Out</p><p></p><p>s = nuke.allNodes('Shuffle')</p><p>for i in s:</p><p>    i['label'].setValue("[value in]")</p></li><li><p>At <a href="http://adamteale.com/1413/#comment-21879">Sun 13, February 2011</a>, <span class='eg-image' style='float:right; margin-left:10px; display:block; width:80px' ><a rel='external nofollow' href='http://adamteale.com'><img alt='' src='http://1.gravatar.com/avatar/d4866d87a0ada27ce67b707bc56e460b?s=80&amp;d=http%3A%2F%2Fuse.perl.org%2Fimages%2Fpix.gif%3Fs%3D80&amp;r=G' class='avatar avatar-80 photo' height='80' width='80' /></a></span><a href="http://adamteale.com"   rel='external nofollow' class='url'>Adam</a> wrote:</p><p>Nice one Agoston! </p><p>Thanks for your code!</p></li><li><p>At <a href="http://adamteale.com/1413/#comment-36551">Fri 6, January 2012</a>, <span class='eg-image' style='float:right; margin-left:10px; display:block; width:80px' ><img alt='' src='http://1.gravatar.com/avatar/dcfe329ce3b1cc40fd922934ccfe745e?s=80&amp;d=http%3A%2F%2Fuse.perl.org%2Fimages%2Fpix.gif%3Fs%3D80&amp;r=G' class='avatar avatar-80 photo' height='80' width='80' /></span>Anshul wrote:</p><p>Great work Adam,</p><p>being late for the party, found out your nuke forum now only.</p><p>I have a query:</p><p>How to  get the paths in Read nodes and if anyone updated, how to reload that again in the scene, without reloading the whole scene</p></li><li><p>At <a href="http://adamteale.com/1413/#comment-36562">Fri 6, January 2012</a>, <span class='eg-image' style='float:right; margin-left:10px; display:block; width:80px' ><img alt='' src='http://1.gravatar.com/avatar/dcfe329ce3b1cc40fd922934ccfe745e?s=80&amp;d=http%3A%2F%2Fuse.perl.org%2Fimages%2Fpix.gif%3Fs%3D80&amp;r=G' class='avatar avatar-80 photo' height='80' width='80' /></span>Anshul wrote:</p><p>getting paths of all read nodes</p><p>for n in nuke.allNodes():</p><p>    if n.Class() == 'Read':</p><p>        print n['name'].value() + ' : ' + n['file'].value()</p></li><li><p>At <a href="http://adamteale.com/1413/#comment-38561">Tue 6, March 2012</a>, <span class='eg-image' style='float:right; margin-left:10px; display:block; width:80px' ><a rel='external nofollow' href='http://adamteale.com'><img alt='' src='http://1.gravatar.com/avatar/d4866d87a0ada27ce67b707bc56e460b?s=80&amp;d=http%3A%2F%2Fuse.perl.org%2Fimages%2Fpix.gif%3Fs%3D80&amp;r=G' class='avatar avatar-80 photo' height='80' width='80' /></a></span><a href="http://adamteale.com"   rel='external nofollow' class='url'>Adam</a> wrote:</p><p>Nice One Anshul! Thanks for sharing!</p></li><li><p>At <a href="http://adamteale.com/1413/#comment-38971">Thu 15, March 2012</a>, <span class='eg-image' style='float:right; margin-left:10px; display:block; width:80px' ><a rel='external nofollow' href='http://www.ewok1.com'><img alt='' src='http://1.gravatar.com/avatar/d0f2942d8f83204e0f500158c238c854?s=80&amp;d=http%3A%2F%2Fuse.perl.org%2Fimages%2Fpix.gif%3Fs%3D80&amp;r=G' class='avatar avatar-80 photo' height='80' width='80' /></a></span><a href="http://www.ewok1.com" onclick="javascript:_gaq.push(['_trackEvent','outbound-commentauthor','http://www.ewok1.com']);"  rel='external nofollow' class='url'>Marc Gutowski</a> wrote:</p><p># print all nodes with no connected output</p><p>(maybe helpful to find dead branches end in high complex comps)</p><p></p><p>for node in nuke.allNodes():</p><p>    if not len(node.dependent()):</p><p>        if not node.maxOutputs() == 0:</p><p>            print node.name()</p></li><li><p>At <a href="http://adamteale.com/1413/#comment-38977">Thu 15, March 2012</a>, <span class='eg-image' style='float:right; margin-left:10px; display:block; width:80px' ><a rel='external nofollow' href='http://adamteale.com'><img alt='' src='http://1.gravatar.com/avatar/d4866d87a0ada27ce67b707bc56e460b?s=80&amp;d=http%3A%2F%2Fuse.perl.org%2Fimages%2Fpix.gif%3Fs%3D80&amp;r=G' class='avatar avatar-80 photo' height='80' width='80' /></a></span><a href="http://adamteale.com"   rel='external nofollow' class='url'>Adam</a> wrote:</p><p>Looks great Marc! Thanks for sharing your code!</p></li><li><p>At <a href="http://adamteale.com/1413/#comment-40067">Thu 19, April 2012</a>, <span class='eg-image' style='float:right; margin-left:10px; display:block; width:80px' ><img alt='' src='http://1.gravatar.com/avatar/56d09e2272620e0d94156fbef18588af?s=80&amp;d=http%3A%2F%2Fuse.perl.org%2Fimages%2Fpix.gif%3Fs%3D80&amp;r=G' class='avatar avatar-80 photo' height='80' width='80' /></span>NIK wrote:</p><p>Can you help me please?! I'm having trouble duplicating a node through python.</p><p></p><p>I have a group node with a few nodes inside. I also have 10 read nodes. What I would like to do it is select all my read nodes and have the script duplicate the group and place input to the read.</p><p></p><p>any help would be greatly appreciated!</p><p>Thanks</p></li><li><p>At <a href="http://adamteale.com/1413/#comment-40216">Tue 24, April 2012</a>, <span class='eg-image' style='float:right; margin-left:10px; display:block; width:80px' ><a rel='external nofollow' href='http://www.invisfx.com'><img alt='' src='http://1.gravatar.com/avatar/34a257206dac8e77fad47de270730f7c?s=80&amp;d=http%3A%2F%2Fuse.perl.org%2Fimages%2Fpix.gif%3Fs%3D80&amp;r=G' class='avatar avatar-80 photo' height='80' width='80' /></a></span><a href="http://www.invisfx.com" onclick="javascript:_gaq.push(['_trackEvent','outbound-commentauthor','http://www.invisfx.com']);"  rel='external nofollow' class='url'>Douglas</a> wrote:</p><p>Hi Adam, Great stuff!  </p><p>I see you have code to select all read nodes but how do you select all read nodes above a selected node?</p></li><li><p>At <a href="http://adamteale.com/1413/#comment-40221">Wed 25, April 2012</a>, <span class='eg-image' style='float:right; margin-left:10px; display:block; width:80px' ><a rel='external nofollow' href='http://adamteale.com'><img alt='' src='http://1.gravatar.com/avatar/d4866d87a0ada27ce67b707bc56e460b?s=80&amp;d=http%3A%2F%2Fuse.perl.org%2Fimages%2Fpix.gif%3Fs%3D80&amp;r=G' class='avatar avatar-80 photo' height='80' width='80' /></a></span><a href="http://adamteale.com"   rel='external nofollow' class='url'>Adam</a> wrote:</p><p>Hey Douglas!</p><p></p><p>Thanks for the nice words!</p><p></p><p>I had a quick look, try this (i´ll add it above):</p><p></p><p>a = nuke.selectedNode()</p><p>nodesToSelect = []</p><p></p><p>nodesToSelect.append(a)</p><p>def climb(node):</p><p># print node.name()</p><p>nodesToSelect.append(node)</p><p>for n in node.dependencies():</p><p>climb(n)</p><p></p><p>climb(a)</p><p>for x in nodesToSelect:</p><p>print x.name()</p><p>x.setSelected(1)</p></li><li><p>At <a href="http://adamteale.com/1413/#comment-40271">Fri 27, April 2012</a>, <span class='eg-image' style='float:right; margin-left:10px; display:block; width:80px' ><a rel='external nofollow' href='http://adamteale.com'><img alt='' src='http://1.gravatar.com/avatar/d4866d87a0ada27ce67b707bc56e460b?s=80&amp;d=http%3A%2F%2Fuse.perl.org%2Fimages%2Fpix.gif%3Fs%3D80&amp;r=G' class='avatar avatar-80 photo' height='80' width='80' /></a></span><a href="http://adamteale.com"   rel='external nofollow' class='url'>Adam</a> wrote:</p><p>another Nuke Python resource:</p><p>http://nullege.com/codes/search/nuke.ask</p></li><li><p>At <a href="http://adamteale.com/1413/#comment-40504">Sat 5, May 2012</a>, <span class='eg-image' style='float:right; margin-left:10px; display:block; width:80px' ><a rel='external nofollow' href='http://www.ewok1.com'><img alt='' src='http://1.gravatar.com/avatar/d0f2942d8f83204e0f500158c238c854?s=80&amp;d=http%3A%2F%2Fuse.perl.org%2Fimages%2Fpix.gif%3Fs%3D80&amp;r=G' class='avatar avatar-80 photo' height='80' width='80' /></a></span><a href="http://www.ewok1.com" onclick="javascript:_gaq.push(['_trackEvent','outbound-commentauthor','http://www.ewok1.com']);"  rel='external nofollow' class='url'>Marc Gutowski</a> wrote:</p><p>Hey Adam,</p><p></p><p>i've put some of my Nuke Snippets online:</p><p>http://ewok1.com/resources/</p><p></p><p>best regeards,</p><p>Marc</p></li><li><p>At <a href="http://adamteale.com/1413/#comment-40507">Sun 6, May 2012</a>, <span class='eg-image' style='float:right; margin-left:10px; display:block; width:80px' ><a rel='external nofollow' href='http://adamteale.com'><img alt='' src='http://1.gravatar.com/avatar/d4866d87a0ada27ce67b707bc56e460b?s=80&amp;d=http%3A%2F%2Fuse.perl.org%2Fimages%2Fpix.gif%3Fs%3D80&amp;r=G' class='avatar avatar-80 photo' height='80' width='80' /></a></span><a href="http://adamteale.com"   rel='external nofollow' class='url'>Adam</a> wrote:</p><p>Hey Marc!</p><p></p><p>Thanks for sharing your your snippets!</p><p>Some great ones in there from what I can see.</p><p></p><p>Keep up the great work!</p><p></p><p>Cheers</p><p></p><p>Adam</p></li></ul>]]></content:encoded>
			<wfw:commentRss>http://adamteale.com/1413/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>New Showreel &#8220;Teale Reel&#8221;</title>
		<link>http://adamteale.com/830/</link>
		<comments>http://adamteale.com/830/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 08:05:28 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Extremely Cool]]></category>
		<category><![CDATA[movies]]></category>
		<category><![CDATA[thailand]]></category>
		<category><![CDATA[videos]]></category>
		<category><![CDATA[2009]]></category>
		<category><![CDATA[showreel]]></category>
		<category><![CDATA[VFX]]></category>

		<guid isPermaLink="false">http://adamteale.com/?p=830</guid>
		<description><![CDATA[Teale Reel from Adam Teale on Vimeo. Some work from the past 2 years in Bangkok, Thailand at finito! films 3 Comments At Fri 19, June 2009, Bart Verkoeijen wrote:So that's what you've been doing in one of the world's &#8230; <a href="http://adamteale.com/830/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><object width="400" height="320"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=5213139&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=5213139&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="320"></embed></object>
<p><a href="http://vimeo.com/5213139">Teale Reel</a> from <a href="http://vimeo.com/adamteale">Adam Teale</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<p>Some work from the past 2 years in Bangkok, Thailand at <a href="http://finitofilms.com">finito! films</a></p>
<hr><h2>3 Comments</h2> <ul><li><p>At <a href="http://adamteale.com/830/#comment-12152">Fri 19, June 2009</a>, <span class='eg-image' style='float:right; margin-left:10px; display:block; width:80px' ><a rel='external nofollow' href='http://bapahoko.blogspot.com'><img alt='' src='http://1.gravatar.com/avatar/bdc9c6f3c045255095e32533691d7ac6?s=80&amp;d=http%3A%2F%2Fuse.perl.org%2Fimages%2Fpix.gif%3Fs%3D80&amp;r=G' class='avatar avatar-80 photo' height='80' width='80' /></a></span><a href="http://bapahoko.blogspot.com" onclick="javascript:_gaq.push(['_trackEvent','outbound-commentauthor','http://bapahoko.blogspot.com']);"  rel='external nofollow' class='url'>Bart Verkoeijen</a> wrote:</p><p>So that's what you've been doing in one of the world's cities. Cool stuff! I'm stunned! :-O</p></li><li><p>At <a href="http://adamteale.com/830/#comment-12317">Wed 24, June 2009</a>, <span class='eg-image' style='float:right; margin-left:10px; display:block; width:80px' ><a rel='external nofollow' href='http://darkbennybot.com'><img alt='' src='http://0.gravatar.com/avatar/27441d5cd7c38a7b8b12db7a81219021?s=80&amp;d=http%3A%2F%2Fuse.perl.org%2Fimages%2Fpix.gif%3Fs%3D80&amp;r=G' class='avatar avatar-80 photo' height='80' width='80' /></a></span><a href="http://darkbennybot.com" onclick="javascript:_gaq.push(['_trackEvent','outbound-commentauthor','http://darkbennybot.com']);"  rel='external nofollow' class='url'>BENNY</a> wrote:</p><p>I really like kon thai jai yen ! That's very cool VFX demo reel man ,work with you again soon .</p><p></p><p>BENNY</p></li><li><p>At <a href="http://adamteale.com/830/#comment-12356">Thu 25, June 2009</a>, <span class='eg-image' style='float:right; margin-left:10px; display:block; width:80px' ><a rel='external nofollow' href='http://adamteale.com'><img alt='' src='http://1.gravatar.com/avatar/d4866d87a0ada27ce67b707bc56e460b?s=80&amp;d=http%3A%2F%2Fuse.perl.org%2Fimages%2Fpix.gif%3Fs%3D80&amp;r=G' class='avatar avatar-80 photo' height='80' width='80' /></a></span><a href="http://adamteale.com"   rel='external nofollow' class='url'>Adam</a> wrote:</p><p>thanks guys!</p><p>@Benny - will see you guys soon.</p></li></ul>]]></content:encoded>
			<wfw:commentRss>http://adamteale.com/830/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>the true side of vfx post production</title>
		<link>http://adamteale.com/442/</link>
		<comments>http://adamteale.com/442/#comments</comments>
		<pubDate>Thu, 10 Jul 2008 01:31:55 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Extremely Cool]]></category>
		<category><![CDATA[youtube]]></category>
		<category><![CDATA[VFX]]></category>

		<guid isPermaLink="false">http://adam.lumanation.com/?p=442</guid>
		<description><![CDATA[hilarious!]]></description>
			<content:encoded><![CDATA[<p>hilarious!</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/YvZZNwDnJuk&#038;hl=en&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.youtube.com/v/YvZZNwDnJuk&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://adamteale.com/442/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

