First time poster here… I am a relatively new user to paraview and vtk, and an intermediate python programmer. I wanted to mention that I in case I start asking some ill posed questions.
I am working on developing a few python algorithm plugins that automate a few common workflows for my team. I have been doing this successfully with programmable filters, and now with the python algorithms loaded as plugins. Very cool stuff!
One question I had was whether I could set default display. I hadn’t work with much of pipeline downstream (actor, mapper) of the objects in the context of python scripting. Is there a way to define these as part of the output of the algorithm or programmable filter?
I realize I may not be asking the right question here, or approaching this the wrong way. In summary, once I produce the new data object with the programmable filter/algorithm I want to set the representation to ‘glyph’ or ‘surface’ and color by a specific variable so as to avoid having to do that manually in the GUI each time it is used. Any advice or tips/tricks are appreciated.
To hint that ParaView should select a particular representation for the output of a filter proxy, add a @smhint decorator after the @smproxy.filter decorator. It should look something like
To color by a specific variable (and it is a single component data array), set the variable to be the active scalar in your dataset attributes. ParaView should color by it.
For example, try this:
Start ParaView
Add a Unstructured Cell Types source. It will appear with Surface representation, colored by solid white
Now add a Programmable Filter. Before clicking the Apply button, set the Script property to
Now click Apply. The result will appear as a Surface representation, but now it is colored by the ‘Polynomial’ array, which is the “active” scalar on the point data (of class vtkPointData) .
For the @smhint.xml inputs is there any more comprehensive documentation? Or any other strategies for how I can figure out how to configure these without posting a question here every time ?
For example, I am also trying to orient and scale the 3d glyphs to a specific vector variable to a specific, but have wasted more time than I care to admit going in circles within the documentation. Any help would be appreciated.