[Paraview] Help with Programmable Filter

Casey Goodlett casey.goodlett at kitware.com
Wed Aug 13 11:11:29 EDT 2014


> I wasn't sure if I had to convert to numpy arrays for this to work so I
> tried
>     xx = vtkDataArrayToVTKArray(block.CellData['USTRTOTXX'])
> ...
>
>  to get numpy arrays to use in sigma, but that doesn't work either.
>
>
I do not think you should need that when you access the cell data as you
are with block.CellData['XX']


>  P1,P2 and P3 are not declared anywhere before they are first used -
> could that be the problem?
>>

Yes that would be a problem when you try to assign an element to an array.
For example try using the python shell in paraview and executing "P1[0] =
2.0".  You should get an error message.  The list should be created prior
to element assignment like

import numpy
P1 = numpy.zeros(1)
P1[0] = 2.0


>  Also, how do I get debug prints to show up somewhere - I'm not getting
> any error messages in the console or the Output Window.
>
>
I have not seen this problem before so I do not have many suggestions.
Solving this first should help you debug the rest.  Have you tried putting
some print statements in the very first lines of the filter?  Maybe try
this in a new programmable filter in case there is a syntax error in the
code and that is obscuring the printouts?  Can you confirm the output
window you are looking at is the one you find in the Tools section of the
menu?

Hope that helps.

-- 
Casey B. Goodlett, Ph.D.
Technical Leader
Kitware, Inc. - North Carolina Office
http://www.kitware.com
(919) 969-6990 x310
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20140813/3ce1d986/attachment-0001.html>


More information about the ParaView mailing list