I’ve been trying to convert a Point Array of the Properties Panel (a double value) into hashcode with the help of the programmable filter. I tried several times, but it never worked.
I expected to see another parameter on the Spreadsheet view, but I never was able to. Do I have to define that additionally?
I especially had problems in defining the input and output and extracting/using the Point array in the filter itself. I tried to convert via the hash() method.
I’d be thankful for any advice
Now I have following:
input = inputs
pointData = input.GetPointData()
firstUid = pointData.GetArray(‘uid_1’)
firstHash = hash(firstUid)
I can see firstHash in the Spreadsheet view, however it is the same value for every uid_1 (Originally I am working on Particles, each having their own uid)
What did I do wrong?
hash() method only hashes the pointer to the data array, not the contents of the array.
You need a for loop to hash each of your values, and add them into a new array.
I tried to iterate as you said, but I am still not familiar with the Programmable filter.
How can I use the for loop in particular?
Okay, so here is what I found out: With firstUid = pointData.GetArray(‘uid_1’) Paraview returns a None-Value. This explains why firstUid[i].GetValue() was throwing an Exception the whole time, when I tried using the for loop.
Is there another way to get the Point Array?