<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hi all,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I try to render a polydata with a plain solid color using a 2D actor. However, it seems that with OpenGL2 rendering backend, if a polydata has scalars and rendered once with scalar visibility enabled, ScalarVisibility cannot be disabled
anymore. The actor will always appear as colored. In some cases, the colors randomly flicker. See a very simple code snippet below to reproduce it.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The same code works well (scalar visibility can be enabled/disabled) using VTK OpenGL1 backend. If I use 3D mapper and actor (vtkPolyDataMapper and vtk.vtkActor) then it works well using both VTK OpenGL1 and OpenGL2 backends.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Is this a known issue? Could somebody have a look?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thank you,<o:p></o:p></p>
<p class="MsoNormal">Andras<o:p></o:p></p>
<div style="mso-element:para-border-div;border:none;border-bottom:solid windowtext 1.0pt;padding:0cm 0cm 1.0pt 0cm">
<p class="MsoNormal" style="border:none;padding:0cm"><o:p> </o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">reader = vtk.vtkXMLPolyDataReader()<o:p></o:p></p>
<p class="MsoNormal">reader.SetFileName("scalartest.vtp")<o:p></o:p></p>
<p class="MsoNormal">mapper = vtk.vtkPolyDataMapper2D()<o:p></o:p></p>
<p class="MsoNormal">mapper.SetInputConnection(reader.GetOutputPort())<o:p></o:p></p>
<p class="MsoNormal">actor = vtk.vtkActor2D()<o:p></o:p></p>
<p class="MsoNormal">actor.SetMapper(mapper)<o:p></o:p></p>
<p class="MsoNormal">actor.SetPosition(150,150)<o:p></o:p></p>
<p class="MsoNormal">ren = vtk.vtkRenderer()<o:p></o:p></p>
<p class="MsoNormal">ren.AddActor(actor)<o:p></o:p></p>
<p class="MsoNormal">renWin = vtk.vtkRenderWindow()<o:p></o:p></p>
<p class="MsoNormal">renWin.AddRenderer(ren)<o:p></o:p></p>
<p class="MsoNormal">renWin.Render()<o:p></o:p></p>
<p class="MsoNormal"># actor appears in color here => OK<o:p></o:p></p>
<p class="MsoNormal">mapper.SetScalarVisibility(False)<o:p></o:p></p>
<p class="MsoNormal">renWin.Render()<o:p></o:p></p>
<p class="MsoNormal"># actor appears in color here => ERROR (it should be white)<o:p></o:p></p>
<div style="mso-element:para-border-div;border:none;border-bottom:solid windowtext 1.0pt;padding:0cm 0cm 1.0pt 0cm">
<p class="MsoNormal" style="border:none;padding:0cm"><o:p> </o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Download link for scalartest.vtp sample data set (any other polydata with scalars should work):<o:p></o:p></p>
<p class="MsoNormal"><a href="https://1drv.ms/u/s!Arm_AFxB9yqHtK1gHCIsGt0U62OTQg">https://1drv.ms/u/s!Arm_AFxB9yqHtK1gHCIsGt0U62OTQg</a><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>