Hello,
not sure if this is a bug issue, a syntax that changed or something else.
I have this function to extract specific values from a filter, basically i use the querySelect to select the cells or points with specific values i want, select them and then extract the data with extractSelection filter:
def extractSelectionByListOfValues(filter=[], fieldName='', listOfValues=[],singleValueComparation='==' ,cellOrPoints='CELL',complementary=False,):
"""
Extract cells or points whose field 'fieldName' matches one of listOfValues
"""
if filter==[]:
filter= GetActiveSource()
if isinstance(filter,str):
filter=FindSource(filter)
filter.UpdatePipeline()
if 'CELL' in cellOrPoints.upper():
FieldType = 'CELL'
elif 'POINT' in cellOrPoints.upper():
FieldType = 'POINT'
try:
ClearSelection()
except Exception:
pass
SetActiveSource(filter)
if isinstance(listOfValues,int) or isinstance(listOfValues,float) or (isinstance(listOfValues,list) and len(listOfValues)==1):
if isinstance(listOfValues,list) and len(listOfValues)==1:
listOfValues=listOfValues[0]
QuerySelect(QueryString= f'({fieldName} {singleValueComparation} {listOfValues})', FieldType=FieldType, InsideOut=complementary)
else:
if not isinstance(listOfValues,list):
try:
listOfValues=listOfValues.tolist()
except:
print(f'listOfValues given is not a vtkArray nor npArray nor list')
return
vMajor,vMinor=GetParaViewVersion().major,GetParaViewVersion().minor
if vMajor<=6 and vMinor<1:
QuerySelect(QueryString=f'(in1d({fieldName}, {listOfValues}))', FieldType=FieldType, InsideOut=complementary)
else:
QuerySelect(QueryString=f'(isin({fieldName}, {listOfValues}))', FieldType=FieldType, InsideOut=complementary)
extracted = ExtractSelection(Input=filter)
ClearSelection()
GetActiveView().Update()
Render()
return extracted
this function worked as intended for the previous version i was using 6.0.1, today when updating to 6.1.0, it stop working, first the queryselect syntax changed from in1D to isin as reported by me here. for this reason i added a checking paraview version to ensure that i use the correct syntax. this ‘solved’ the first issue I encountered.
nevertheless, i am encountering a second one, I use this function inside a script (that i can not share) where i call it to identify part of a 3D image, i use it repeated times in a loop (and over the output of the previous step). in 6.1.0 (which does not happen at all in 6.0.1 tested repeated times), the following warning (and error) message is shown in the output of paraview:
Generic Warning: In vtkOpenGLState.cxx, line 1806
Hardware does not support the number of textures defined.
when this happens, after if i ever try to move the renderviewer camera or interact in any possible way with a show/hide filter of the pipe line i get this warning message in continously.