<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hello,<br>
<br>
After staring at <a href="http://www.paraview.org/Wiki/Python_Programmable_Filter" target="_blank">
http://www.paraview.org/Wiki/Python_Programmable_Filter</a> for a while, the way to access the data for a specific variable name still eludes me. This is the python code from the wiki on Add the Colors variable to a PolyData<br>
<br>
=============================<br>
<div dir="ltr" class="mw-geshi" style="text-align: left;">
<div class="python source-python">
<pre class="de1"><span class="kw2">input</span> = <span class="kw2">self</span>.<span class="me1">GetPolyDataInput</span><span class="br0">(</span><span class="br0">)</span><span class="sy0">;</span>
output = <span class="kw2">self</span>.<span class="me1">GetPolyDataOutput</span><span class="br0">(</span><span class="br0">)</span><span class="sy0">;</span>
colors = vtk.<span class="me1">vtkUnsignedCharArray</span><span class="br0">(</span><span class="br0">)</span><span class="sy0">;</span>
colors.<span class="me1">SetNumberOfComponents</span><span class="br0">(</span><span class="nu0">3</span><span class="br0">)</span><span class="sy0">;</span>
colors.<span class="me1">SetName</span><span class="br0">(</span><span class="st0">"Colors"</span><span class="br0">)</span><span class="sy0">;</span>
numPoints = <span class="kw2">input</span>.<span class="me1">GetNumberOfPoints</span><span class="br0">(</span><span class="br0">)</span>
<span class="kw1">for</span> i <span class="kw1">in</span> <span class="kw2">range</span><span class="br0">(</span><span class="nu0">0</span>, numPoints<span class="br0">)</span>:
colors.<span class="me1">InsertNextTuple3</span><span class="br0">(</span><span class="nu0">255</span>,<span class="nu0">0</span>,<span class="nu0">0</span><span class="br0">)</span><span class="sy0">;</span>
output=<span class="kw2">input</span>
output.<span class="me1">GetPointData</span><span class="br0">(</span><span class="br0">)</span>.<span class="me1">AddArray</span><span class="br0">(</span>colors<span class="br0">)</span></pre>
</div>
</div>
===============================<br>
<br>
How do I from the next filter, access the variable name "Colors" that I created? <br>
<br>
Any help is much appreciated. <br>
<br>
thanks<br>
-simon<br>
</div>
</body>
</html>