[Paraview-developers] Usage of ColorAttributeType in Python Soprocessing Script

Timo Oster timo.oster at ovgu.de
Fri Jun 5 05:05:39 EDT 2015


Hi ParaView Developers,

I have noticed a problem with using scripts generated with the
coprocessing script exporter for rendering screen shots in-situ. The
script generator generates code for coloring surfaces like so:

    slice1Display.ColorArrayName = ['POINTS', 'temperature']

This is the 'new' way of specifying the coloring.

When I add this script to a coprocessor that is executed during a
simulation, I will get an error that stems from this portion of code in
Wrapping/Python/paraview/coprocessing.py (line 381):

    input = rep.Input
    input.UpdatePipeline(time) #make sure range is up-to-date
    lut = rep.LookupTable
    if rep.ColorAttributeType == 'POINT_DATA':
        datainformation = input.GetPointDataInformation()
    elif rep.ColorAttributeType == 'CELL_DATA':
        datainformation = input.GetCellDataInformation()
    else:
        print 'something strange with color attribute type',
rep.ColorAttributeType

This portion of code still uses the 'old' way of using
ColorAttributeType and ColorArrayName, and, on top of that, still uses
POINT_DATA and CELL_DATA instead of POINTS and CELLS. The code following
this also uses ColorArrayName in the old way, assuming it is not a list.
If the usage of the old way here is intentional, then somewhere,
something that is supposed to ensure backwards compatibility is not
working correctly.

The client I'm using for generating the script is the exact same
ParaView version as the server evaluating it.

I have changed the code in coprocessing.py to use the new way, and
everything now seems to work correctly. However, there might be other
instances in the code that were missed when ColorArrayName was updated.
Perhaps somebody more experienced with the code might want to take a
look at this?

Regards,

Timo


More information about the Paraview-developers mailing list