clean selection without message when run without anything selected

Hello,

I am running a python script that clears selection, creates a selection and then extracts it, lastly clears the selection again.
it works, but i am having a small annoyance, when running ClearSelection(), if i dont have anything selected, i get the following print (which is annoying as i am printing some debug info during the run)

ClearSelection() warning: In unknown, line 0 warning: dataChanged() called with an invalid index range: topleft: QModelIndex(-1,-1,0x0,QObject(0x0)) bottomRight:QModelIndex(-1,-1,0x0,QObject(0x0))

is it possible to remove this?

thanks in advance,

Can you share a Python script which shows the problem? I suspect that some method needs to check for valid indices before trying anything with them.

Cc: @cory.quammen @mwestphal

Hello ben,

there is no ‘script’ one can simply create a sphere source filter, select it and in the python terminal copy/paste ClearSelection().

if there is something selected (point/cell), it will deselected (eventhought in the renderViewer will not show up automatically that it was deselected), but if we do extract selection we will not extract anything.

if there is nothing selected, it will spit out this warning error.

just in case here is a super simple script:

from paraview.simple import *

paraview.simple._DisableFirstRenderCameraReset()

sphere1 = Sphere(registrationName='Sphere1')

UpdatePipeline(time=0.0, proxy=sphere1)
#hit the eye button in the pipeline browser, is there a way to not need to do this!?

ClearSelection() #<- this one will print out the warning message of my post.

SelectCellsThrough(Rectangle=[464, 125, 464, 125], Modifier=None)

ClearSelection() #<-    this one will not print out any warning, will 'deselect' the cells that i selected in the previous line

#                       but the renderviewer will not update (if i do this sequence in the gui, and he cells will show as if they

#                       are still be selected) it will require a 'Render()' after it

regards,
PS. I am using paraview 6.0.1

Unable to reproduce on ParaView 6.0.1 binary release on Linux.

I am in exactly the same version i dont understand.
steps:

  1. ctr+space sphere select source filter sphere
  2. apply source filter sphere
  3. click on python terminal with the mouse
  4. paste ClearSelection() hit enter
  5. get the warning

oh! i was re doing as i was surprised and i think i found where it comes from. it is when one has the find data open (view/find data) and runs ClearSelection()

Indeed, I reproduced with the “FindData” widget open.

Please open an issue :slight_smile:

1 Like

created: https://gitlab.kitware.com/paraview/paraview/-/issues/23196