# Checking if the rendering was successful

**URL:** https://discourse.vtk.org/t/checking-if-the-rendering-was-successful/3999
**Category:** Support
**Created:** [August 17, 2020, 2:55pm UTC](https://discourse.vtk.org/t/checking-if-the-rendering-was-successful/3999 "2020-08-17T14:55:24Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![mykolav](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mykolav/32/2177_2.png) [@mykolav](https://discourse.vtk.org/u/mykolav)
#### Post date: [August 17, 2020, 2:55pm UTC](https://discourse.vtk.org/t/checking-if-the-rendering-was-successful/3999/1 "2020-08-17T14:55:24Z")

</div>

Hi, I’m trying to render a 3d volume. To catch error events I use ErrorObserver example.  
After the pipeline setup, I do ResetCamera() and Render(), but the return of the Render() function doesn’t guarantee that no errors will come after that:

> renderer-\>ResetCamera();  
> renderWindow-\>Render();  
> std::cout \<\< “we don’t know if the rendering was successful, the ErrorObserver could be called even after this point”;

My question is, how do I know if the rendering was successful?

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [August 17, 2020, 9:45pm UTC](https://discourse.vtk.org/t/checking-if-the-rendering-was-successful/3999/2 "2020-08-17T21:45:21Z")

</div>

Hello,

I think this was addressed before: [How to catch errors in VTK](https://discourse.vtk.org/t/how-to-catch-errors-in-vtk/1100/3)

See if that helps.

regards,

PC

---

<div class="post-metadata">

### Author: ![emmenlau](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/e/8c91f0/32.png) [@emmenlau](https://discourse.vtk.org/u/emmenlau)
#### Post date: [August 18, 2020, 7:34am UTC](https://discourse.vtk.org/t/checking-if-the-rendering-was-successful/3999/3 "2020-08-18T07:34:30Z")

</div>

Hi @Paulo_Carvalho !

I think the problem here is the opposite: How to detect if _no_ error happened. As @mykolav is saying, the observer will be called asynchronously when an error happened. But from the async call, its hard (or impossible) to know when no error happened. For example, we had an error from a large memory allocation that came _seconds_ later after the rendering method completed!

So its hard to say at which point in time the rending is finished and all errors should be delivered. We can start a timer and wait, but what is a “good” waiting time? Seconds? Minutes?

This is the question here: Is there a signal saying something like “The rendering is finished, if there was no error yet you can stop waiting for one”?

All the best, Mario

---

<div class="post-metadata">

### Author: ![flaviu2](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/f/74df32/32.png) [@flaviu2](https://discourse.vtk.org/u/flaviu2)
#### Post date: [August 18, 2020, 5:20pm UTC](https://discourse.vtk.org/t/checking-if-the-rendering-was-successful/3999/4 "2020-08-18T17:20:00Z")

</div>

> [@Paulo\_Carvalho](#):
>
> I think this was addressed before: [How to catch errors in VTK](https://discourse.vtk.org/t/how-to-catch-errors-in-vtk/1100/3)

I guess those links are not available anymore.

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [August 18, 2020, 10:09pm UTC](https://discourse.vtk.org/t/checking-if-the-rendering-was-successful/3999/5 "2020-08-18T22:09:08Z")

</div>

Well… if the callback wasn’t called, then there wasn’t any error… Like, if there is no smoke, there is no fire. Right?

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [August 18, 2020, 10:11pm UTC](https://discourse.vtk.org/t/checking-if-the-rendering-was-successful/3999/6 "2020-08-18T22:11:04Z")

</div>

I suggest you to google after the class names. It’s likely they have been moved elsewhere. It also helps the community if you report broken links in that topic.

---

<div class="post-metadata">

### Author: ![emmenlau](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/e/8c91f0/32.png) [@emmenlau](https://discourse.vtk.org/u/emmenlau)
#### Post date: [August 19, 2020, 7:48am UTC](https://discourse.vtk.org/t/checking-if-the-rendering-was-successful/3999/7 "2020-08-19T07:48:56Z")

</div>

> Well… if the callback wasn’t called, then there wasn’t any error… Like, if there is no smoke, there is no fire. Right?

No, thats exactly the problem! The rendering may already be in error. We just can’t smell the smoke yet.

For what we want to do, we must know if a rendering succeeded or not. But since we only get a signal on error, we can never be sure how long to wait.

Cutting a long story short, and getting back to the original question: Is there a way to know when the rendering is complete?

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [August 19, 2020, 1:30pm UTC](https://discourse.vtk.org/t/checking-if-the-rendering-was-successful/3999/8 "2020-08-19T13:30:14Z")

</div>

You can try `vtkRenderWindow::WaitForCompletion()`. I never tried it myself, though. Never needed it.
