Hello!
I developed code that color selecting cells, code belowe:
self.polydata = polydata
self.colors.SetNumberOfComponents(3)
self.colors.SetName("Colors")
default_color = [255, 255, 255]
self.colors.SetNumberOfTuples(self.polydata.GetNumberOfCells())
self.colors.FillComponent(0, default_color[0])
self.colors.FillComponent(1, default_color[1])
self.colors.FillComponent(2, default_color[2])
# self.colors.SetTuple(1, [0, 255, 0])
self.polydata.GetCellData().SetScalars(self.colors)
"""Some Code of vtkselector"""
for j in range(num_cell_ids):
cell_id = cell_selection_list.GetValue(j)
self.colors.SetTuple(cell_id, [0, 128, 0])
self.polydata.GetCellData().SetScalars(self.colors)
And this work, i using vtkHardwareSelector to pick cells ids.
But i have another part of code where i pick cells via frustrum, and want to color them, they do not color. I also tried to color them without picking cells, i just wanted to color cells from 1 to 100, but i also dont work. Where could be a problem?