# Running a script in the background? / VR black screen

**URL:** https://discourse.paraview.org/t/running-a-script-in-the-background-vr-black-screen/3412
**Category:** ParaView Support
**Created:** [January 27, 2020, 11:02am UTC](https://discourse.paraview.org/t/running-a-script-in-the-background-vr-black-screen/3412 "2020-01-27T11:02:34Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![AlexisTvrs](https://discourse.paraview.org/user_avatar/discourse.paraview.org/alexistvrs/32/2837_2.png) [@AlexisTvrs](https://discourse.paraview.org/u/AlexisTvrs)
#### Post date: [January 27, 2020, 11:02am UTC](https://discourse.paraview.org/t/running-a-script-in-the-background-vr-black-screen/3412/1 "2020-01-27T11:02:34Z")

</div>

Hello, we are a group of students currently working on a project using Paraview.  
To sum up, our project, constists in actively loading terrain data around a person which is in control of the camera. All of that using python scripts. But we currently are facing a couple of problems.

Problem 1: We can’t manage to make our program run as a “background” process. When running the script, no interaction with Paraview are possible.

Problem 2: When running the integrated VR of Paraview. The screen on which a view of what’s happening in VR shows the data sent through OpenGL. While the rest of the screen is completly black thus preventing us from using any tools.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [January 27, 2020, 11:20am UTC](https://discourse.paraview.org/t/running-a-script-in-the-background-vr-black-screen/3412/2 "2020-01-27T11:20:11Z")

</div>

1. Very classic issue, you will have to run your python program in another thread. See here : [https://docs.python.org/3/library/threading.html](https://docs.python.org/3/library/threading.html)

If you encounter issues with race condition our segfault with the paraview python interpreter, you will have to build ParaView and make sure VTK\_NO\_PYTHON\_THREADS is OFF and VTK\_PYTHON\_FULL\_THREADSAFE is ON.

1. VR has seen a lot of improvements lastly, you may want to try with the last nightly version of ParaView. [https://www.paraview.org/download/](https://www.paraview.org/download/)

---

<div class="post-metadata">

### Author: ![AlexisTvrs](https://discourse.paraview.org/user_avatar/discourse.paraview.org/alexistvrs/32/2837_2.png) [@AlexisTvrs](https://discourse.paraview.org/u/AlexisTvrs)
#### Post date: [January 27, 2020, 11:59am UTC](https://discourse.paraview.org/t/running-a-script-in-the-background-vr-black-screen/3412/3 "2020-01-27T11:59:57Z")

</div>

Thank you for replying so quickly. We will explore these options and update you on whether it worked out for us.

---

<div class="post-metadata">

### Author: ![wsherman](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/w/8797f3/32.png) [@wsherman](https://discourse.paraview.org/u/wsherman)
#### Post date: [January 28, 2020, 7:15pm UTC](https://discourse.paraview.org/t/running-a-script-in-the-background-vr-black-screen/3412/5 "2020-01-28T19:15:03Z")

</div>

I’m not the OP, but this topic interests me, so permit me to ask a “followup” question:

For the threaded python code: is there a recommended place for the code? I.e. since there  
are several places where one can add Python to ParaView – ProgrammableSource vs. LiveProgrammableSource  
vs. ProgrammableFilter vs. Python Shell vs. Macro vs. Animated Python script.

And regarding the improved VR interface, I know this isn’t the place, but since it’s mentioned:  
would it be possible to include the VR plugin in the pre-compiled MacOS version of ParaView 5.8?

```
Thanks,
Bill
```

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [January 29, 2020, 3:30am UTC](https://discourse.paraview.org/t/running-a-script-in-the-background-vr-black-screen/3412/6 "2020-01-29T03:30:43Z")

</div>

The location of this threaded python code depends on your usecase.

For the OP, I suppose it should be put in a script run from the python shell or in pvpython, as it looks like they want to run it client-side

For others, who wants to run it server-side, a programmable filter or a python plugin would be the right place.

There is no example for either of these usecases I’m afraid.

For you VR on MacOS question, I defer to @cory.quammen, @martink and @Michael .

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [January 29, 2020, 1:56pm UTC](https://discourse.paraview.org/t/running-a-script-in-the-background-vr-black-screen/3412/7 "2020-01-29T13:56:54Z")

</div>

> [@wsherman](#):
>
> And regarding the improved VR interface, I know this isn’t the place, but since it’s mentioned:  
> would it be possible to include the VR plugin in the pre-compiled MacOS version of ParaView 5.8?

We have a request for this here: [https://gitlab.kitware.com/paraview/paraview/issues/18704](https://gitlab.kitware.com/paraview/paraview/issues/18704)

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [January 29, 2020, 2:01pm UTC](https://discourse.paraview.org/t/running-a-script-in-the-background-vr-black-screen/3412/8 "2020-01-29T14:01:06Z")

</div>

If i’m not mistaken @wsherman or at least @sohayb_bahi is talking about the OpenVR plugin, not the VRPN plugin. I know, confusing 🙂

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [January 29, 2020, 2:05pm UTC](https://discourse.paraview.org/t/running-a-script-in-the-background-vr-black-screen/3412/9 "2020-01-29T14:05:54Z")

</div>

Maybe? I’m not aware of anyone who has compiled or run OpenVR on macOS, but if a headset can be drive from a Mac, seems like it should be possible.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [January 29, 2020, 2:07pm UTC](https://discourse.paraview.org/t/running-a-script-in-the-background-vr-black-screen/3412/10 "2020-01-29T14:07:11Z")

</div>

In any case, the VRPN plugin does not have an “Improved” interface in 5.8, contrary to the OpenVR plugin.

---

<div class="post-metadata">

### Author: ![wsherman](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/w/8797f3/32.png) [@wsherman](https://discourse.paraview.org/u/wsherman)
#### Post date: [January 29, 2020, 5:21pm UTC](https://discourse.paraview.org/t/running-a-script-in-the-background-vr-black-screen/3412/11 "2020-01-29T17:21:24Z")

</div>

> [@cory.quammen](#):
>
> Maybe? I’m not aware of anyone who has compiled or run OpenVR on macOS, but if a headset can be drive from a Mac, seems like it should be possible.

I thought perhaps Sebastian @jourdain and maybe Patrick @olearypatrick might have it running on MacOS since they both gave me (offline) advice on the purchase of an external graphics card for my MacBookPro.  
Bill

---

<div class="post-metadata">

### Author: ![wsherman](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/w/8797f3/32.png) [@wsherman](https://discourse.paraview.org/u/wsherman)
#### Post date: [January 29, 2020, 5:25pm UTC](https://discourse.paraview.org/t/running-a-script-in-the-background-vr-black-screen/3412/12 "2020-01-29T17:25:25Z")

</div>

> [@mwestphal](#):
>
> If i’m not mistaken @wsheman or at least @sohayb_bahi is talking about the OpenVR plugin, not the VRPN plugin. I know, confusing

So yes, in this case, I was referring to the OpenVR plugin to use with my Vive.

However! Just this morning in a group meeting, we got out an old Space Mouse to use with ParaView, and it doesn’t really interface well by default, so I also happen to have a need for a pre-compiled VRplugin plugin, so a +1 vote for that too – though I see the MR thread on that ended with a need/request for funding.  
Bill

(p.s. and unrelated, I just noticed that I mistyped my username when I created it!)

---

<div class="post-metadata">

### Author: ![jourdain](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jourdain/32/11_2.png) [@jourdain](https://discourse.paraview.org/u/jourdain)
#### Post date: [January 29, 2020, 5:51pm UTC](https://discourse.paraview.org/t/running-a-script-in-the-background-vr-black-screen/3412/13 "2020-01-29T17:51:05Z")

</div>

I haven’t tried it on ParaView proper, but ParaView Glance with Firefox is working for me with the Vive.

---

<div class="post-metadata">

### Author: ![wsherman](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/w/8797f3/32.png) [@wsherman](https://discourse.paraview.org/u/wsherman)
#### Post date: [February 3, 2020, 7:32pm UTC](https://discourse.paraview.org/t/running-a-script-in-the-background-vr-black-screen/3412/14 "2020-02-03T19:32:27Z")

</div>

> [@jourdain](#):
>
> raView proper, but ParaView Glance with Firefox is working for me with the Vive.

Is there anything that needs to be done to activate a Glance view for VR? E.g. Sketchfab has a little “View in VR” icon.

What steps do you use?

```
Thanks,
Bill

```

---

<div class="post-metadata">

### Author: ![sohayb\_bahi](https://discourse.paraview.org/user_avatar/discourse.paraview.org/sohayb_bahi/32/2846_2.png) [@sohayb\_bahi](https://discourse.paraview.org/u/sohayb_bahi)
#### Post date: [February 4, 2020, 1:59pm UTC](https://discourse.paraview.org/t/running-a-script-in-the-background-vr-black-screen/3412/15 "2020-02-04T13:59:32Z")

</div>

Yes i was speaking about OpenVR plugin
