# VTK9 - Black viewport when using rubber band style

**URL:** https://discourse.vtk.org/t/vtk9-black-viewport-when-using-rubber-band-style/3515
**Category:** Support
**Created:** [June 10, 2020, 1:30pm UTC](https://discourse.vtk.org/t/vtk9-black-viewport-when-using-rubber-band-style/3515 "2020-06-10T13:30:32Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![panicbuttonvfx](https://discourse.vtk.org/user_avatar/discourse.vtk.org/panicbuttonvfx/32/1838_2.png) [@panicbuttonvfx](https://discourse.vtk.org/u/panicbuttonvfx)
#### Post date: [June 10, 2020, 1:30pm UTC](https://discourse.vtk.org/t/vtk9-black-viewport-when-using-rubber-band-style/3515/1 "2020-06-10T13:30:32Z")

</div>

Hi,

When using any sort of rubber band style (e.g. `vtkInteractorStyleRubberBandZoom`, `vtkInteractorStyleRubberBandPick`, etc…), the viewport turns black while dragging (the marquee selection line is visible), and goes back to normal as soon as dragging stops (marquee selection line stops being visible).  
This is happening with VTK 9.0.0, Python 3.7.6, PyQt 5.9.2 and macOS 10.15.4.  
Have you guys experienced this?

Thanks!

---

<div class="post-metadata">

### Author: ![ken-martin](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ken-martin/32/884_2.png) [@ken-martin](https://discourse.vtk.org/u/ken-martin)
#### Post date: [June 10, 2020, 2:52pm UTC](https://discourse.vtk.org/t/vtk9-black-viewport-when-using-rubber-band-style/3515/2 "2020-06-10T14:52:55Z")

</div>

Could you test that on VTK master by any chance?

---

<div class="post-metadata">

### Author: ![panicbuttonvfx](https://discourse.vtk.org/user_avatar/discourse.vtk.org/panicbuttonvfx/32/1838_2.png) [@panicbuttonvfx](https://discourse.vtk.org/u/panicbuttonvfx)
#### Post date: [June 10, 2020, 4:34pm UTC](https://discourse.vtk.org/t/vtk9-black-viewport-when-using-rubber-band-style/3515/3 "2020-06-10T16:34:38Z")

</div>

I could give it a try. I haven’t built VTK before, do these instruction still apply for VTK 9?:  
[https://vtk.org/Wiki/VTK/Building/MacOSX](https://vtk.org/Wiki/VTK/Building/MacOSX)

---

<div class="post-metadata">

### Author: ![ken-martin](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ken-martin/32/884_2.png) [@ken-martin](https://discourse.vtk.org/u/ken-martin)
#### Post date: [June 10, 2020, 6:12pm UTC](https://discourse.vtk.org/t/vtk9-black-viewport-when-using-rubber-band-style/3515/4 "2020-06-10T18:12:28Z")

</div>

I think those are out of date. The Qt version is too old but I think the way to specify where Qt is has changed as well. I think you set Qt5\_DIR to something like for me C:/Qt/5.12.6/msvc2017\_64/lib/cmake/Qt5

---

<div class="post-metadata">

### Author: ![panicbuttonvfx](https://discourse.vtk.org/user_avatar/discourse.vtk.org/panicbuttonvfx/32/1838_2.png) [@panicbuttonvfx](https://discourse.vtk.org/u/panicbuttonvfx)
#### Post date: [June 14, 2020, 3:14pm UTC](https://discourse.vtk.org/t/vtk9-black-viewport-when-using-rubber-band-style/3515/5 "2020-06-14T15:14:51Z")

</div>

Apologies for the delay, life happened. I wasn’t able to build it (some gaps missing in my current setup and I don’t have the knowledge to figure it out in a reasonable amount of time). Is there any alternative?

Thanks!

---

<div class="post-metadata">

### Author: ![banesullivan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/banesullivan/32/7143_2.png) [@banesullivan](https://discourse.vtk.org/u/banesullivan)
#### Post date: [June 16, 2020, 2:36am UTC](https://discourse.vtk.org/t/vtk9-black-viewport-when-using-rubber-band-style/3515/6 "2020-06-16T02:36:22Z")

</div>

@panicbuttonvfx, you want to build a Python wheel, right? You can do that via:

```auto
cmake -GNinja -DVTK_BUILD_TESTING=OFF -DVTK_WHEEL_BUILD=ON -DVTK_PYTHON_VERSION=3 -DVTK_WRAP_PYTHON=ON ../vtk

```

then

```auto
ninja

```

which will generate a wheel for you to `pip` install

---

<div class="post-metadata">

### Author: ![panicbuttonvfx](https://discourse.vtk.org/user_avatar/discourse.vtk.org/panicbuttonvfx/32/1838_2.png) [@panicbuttonvfx](https://discourse.vtk.org/u/panicbuttonvfx)
#### Post date: [June 18, 2020, 9:25pm UTC](https://discourse.vtk.org/t/vtk9-black-viewport-when-using-rubber-band-style/3515/7 "2020-06-18T21:25:28Z")

</div>

Thanks Bane! I was able to build VTK in a different machine and I can confirm that the issue where the viewport goes black while dragging a selection area is not longer happening with the master branch (downloaded today).

I’ve noticed that performance was slower, but I’m not sure if it could be due to an error coming from pyvista that it was printing out in the console a bunch of times per second:

```
[06-18 14:20:16] p1765 {.../pyvista/utilities/errors.py:53} ERROR - Algorithm vtkSphericalHarmonics(0x7ff59b5e6c50) returned failure for request: vtkInformation (0x7ff59b5e7290)
2020-06-18 14:20:16.765 ( 192.926s) [76251A]vtkSphericalHarmonics.c:188 ERR| vtkSphericalHarmonics (0x7ff59b5e63a0): Only 2D images with RGB attributes are supported.
[06-18 14:20:16] p1765 {.../pyvista/utilities/errors.py:53} ERROR - Only 2D images with RGB attributes are supported.
2020-06-18 14:20:16.766 ( 192.926s) [76251A] vtkExecutive.cxx:753 ERR| vtkCompositeDataPipeline (0x7ff59e6045c0): Algorithm vtkSphericalHarmonics(0x7ff59b5e63a0) returned failure for request: vtkInformation (0x7ff59b5e60e0)
  Debug: Off
  Modified Time: 6357573
  Reference Count: 1
  Registered Events: (none)
  Request: REQUEST_DATA
  FROM_OUTPUT_PORT: 0
  ALGORITHM_AFTER_FORWARD: 1
  FORWARD_DIRECTION: 0
```

---

<div class="post-metadata">

### Author: ![panicbuttonvfx](https://discourse.vtk.org/user_avatar/discourse.vtk.org/panicbuttonvfx/32/1838_2.png) [@panicbuttonvfx](https://discourse.vtk.org/u/panicbuttonvfx)
#### Post date: [June 18, 2020, 9:34pm UTC](https://discourse.vtk.org/t/vtk9-black-viewport-when-using-rubber-band-style/3515/8 "2020-06-18T21:34:03Z")

</div>

Btw, is there a part in 9.0.0’s code that could be edited to achieve the same result? It would be a good temporary solution for me until I can upgrade to the next release.

Thanks!

---

<div class="post-metadata">

### Author: ![banesullivan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/banesullivan/32/7143_2.png) [@banesullivan](https://discourse.vtk.org/u/banesullivan)
#### Post date: [June 22, 2020, 2:33pm UTC](https://discourse.vtk.org/t/vtk9-black-viewport-when-using-rubber-band-style/3515/9 "2020-06-22T14:33:12Z")

</div>

@panicbuttonvfx, it’s tough to know where that error is coming from or what it means without the full context of the code you are running. If it is reproducible, do open an issue on PyVista’s GitHub repo with details

_edit_ it’s important to note that error isn’t coming from PyVista directly but from some VTK code you might be intermixing (? I don’t think PyVista uses the `vtkSphericalHarmonics` alg). PyVista simply has an error handler for VTK in PyVista that makes these kinds of errors messages a bit easier to work with, so that’s what your seeing from PyVista

---

<div class="post-metadata">

### Author: ![panicbuttonvfx](https://discourse.vtk.org/user_avatar/discourse.vtk.org/panicbuttonvfx/32/1838_2.png) [@panicbuttonvfx](https://discourse.vtk.org/u/panicbuttonvfx)
#### Post date: [June 23, 2020, 2:55am UTC](https://discourse.vtk.org/t/vtk9-black-viewport-when-using-rubber-band-style/3515/10 "2020-06-23T02:55:04Z")

</div>

Yes, the PyVista error is unrelated I believe. I just mentioned it because it’s an error that’s printing out a fair amount of times per second, and that could be what was causing the performance decrease I was noticing when selecting cells.
