<div dir="ltr">Doug,<div><br></div><div>This is a long-standing oddness in VTK. If you call SetScalars() on point data, for example, a side effect is that the current active scalars is removed from the point data! I have been bitten by this in the past. We should probably change this behavior to avoid surprising effects like this despite the backwards compatibility issues (which are hopefully few).</div><div><br></div><div>I recommend calling SetActiveScalars(const char* name) instead, which shouldn't remove your array.</div><div><br></div><div>HTH,</div><div>Cory</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 3, 2016 at 8:09 AM, jhirsch <span dir="ltr"><<a href="mailto:jan.hirsch@st.ovgu.de" target="_blank">jan.hirsch@st.ovgu.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello Doug,<br>
your source example just creates two arrays and set their names and<br>
therefore has little to do with your problem, I guess. Can you copy more<br>
lines of code that show the problem with the scalar replacement?<br>
<br>
In general I would recommend to create a scalar array with 3 components and<br>
use that for colours. Like this:<br>
<br>
(that's from the example  here<br>
<<a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ColoredPoints" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ColoredPoints</a>>  )<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/SetScalar-removes-my-color-scalars-tp5736971p5736995.html" rel="noreferrer" target="_blank">http://vtk.1045678.n5.nabble.com/SetScalar-removes-my-color-scalars-tp5736971p5736995.html</a><br>
Sent from the VTK - Users mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Cory Quammen<br>R&D Engineer<br>Kitware, Inc.</div>
</div>