<div dir="ltr"><div>Give each array a name (vtkDataArray::SetName()) and use AddArray (vtkFieldData:AddArray()) instead of using the atttibutes based API (vtkDataSetAttributes::Set{Scalars/Tensors/Vectors....})</div><div><br></div><div>ParaView uses named array access almost exclusively anyway.</div><div><br></div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>David E DeMarle<br>Kitware, Inc.<br>Principal Engineer<br>21 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: 518-881-4909</div></div></div></div></div></div>
<br><div class="gmail_quote">On Wed, Oct 25, 2017 at 12:32 PM, Heiland, Randy <span dir="ltr"><<a href="mailto:heiland@iu.edu" target="_blank">heiland@iu.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">How does one use 2 (or more) scalar fields in a dataset, e.g. one for a colormap, one to scale glyphs?  E.g., Pgmable Source:<br>
<br>
pdo = self.GetPolyDataOutput()<br>
<br>
num_pts = 2<br>
newPts = vtk.vtkPoints()<br>
cell_color_ID = vtk.vtkFloatArray()<br>
cell_radius = vtk.vtkFloatArray()<br>
<br>
cell_color_ID.SetName('cell_<wbr>color_ID')<br>
cell_radius.SetName('cell_<wbr>radius')<br>
<br>
newPts.InsertPoint(0, -1,0,0)<br>
cell_color_ID.InsertNextValue(<wbr>1)<br>
cell_radius.InsertNextValue(0.<wbr>2)<br>
<br>
newPts.InsertPoint(1, 1,0,0)<br>
cell_color_ID.InsertNextValue(<wbr>2)<br>
cell_radius.InsertNextValue(0.<wbr>3)<br>
<br>
pdo.SetPoints(newPts)<br>
pdo.GetPointData().SetScalars(<wbr>cell_color_ID)<br>
pdo.GetPointData().SetScalars(<wbr>cell_radius)   # overrides the 1st<br>
<br>
verts = vtk.vtkCellArray()<br>
for idx in range(0, num_pts):<br>
  verts.InsertNextCell(1)<br>
  verts.InsertCellPoint(idx)<br>
pdo.SetVerts(verts)<br>
<br>
<br>
thanks, Randy<br>______________________________<wbr>_________________<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/<wbr>opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" rel="noreferrer" target="_blank">http://paraview.org/Wiki/<wbr>ParaView</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=ParaView" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/paraview" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/paraview</a><br>
<br></blockquote></div><br></div>