<?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; python</title>
	<atom:link href="http://adamteale.com/tag/python/feed/" rel="self" type="application/rss+xml" />
	<link>http://adamteale.com</link>
	<description>ramblings of a 2 metre man</description>
	<lastBuildDate>Thu, 17 May 2012 17:16:30 +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>fcp 7 to nuke</title>
		<link>http://adamteale.com/1785/</link>
		<comments>http://adamteale.com/1785/#comments</comments>
		<pubDate>Tue, 08 May 2012 19:47:49 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[computer stuff]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[VFX]]></category>
		<category><![CDATA[elementree]]></category>
		<category><![CDATA[fcp]]></category>
		<category><![CDATA[fcp7]]></category>
		<category><![CDATA[nuke]]></category>
		<category><![CDATA[parse]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://adamteale.com/?p=1785</guid>
		<description><![CDATA[Scenario A FCP 7 timeline with 20 shots in it (all in one video layer). I need to comp them all separately in nuke. I want to have each shot in a separate numbered directory, with subdirectories for &#8220;scripts&#8221; and &#8230; <a href="http://adamteale.com/1785/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>Scenario</strong><br />
<em>A FCP 7 timeline with 20 shots in it (all in one video layer).<br />
I need to comp them all separately in nuke.<br />
I want to have each shot in a separate numbered directory, with subdirectories for &#8220;scripts&#8221; and &#8220;renders&#8221;<br />
</em></p>
<p>Here is a little python script i wrote this morning to export a basic FCP 7 timeline as a series of nuke scripts into numbered shot directories.<br />
This script parses an XML file that I exported from FCP 7 (the sequence/edit).</p>
<p>I have only used this for the purposes i needed, but it works.<br />
Perhaps it could be expanded to incorporate multiple video layers.</p>
<p>Each nuke script that is generated is just a read node, with the nuke.root frame range set to the duration of the clip in FCP 7.</p>
<p>Even if the script doesn&#8217;t help everyone&#8217;s fcp7-nuke needs I found that i learnt a lot about Python&#8217;s elementTree XML library. Nice clean simple.<br />
And also this page was a big help to get things going:<br />
<a href="http://drumcoder.co.uk/blog/2010/jun/17/using-elementtree-python/">http://drumcoder.co.uk/blog/2010/jun/17/using-elementtree-python/</a></p>
<p>The script needs to be run from a shell/terminal:<br />
<strong>python /path/to/the/script/fcpNuke.py /path/to/you/xmlfile.xml</strong></p>
<p>*file re-uploaded 11 May 2012</p>
<p>The script:<br />
<a class="downloadlink" href="http://adamteale.com/download/fcpNuke.py.zip" title=" downloaded 16 times" >fcp7toNuke (16)</a></p>
<hr><h2>2 Comments</h2> <ul><li><p>At <a href="http://adamteale.com/1785/#comment-40658">Fri 11, May 2012</a>, <span class='eg-image' style='float:right; margin-left:10px; display:block; width:80px' ><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' /></span>Bart Verkoeijen wrote:</p><p>The script download gives a error 500. Maybe archive to zip?</p></li><li><p>At <a href="http://adamteale.com/1785/#comment-40678">Sat 12, 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>Thanks for spotting that! dude! File is now available as a zip.</p></li></ul>]]></content:encoded>
			<wfw:commentRss>http://adamteale.com/1785/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<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: 26 April 2012</em></p>
<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>SubIt 1.0.1</title>
		<link>http://adamteale.com/799/</link>
		<comments>http://adamteale.com/799/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 18:42:39 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[computer stuff]]></category>
		<category><![CDATA[Extremely Cool]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[subit]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[dvdsp]]></category>
		<category><![CDATA[export]]></category>
		<category><![CDATA[fcp]]></category>
		<category><![CDATA[import]]></category>
		<category><![CDATA[interface builder]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[pyobjc]]></category>
		<category><![CDATA[stl]]></category>
		<category><![CDATA[subtitle]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[xcode]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://adamteale.com/?p=799</guid>
		<description><![CDATA[SubIt 1.0.1 is here! Support for Non-ASCII characters Method for cleaning up Overlapping Timecode Download here For a little bit more info: http://adamteale.com/subit/ 1 Comments At Tue 28, April 2009, warwick wrote:looks like new career in software development]]></description>
			<content:encoded><![CDATA[<p>SubIt 1.0.1 is here!</p>
<p><img src="http://adamteale.com/wp-content/uploads/2009/03/subitdog101.gif" alt="subitdog101" title="subitdog101" width="368" height="194" class="alignnone size-full wp-image-797" /></p>
<p>Support for Non-ASCII characters<br />
Method for cleaning up Overlapping Timecode</p>
<p>Download <a href="http://adamteale.com/wp-content/plugins/download-monitor/download.php?id=1">here</a></p>
<p>For a little bit more info:<br />
<a href="http://adamteale.com/subit/">http://adamteale.com/subit/</a></p>
<hr><h2>1 Comments</h2> <ul><li><p>At <a href="http://adamteale.com/799/#comment-10894">Tue 28, April 2009</a>, <span class='eg-image' style='float:right; margin-left:10px; display:block; width:80px' ><img alt='' src='http://1.gravatar.com/avatar/532026318997e340000e5572937677b6?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>warwick wrote:</p><p>looks like new career in software development</p></li></ul>]]></content:encoded>
			<wfw:commentRss>http://adamteale.com/799/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Project: Subtitle App</title>
		<link>http://adamteale.com/724/</link>
		<comments>http://adamteale.com/724/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 08:00:50 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[GUI]]></category>
		<category><![CDATA[interface builder]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[quicktime]]></category>
		<category><![CDATA[subtitle]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://adamteale.com/?p=724</guid>
		<description><![CDATA[My new project &#8211; create a mac app that allows a user to view a video and create a &#8220;subtitle&#8221; text file on the fly. Update: I created a dedicated page for SubIt &#8211; my attempt at creating a SubTitle &#8230; <a href="http://adamteale.com/724/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>My new project &#8211; create a mac app that allows a user to view a video and create a &#8220;subtitle&#8221; text file on the fly.</p>
<p>Update: I created a <a href="http://adamteale.com/subit">dedicated page for SubIt</a> &#8211; my attempt at creating a SubTitle file creator application with PyObjC</p>
<hr><h2>1 Comments</h2> <ul><li><p>At <a href="http://adamteale.com/724/#comment-10135">Tue 24, March 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>Sounds like a fun application to develop. Let me know if you run into issues! :-)</p></li></ul>]]></content:encoded>
			<wfw:commentRss>http://adamteale.com/724/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

