<?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/category/computer-stuff/python/feed/" rel="self" type="application/rss+xml" />
	<link>http://adamteale.com</link>
	<description>ramblings of a 2 metre man</description>
	<lastBuildDate>Wed, 28 Jul 2010 22:19:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</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[VFX]]></category>
		<category><![CDATA[python]]></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 feel free to leave them in a comment below. disable &#8220;postage stamps&#8221; on all nodes [...]]]></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><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>

<hr><h2>2 Comments</h2> <ul><li><p>At <a href="http://adamteale.com/1413/#comment-16271">Thu 27, May 2010</a>, <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>, <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></ul>]]></content:encoded>
			<wfw:commentRss>http://adamteale.com/1413/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Learning Obj-C</title>
		<link>http://adamteale.com/826/</link>
		<comments>http://adamteale.com/826/#comments</comments>
		<pubDate>Sat, 30 May 2009 00:03:14 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[objective-c]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[subit]]></category>
		<category><![CDATA[obj-c]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://adamteale.com/?p=826</guid>
		<description><![CDATA[Yesterday I decided I have to give up on PyObjC for the moment and step into the world of Objective-C. I have got to a point in developing SubIt that I can&#8217;t seem to get enough out of the PyObjC bridge to be able to get what SubIt needs. So now I am in the [...]]]></description>
			<content:encoded><![CDATA[<p><img alt="" src="http://theindecisivepinay.files.wordpress.com/2009/01/pull-out-hair.jpg" title="http://theindecisivepinay.files.wordpress.com/2009/01/pull-out-hair.jpg" class="alignnone" width="250" height="290" /></p>
<p>Yesterday I decided I have to give up on PyObjC for the moment and step into the world of Objective-C.</p>
<p>I have got to a point in developing SubIt that I can&#8217;t seem to get enough out of the PyObjC bridge to be able to get what SubIt needs.</p>
<p>So now I am in the process of rewriting SubIt in Obj-C.</p>
<p>Obj-C seems weird and complicated and I can&#8217;t see why it has to be this way when Python/Ruby seem just so much much easier to understand. Oh well, I have taken the plunge.</p>
<p>I spent most of yesterday reading a great and easy to follow PDF called &#8220;<a href="http://www.cocoalab.com/?q=becomeanxcoder">Become An Xcoder</a>&#8220;, available for free download:<br />
<a href="http://www.cocoalab.com/?q=becomeanxcoder">http://www.cocoalab.com/?q=becomeanxcoder</a></p>
<p>I have been looking at a bunch of podcasts/videos/books and to me this PDF was the quickest/easiest way to get a little up to speed.</p>
]]></content:encoded>
			<wfw:commentRss>http://adamteale.com/826/feed/</wfw:commentRss>
		<slash:comments>0</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[Extremely Cool]]></category>
		<category><![CDATA[computer stuff]]></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>, 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 file creator application with PyObjC 1 Comments At Tue 24, March 2009, Bart Verkoeijen wrote:Sounds [...]]]></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>, <a href="http://bapahoko.blogspot.com" onclick="javascript:pageTracker._trackPageview('/outbound/commentauthor/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>
		<item>
		<title>distributed rendering using Apple Qmaster 3 &#8211; success!!!</title>
		<link>http://adamteale.com/408/</link>
		<comments>http://adamteale.com/408/#comments</comments>
		<pubDate>Tue, 26 Feb 2008 16:26:14 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Extremely Cool]]></category>
		<category><![CDATA[VFX]]></category>
		<category><![CDATA[computer stuff]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://adam.lumanation.com/408</guid>
		<description><![CDATA[Thanks to a fair amount of googling and a few days on and off of testing I seem to have a working setup for doing distributed processing using Apple Qmaster &#8211; for Shake, Maya and Compressor. Here is my effort at explaining what I did to get it working &#8211; big apologies, it&#8217;s poorly written. [...]]]></description>
			<content:encoded><![CDATA[<p><a href='http://adamteale.com/wp-content/uploads/2008/02/qmaster3.png' title='qmaster3logo'><img src='http://adamteale.com/wp-content/uploads/2008/02/qmaster3.thumbnail.png' alt='qmaster3logo' /></a></p>
<p><br clear="all" /> </p>
<p>Thanks to a fair amount of googling and a few days on and off of testing I seem to have a working setup for doing distributed processing using Apple Qmaster &#8211; for Shake, Maya and Compressor.</p>
<p>Here is my effort at explaining what I did to get it working &#8211; big apologies, it&#8217;s poorly written. I&#8217;ll revisit this post soon.</p>
<p><strong>some notes on our workflow</strong></p>
<li>Our current workflow for dealing with files/assets evolves around a directory structure that breaks each project up into shot numbers and the various departments we have etc..</li>
<li>Our xserve is the centralised area for our assets and the QMaster render manager.</li>
<li>Each artistâ€™s local machine has a directory somewhere that mimics the xServeâ€™s project directory structure for working locally (to keep network traffic down over gigabit ethernet).
</li>
<li>I set up $JOBS_LOCAL and $JOBS_SERVER env variables on each machine and the xserve &#8211; these variables point to the relevant local project directory on the artist&#8217;s mac and the project directory on the server.
</li>
<li>I created a python script that does a find and replace of the 2 variables and writes our a new shake script renamed â€œ*_SERVER.shkâ€, or â€œ*_LOCAL.shkâ€
</li>
<p>(See further down for setting up the ENV variables.)</p>
<p><strong>Centralised $NR_INCLUDE_PATH </strong><br />
I setup an env variable for $NR_INCLUDE_PATH for all Shake machines and the xserve &#8211; to look at a sharepoint (the nreal folder) on the xServe and automatically mount it &#8211; so all the Shake machines would be using the same macros/plugins and settings. I setup a new user on the xserve &#8220;shake&#8221; that can only mount the nreal directory.</p>
<p>After some googling around I found a way to automount volumes:</p>
<p><strong>OS X 10.5 (fstab)</strong><br />
/etc/fstab &#8211; to automount sharepoint on xServe<br />
LINK: <a href="http://blogs.sun.com/lowbit/entry/easy_afp_autmount_on_os">http://blogs.sun.com/lowbit/entry/easy_afp_autmount_on_os</a></p>
<blockquote>
<p># &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
# Mount AFP share from xServe via AFP<br />
# &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
ourserver.local:/nreal /Network/nreal url auto,url==afp://nreal:password@ourserver.local/nreal 0 0<br />
# &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
</blockquote>
<p>how to refresh automount(login as root/su):</p>
<blockquote><p>sudo automount -cv</p></blockquote>
<p><strong>OS X 10.4 (netinfo manager)</strong><br />
LINK: <a href="http://ask.metafilter.com/54223/Help-me-automount-my-smb-share-in-Apple-OS-X-reward-inside">http://ask.metafilter.com/54223/Help-me-automount-my-smb-share-in-Apple-OS-X-reward-inside</a><br />
<em>in terminal.app:</em></p>
<blockquote><p>nidump fstab . > /tmp/fstab<br />
echo &#8220;ourservernreal /Network/nreal url url==cifs://nreal:password@ourserver/nreal 0 0&#8243; >> /tmp/fstab<br />
sudo niload fstab . < /tmp/fstab<br />
sudo killall -HUP automount
</p></blockquote>
<p>how to refresh automount(login as root/su):</p>
<blockquote><p>sudo killall -HUP automount
</p></blockquote>
<p><strong>QMASTER<br />
</strong>I had tried for some time to get shake scripts to render over our network using Qmaster but it just wouldnâ€™t work. The QMaster logs were where I found all my errors. â€˜frame 0021 could not be foundâ€™, â€˜UNIX error 3 file could not be foundâ€™</p>
<p><em>things to check</em></p>
<li>shake / maya / qmaster 3 node is installed on all render machines </li>
<li>the location of all your media can be accessed by all machines</li>
<p>What seemed strange was that if I logged into the xServe and executed a script via terminal with shake (to render just on the xserve) the render would complete successfully. Then it clicked that maybe the environment variables I was using in my scripts ($xxx) might not be getting recognised by Qmaster or the way Qmaster launches Shake?? </p>
<p><strong>The big tip-off</strong><br />
I googled for the errors I kept seeing and luckily enough this forum post popped up:<br />
<a href="http://www.highend3d.com/boards/index.php?showtopic=204342">http://www.highend3d.com/boards/index.php?showtopic=204342</a></p>
<blockquote><p>â€œI have pinned this down to at least one reason &#8211; that the shake qmaster isn&#8217;t picking up the NR_INCLUDE_PATH environment variable. Does anyone know where you need to set this up on a cluster node (I can get the qmasterd to pick it up but that doesn&#8217;t solve the problem!) â€œ</p>
<p>If you are trying to use Qmaster, and need to set environment variables, then you need to create a wrapper script that sets the variables and then calls the appropriate version of shake. </p>
<p>For example, (this was from Apple) </p>
<p>NR_INCLUDE_PATH=/Network_Applications/Shake Plugins/nreal/include;export NR_INCLUDE_PATH<br />
NR_ICON_PATH=/Network_Applications/Shake Plugins/nreal/icons;export NR_ICON_PATH </p>
<p>umask 000 </p>
<p>/Applications/Shake3.50/shake.app/Contents/MacOS/shake $*<br />
status=$?<br />
if [ $status -ne 0 ]<br />
then<br />
exit $status<br />
fi </p>
<p>Then when using Qmaster, you run the application using this<br />
script (saved for example as /usr/bin/shakeWrapper) which must be<br />
installed on all nodes in the cluster. </p>
<p>Regards<br />
Nell
</p></blockquote>
<p>Cheers Nell!</p>
<p>I took Nellâ€™s script, added a few lines to it and stuck it in /usr/bin/ </p>
<p>/usr/bin/shakeWrapper &#8211; create a file to launch Shake respecting ENV variables &#8211; later alias â€˜shakeâ€™ to this file</p>
<blockquote><p>echo<br />
echo &#8220;Shake 4 running through a wrapper script &#8211; /usr/bin/shakeWrapper&#8221;<br />
echo</p>
<p>umask 000 </p>
<p>/Applications/Shake/shake.app/Contents/MacOS/shake $*<br />
status=$?<br />
if [ $status -ne 0 ]<br />
then<br />
exit $status<br />
fi</p></blockquote>
<p>I added the first few lines there so when I later made an alias to this script the Shake user would have some idea what is going on when launching Shake via the terminal.</p>
<p><strong>Setting up the ENV (environment) variables&#8230;</strong></p>
<blockquote><p>/etc/profile &#8211; to declare system-wide Environment variables / aliases<br />
(alias shake to use a wrapper to make it launch respecting/recognising the env variables)</p>
<p># System-wide .profile for sh(1)</p>
<p>if [ -x /usr/libexec/path_helper ]; then<br />
	eval `/usr/libexec/path_helper -s`<br />
fi</p>
<p>if [ "${BASH-no}" != "no" ]; then<br />
	[ -r /etc/bashrc ] &#038;&#038; . /etc/bashrc<br />
fi</p>
<p>JOBS_LOCAL=&#8221;/Volumes/otherdrive/jobs&#8221;;<br />
export JOBS_LOCAL</p>
<p>JOBS_SERVER=&#8221;/Volumes/ourserversharepoint/jobs&#8221;;<br />
export JOBS_SERVER</p>
<p>NR_INCLUDE_PATH=&#8221;$HOME/nreal/include&#8221;:&#8221;/Network/nreal/include/&#8221;;<br />
export NR_INCLUDE_PATH</p>
<p>alias shake=&#8221;/usr/bin/shakeWrapper&#8221;
</p></blockquote>
<p>*remember to enter into terminal:<br />
source /etc/profile </p>
<hr><h2>2 Comments</h2> <ul><li><p>At <a href="http://adamteale.com/408/#comment-3716">Tue 4, March 2008</a>, Warwick wrote:</p><p>excellent detail. nice job!!</p></li><li><p>At <a href="http://adamteale.com/408/#comment-3758">Wed 5, March 2008</a>, Will wrote:</p><p>$what_the/ hell/ are_$you talkin bout(?) -x</p></li></ul>]]></content:encoded>
			<wfw:commentRss>http://adamteale.com/408/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>some Python &amp; SSH remote machine coolness</title>
		<link>http://adamteale.com/376/</link>
		<comments>http://adamteale.com/376/#comments</comments>
		<pubDate>Fri, 23 Nov 2007 09:44:32 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Extremely Cool]]></category>
		<category><![CDATA[computer stuff]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://adam.lumanation.com/376</guid>
		<description><![CDATA[And now for a bit of self taught nerdy goodness&#8230; I just managed to get something kind of cool working. We have a cool tool in the pipeline, but in the meantime my hacked together python efforts will have to do! A few months ago I created a python script for building &#8216;job&#8217; directories &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>And now for a bit of self taught nerdy goodness&#8230;</p>
<p>I just managed to get something kind of cool working.</p>
<p>We have a cool tool in the pipeline, but in the meantime my hacked together python efforts will have to do! <img src='http://adamteale.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>A few months ago I created a python script for building &#8216;job&#8217; directories &#8211; for new jobs that came into the building &#8211; a script that runs in a shell.</p>
<p>I then learnt about wxpython and turned the script into a GUI app. </p>
<p>This was cool to run on my machine, but I needed a way for it to be used by other artists / producers.</p>
<p>We got an xServe and some disk storage so I put the script onto the xServe. I was able to log in via VNC and run the script to create the job directories that everyone could access. This gave us all a place to put files in a structured manner and not let things get too messed up (thanks to file permissions).</p>
<p>But the problem was that for me to execute the script, I&#8217;d have to VNC or SSH into the server. I didn&#8217;t mind doing it, but it was not so useful when I wasn&#8217;t around.</p>
<p>So back to this &#8216;new job&#8217; script&#8230;.</p>
<p>I just worked out how to setup a producer&#8217;s mac to be able to &#8220;remotely execute the python &#8216;new job&#8217; script on our xServe&#8221; using SSH and python.</p>
<p>All a producer has to do is type into Terminal:</p>
<blockquote><p>newjob</p></blockquote>
<p>and it all starts up. The producer is asked the &#8216;name of the job&#8217; and &#8216;the number of shots&#8217; and the script goes ahead and builds all the directories.</p>
<p><strong>How I did it</strong></p>
<p><em>Getting into the xServe.</em><br />
I realised that I would not be able to do too much to the file structure of the xServe&#8217;s file system if I was to simply mount it on a Desktop &#8211; due to permissions etc&#8230; and I also didn&#8217;t want &#8216;the user&#8217; to have to mount anything manually. It needed to brainless. SSH seemed the best way.</p>
<p>I found out pretty quickly that there wasn&#8217;t an easy way to get out of entering the &#8216;admin password&#8217; for the xServe to remotely execute the script (you have to enter a password when you ssh into another machine). </p>
<p>I didn&#8217;t want to give away our admin password for the xserve. So I read up on SSH and discovered SSH-Key&#8217;s.<br />
A cool way to authenticate your machine to the remote machine without having to enter the &#8216;login password&#8217; for the remote user. Instead you give the SSH connection a &#8216;passphrase&#8217;. Initially you have to login to the remote machine with the remote password, but after that it&#8217;s all &#8216; about &#8216;enter your passphrase for key&#8217;.</p>
<p>To set up the <a href="http://en.wikipedia.org/wiki/RSA">RSA key</a> for your local machine I followed this <a href="http://www.ibm.com/developerworks/aix/library/au-satdistadmin/index.html">easy to read tutorial from IBM</a>.</p>
<p>Basically you need to generate a public key and add that to the list of &#8216;known computers&#8217; on the remote machine.</p>
<p>To generate the public key (according to the IBM article) run this command in a shell:</p>
<blockquote><p>$ ssh-keygen -t rsa</p></blockquote>
<p>and follow the prompts.</p>
<p>You can choose to not have a passphrase, but that seemed a little too much of a security risk for our setup.<br />
Next I got a bit confused, the command spat out 2 files into a &#8216;.ssh&#8217; directory in your home folder:</p>
<p>id_dsa<br />
id_dsa.pub</p>
<p>These are the default names and location if u DON&#8217;T enter a name for the key.</p>
<p>To get the public key (the .pub file) into the list of known machines on the xServe I mounted the xServe&#8217;s Admin&#8217;s home folder on the local machine. </p>
<p>I got into the .ssh directory in the home folder of the xserve, and went looking for the file:</p>
<blockquote><p>.ssh/authorized_keys</p></blockquote>
<p>but couldn&#8217;t see it.</p>
<p>So i created a file called &#8216;authorized_keys&#8217; using the following command:</p>
<blockquote><p>touch authorized_keys</p></blockquote>
<p>Then to add the public key I ran a &#8216;cat&#8217; command to append the public key file to the &#8216;authorized_keys&#8217; file on the server.</p>
<p>It worked! I was able to login the the xServe using the passphrase. Shweet!</p>
<p>I found <a href="http://discussions.apple.com/thread.jspa?messageID=678149&#678149">this post</a> on an apple forum also very helpful.</p>
<p><em>Executing the script</em></p>
<p>On the remote machine / xServe is where the python script lives &#8211; in a folder called &#8216;scripts&#8217; in the home folder.<br />
To run this script in a shell on the xServe I would type:</p>
<blockquote><p>python /Path/to/the/script/newjob.py</p></blockquote>
<p>So I figured from the local machine the command to execute using ssh would be:</p>
<blockquote><p>ssh admin@ourserver.local python /Path/to/the/script/newjob.py</p></blockquote>
<p>And that did work.</p>
<p>But that was wayyyyyy too long for or our Producer to have to type up.</p>
<p>So I made bash alias in the bash_profile:</p>
<blockquote><p>alias newjob ssh admin@ourserver.local python /Path/to/the/script/newjob.py</p></blockquote>
<p>i tried the alias, and it connected, but it didn&#8217;t seem the script was doing anything. But it was. I couldnt see the interactive text prompting me to enter a &#8216;jobname&#8217; or &#8216;amount of shots&#8217;, but it WAS asking for it.</p>
<p>Why couldn&#8217;t I see the text? I was stumped. Why wasn&#8217;t the shell showing me the feedback from the xServe?</p>
<p>I read the man pages of SSH and found out a bunch of options you can pass the ssh command. Somehow I came across this:</p>
<blockquote><p>-t      Force pseudo-tty allocation.  This can be used to execute arbitrary screen-based programs on a remote machine, which can be very useful, e.g. when implementing menu services.  Multiple -t options force tty allocation, even if ssh has no local tty.
</p></blockquote>
<p>As soon as I put that into the command it all worked!</p>
<blockquote><p>ssh -t admin@ourserver.local python /Path/to/the/script/newjob.py</p></blockquote>
<p>The last thing I did to make this even easier was to create a &#8216;.command&#8217; file in the OSX Finder, that can just be double clicked and it will open Terminal.app and run the above command.</p>
<hr><h2>2 Comments</h2> <ul><li><p>At <a href="http://adamteale.com/376/#comment-992">Sun 25, November 2007</a>, Luke wrote:</p><p>Man, you are one smart cookie.</p></li><li><p>At <a href="http://adamteale.com/376/#comment-997">Mon 26, November 2007</a>, <a href="http://bapahoko.blogspot.com" onclick="javascript:pageTracker._trackPageview('/outbound/commentauthor/bapahoko.blogspot.com');"  rel='external nofollow' class='url'>Bart Verkoeijen</a> wrote:</p><p>Wow, you should start writing your own "* for Dummies" series! :-)</p></li></ul>]]></content:encoded>
			<wfw:commentRss>http://adamteale.com/376/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>rsync</title>
		<link>http://adamteale.com/362/</link>
		<comments>http://adamteale.com/362/#comments</comments>
		<pubDate>Tue, 25 Sep 2007 15:25:32 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Extremely Cool]]></category>
		<category><![CDATA[computer stuff]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://adam.lumanation.com/362</guid>
		<description><![CDATA[life is good with rsync. I have been playing around with a python script using rsync to create an easy way for syncing new material from our server to local machines (it can be a pain in the ass to navigate folders looking for the new stuff) &#8211; keeping the folder structure etc&#8230; &#8211; and [...]]]></description>
			<content:encoded><![CDATA[<p>life is good with <a href="http://samba.anu.edu.au/rsync/">rsync</a>.</p>
<p>I have been playing around with a python script using rsync to create an easy way for syncing new material from our server to local machines  (it can be a pain in the ass to navigate folders looking for the new stuff) &#8211; keeping the folder structure etc&#8230; &#8211; and most importantly not destroying anything.</p>
<p>I&#8217;d never really understood how to use it &#8211; thinking it was only for local to remote transfers &#8211; but it works on anything. Brilliant!</p>
<p>RSYNC rocks!</p>
]]></content:encoded>
			<wfw:commentRss>http://adamteale.com/362/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python script to get all maximum values in an image sequence</title>
		<link>http://adamteale.com/353/</link>
		<comments>http://adamteale.com/353/#comments</comments>
		<pubDate>Fri, 14 Sep 2007 14:59:57 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[VFX]]></category>
		<category><![CDATA[computer stuff]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://adam.lumanation.com/353</guid>
		<description><![CDATA[Yesterday i fudged together a python script to use Shake and create an image that is the maximum values of that sequence. The output of the python script is a Shake script that contains as many FileIns as there are images in the sequence &#8211; each one slipped one frame more than the previous. Does [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday i fudged together a python script to use Shake and create an image that is the maximum values of that sequence.</p>
<p>The output of the python script is a Shake script that contains as many FileIns as there are images in the sequence &#8211; each one slipped one frame more than the previous. Does that make any sense?</p>
<p>Each image is plugged into a Max layer node and then that is plugged into the next Max layer node etc&#8230;.</p>
<p>So depending on the length of your sequence the Shake script can be enormous! </p>
<p>Python is awesome.</p>
<p><br clear="all" /><br />
<a href='http://adamteale.com/wp-content/uploads/2007/09/shake_maxscript.jpg' title='shake_maxscript_image'><img src='http://adamteale.com/wp-content/uploads/2007/09/shake_maxscript.thumbnail.jpg' alt='shake_maxscript_image' /></a><br />
<br clear="all" /> </p>
<p>Here is the script:<br />
<a class="downloadlink" href="http://adamteale.com/download/shake_max.py" title="Version1 downloaded 147 times" >shake max python script (147)</a></p>
<hr><h2>2 Comments</h2> <ul><li><p>At <a href="http://adamteale.com/353/#comment-612">Sat 15, September 2007</a>, Warwick wrote:</p><p>cool.. but can't see the script....</p></li><li><p>At <a href="http://adamteale.com/353/#comment-613">Sat 15, September 2007</a>, <a href="http://adam.lumanation.com" onclick="javascript:pageTracker._trackPageview('/outbound/commentauthor/adam.lumanation.com');"  rel='external nofollow' class='url'>Adam</a> wrote:</p><p>doh!</p><p>should be there now :)</p></li></ul>]]></content:encoded>
			<wfw:commentRss>http://adamteale.com/353/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>&#8220;snake eyes&#8221; or the story of how I have spent too much time with a computer Python.</title>
		<link>http://adamteale.com/276/</link>
		<comments>http://adamteale.com/276/#comments</comments>
		<pubDate>Tue, 29 May 2007 13:39:20 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://adam.lumanation.com/276</guid>
		<description><![CDATA[Catchy title? ok, just lameâ€¦ I have finally made some steps with 1 progamming language. Years ago some good folks at Emerald City Design said I should try get into the programming language Python. I never got very far and just couldn&#8217;t grasp the concept. Since then I opened a book on Objective C and [...]]]></description>
			<content:encoded><![CDATA[<p>Catchy title? ok, just lameâ€¦</p>
<p>I have finally made some steps with 1 progamming language. Years ago some good folks at <a href="http://www.emeraldcitydesign.com/">Emerald City Design</a> said I should try get into the programming language <a href="http://python.org">Python</a>. I never got very far and just couldn&#8217;t grasp the concept. Since then I opened a book on Objective C and had a serious brain fade. </p>
<p>Luckily I got the hang of some basic Shell scripting and started to feel a little better about the whole speaking computer thing.<br />
Then the other day I wanted to recreate some sort of tool I saw at a few post houses I&#8217;ve worked at. A &#8220;new job&#8221; creation tool &#8211; so when a new job for VISA card comes in and you need to setup 50 folders for it with all the sub directories etc&#8230; you can just punch in VISA and 50 folders and it will be made.</p>
<p>Well I have a very basic version that seems to work fine from a shell.<br />
I have also got a basic version running in a GUI using the <a href="http://www.pythonware.com/library/tkinter/introduction/">Tkinter</a> modules (are they modules? i still have no idea).<br />
I have no user error things setup so if the user types in they&#8217;d like BANANA shots instead of 34 then the scripts will probably get all confused.<br />
Also I wanted to test out an if/then statement, so i used it to change the number padding of the shot folder names depending on how many shots you needed &#8211; very pointless and not cool &#8211; but it works</p>
<p><a href='http://adamteale.com/wp-content/uploads/2007/05/newjob_guipy.zip' title='NewJob_GUI.py - v1'>NewJob_GUI.py &#8211; v1</a><br />
<a href='http://adamteale.com/wp-content/uploads/2007/05/newjob_scriptpy.zip' title='NewJob_script.py - v1'>NewJob_script.py &#8211; v1</a></p>
<p>(WordPress user note &#8211; if you want to upload files using the &#8216;inline upload&#8217; when writing posts, certain files aren&#8217;t allowed &#8211; like &#8220;.zip&#8221; &#8211; so get <a href="http://blog.ftwr.co.uk/wordpress/mime-config/">THIS PLUGIN</a>)</p>
<p>I&#8217;m about to try compile the script so it can be run by itself. This is my lead so far:<br />
<a href="http://effbot.org/zone/python-compile.htm">http://effbot.org/zone/python-compile.htm</a></p>
<p>Anyway, it&#8217;s a start&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://adamteale.com/276/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.705 seconds -->
