# Best way of visualizing exported animated scenes

**URL:** <https://discourse.paraview.org/t/best-way-of-visualizing-exported-animated-scenes/9731>\
**Category:** ParaView Support\
**Tags:** vtkjs\
**Created:** [June 3, 2022, 11:16am UTC](https://discourse.paraview.org/t/best-way-of-visualizing-exported-animated-scenes/9731 "2022-06-03T11:16:19Z")\
**Posts on this page:** 20\
**Page:** 2

<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:** [June 8, 2022, 4:17pm UTC](https://discourse.paraview.org/t/best-way-of-visualizing-exported-animated-scenes/9731/21 "2022-06-08T16:17:20Z")

</div>

@Xabier_Morales_Ferez would it be possible to share your vtkjs animation file, or is it private?

---

<div class="post-metadata">

**Author:** ![Xabier\_Morales\_Ferez](https://discourse.paraview.org/user_avatar/discourse.paraview.org/xabier_morales_ferez/32/2890_2.png) [@Xabier\_Morales\_Ferez](https://discourse.paraview.org/u/Xabier_Morales_Ferez)\
**Post date:** [June 8, 2022, 4:35pm UTC](https://discourse.paraview.org/t/best-way-of-visualizing-exported-animated-scenes/9731/22 "2022-06-08T16:35:13Z")

</div>

Thanks! So in order to visualize the animation continuously from another point of view, the only option right now is saving the .vtkjs file from that specific camera angle correct?

---

<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:** [June 8, 2022, 4:38pm UTC](https://discourse.paraview.org/t/best-way-of-visualizing-exported-animated-scenes/9731/23 "2022-06-08T16:38:53Z")

</div>

Basically having the camera updating during your animation within ParaView. My guess is that you can clean the vtkjs file and remove the camera parameters so that it does not look like the camera get reset.

---

<div class="post-metadata">

**Author:** ![Xabier\_Morales\_Ferez](https://discourse.paraview.org/user_avatar/discourse.paraview.org/xabier_morales_ferez/32/2890_2.png) [@Xabier\_Morales\_Ferez](https://discourse.paraview.org/u/Xabier_Morales_Ferez)\
**Post date:** [June 8, 2022, 7:07pm UTC](https://discourse.paraview.org/t/best-way-of-visualizing-exported-animated-scenes/9731/24 "2022-06-08T19:07:00Z")

</div>

Unfortunately, I believe I cannot share the original .vtkjs as it includes the patient geometry. However, I have created an equivalent .vtkjs from synthetic data, I hope it is still useful. [I share it as a drive link](https://drive.google.com/file/d/1EEP5CsZyvRfvPlEizhDnq90H3MVpMOIs/view?usp=sharing) as I had issues uploading it directly to this discussion.

On the other hand, I don’t know if I fully understand what you mean by cleaning the .vtkjs file.

---

<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:** [June 9, 2022, 1:37pm UTC](https://discourse.paraview.org/t/best-way-of-visualizing-exported-animated-scenes/9731/25 "2022-06-09T13:37:14Z")

</div>

Thanks for sharing your data and that is indeed what I think. So if you unzip the vtkjs file (rename + unzip) you will find an index.json at the root of the package.

The screenshot below was taken from your dataset and if you go into the animation structure, you can for each timeSteps either remove or empty the camera entry.

 ![Screen Shot 2022-06-09 at 7.33.56 AM](https://discourse.paraview.org/uploads/default/original/2X/1/1abc13f9aca5e4f6c35e240172fb520bf0e5ab06.png)

HTH,

Seb

Modified version: [index.json.zip](https://discourse.paraview.org/uploads/short-url/fVWyxkeL4ad0BvuA0FyShrjSMjb.zip) (402.2 KB)

---

<div class="post-metadata">

**Author:** ![Xabier\_Morales\_Ferez](https://discourse.paraview.org/user_avatar/discourse.paraview.org/xabier_morales_ferez/32/2890_2.png) [@Xabier\_Morales\_Ferez](https://discourse.paraview.org/u/Xabier_Morales_Ferez)\
**Post date:** [June 9, 2022, 3:47pm UTC](https://discourse.paraview.org/t/best-way-of-visualizing-exported-animated-scenes/9731/26 "2022-06-09T15:47:36Z")

</div>

Ok, I have slightly modified the vtkjs\_helper.py file to erase all camera data before saving the root index.json file. Now it works like a charm. Thanks to everyone involved in this thread! Here’s the updated file in case anyone else is interested.

[vtkjs\_helper.py](https://discourse.paraview.org/uploads/short-url/bjXkjH0XdJYm9hm1Us5NDsLgnbY.py) (10.7 KB)

Finally, I just wanted to ask how I can best contribute to fixing the bug involving the root index.json ordering and closing. I have limited experience contributing to such large projects, so should I report the bug or shall I attempt a merge request with my updated code?

---

<div class="post-metadata">

**Author:** ![Julien\_Finet](https://discourse.paraview.org/user_avatar/discourse.paraview.org/julien_finet/32/9321_2.png) [@Julien\_Finet](https://discourse.paraview.org/u/Julien_Finet)\
**Post date:** [June 9, 2022, 4:10pm UTC](https://discourse.paraview.org/t/best-way-of-visualizing-exported-animated-scenes/9731/27 "2022-06-09T16:10:08Z")

</div>

This is great to hear.

Yes, please create a merge request directly (flagging this discourse discussion is enough).

---

<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:** [June 9, 2022, 5:06pm UTC](https://discourse.paraview.org/t/best-way-of-visualizing-exported-animated-scenes/9731/28 "2022-06-09T17:06:27Z")

</div>

I’m making [an MR](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/9260) for you but why did you do that change?

```auto
+ #objNameToUrls.GetUrlName(currentObjName), str(timeStep).zfill(3), "index.json"
                 objNameToUrls.GetUrlName(currentObjName), str(timeStep), "index.json"

```

That part I think was to get the timesteps in proper order. Was 3 too small?

---

<div class="post-metadata">

**Author:** ![Xabier\_Morales\_Ferez](https://discourse.paraview.org/user_avatar/discourse.paraview.org/xabier_morales_ferez/32/2890_2.png) [@Xabier\_Morales\_Ferez](https://discourse.paraview.org/u/Xabier_Morales_Ferez)\
**Post date:** [June 9, 2022, 5:16pm UTC](https://discourse.paraview.org/t/best-way-of-visualizing-exported-animated-scenes/9731/29 "2022-06-09T17:16:23Z")

</div>

At first, I tried ordering the folders by adding extra digits. But I was not sure in which part of the code the folders were actually named so I realized it was much simpler to just use natural ordering for the folders (the functions I added on the top). It seems that I forgot to delete the previous failed approach.

---

<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:** [June 9, 2022, 5:17pm UTC](https://discourse.paraview.org/t/best-way-of-visualizing-exported-animated-scenes/9731/30 "2022-06-09T17:17:36Z")

</div>

Great, sorry I miss read my diff. 😉

---

<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:** [June 9, 2022, 5:20pm UTC](https://discourse.paraview.org/t/best-way-of-visualizing-exported-animated-scenes/9731/31 "2022-06-09T17:20:02Z")

</div>

If you agree with that change on my MR, I can merge it. Down the road we would need an option on PV to toggle `remove_camera_animation` flag.

@Julien_Finet do you think someone on your team could tackle it once that VTK get picked up by PV?

---

<div class="post-metadata">

**Author:** ![Julien\_Finet](https://discourse.paraview.org/user_avatar/discourse.paraview.org/julien_finet/32/9321_2.png) [@Julien\_Finet](https://discourse.paraview.org/u/Julien_Finet)\
**Post date:** [June 9, 2022, 10:13pm UTC](https://discourse.paraview.org/t/best-way-of-visualizing-exported-animated-scenes/9731/32 "2022-06-09T22:13:27Z")

</div>

It’s doable indeed.

---

<div class="post-metadata">

**Author:** ![Xabier\_Morales\_Ferez](https://discourse.paraview.org/user_avatar/discourse.paraview.org/xabier_morales_ferez/32/2890_2.png) [@Xabier\_Morales\_Ferez](https://discourse.paraview.org/u/Xabier_Morales_Ferez)\
**Post date:** [June 10, 2022, 7:56am UTC](https://discourse.paraview.org/t/best-way-of-visualizing-exported-animated-scenes/9731/33 "2022-06-10T07:56:56Z")

</div>

Sorry to bother you again. I was trying to export some vorticity-related volumetric animations alongside the pathlines and I keep getting this error.

```auto
Generic Warning: In C:\glr\builds\paraview\paraview-ci\build\superbuild\paraview\src\Remoting\Animation\vtkSMAnimationSceneWebWriter.cxx, line 216
Failed to bundle vtkjs file

Traceback (most recent call last):
  File "C:\Program Files\ParaView 5.10.0-RC2-Windows-Python3.9-msvc2017-AMD64\bin\Lib\site-packages\vtkmodules\web\vtkjs_helper.py", line 197, in zipAllTimeSteps
    addDirectoryToZip(
  File "C:\Program Files\ParaView 5.10.0-RC2-Windows-Python3.9-msvc2017-AMD64\bin\Lib\site-packages\vtkmodules\web\vtkjs_helper.py", line 118, in addDirectoryToZip
    rootTimeStepSection[objName]["actor"] = obj["actor"]
KeyError: 'actor'
debug: In unknown, line 0
debug: Save animated scene failed!

```

In principle it should be possible to export volumetric renderings, right?

---

<div class="post-metadata">

**Author:** ![Julien\_Finet](https://discourse.paraview.org/user_avatar/discourse.paraview.org/julien_finet/32/9321_2.png) [@Julien\_Finet](https://discourse.paraview.org/u/Julien_Finet)\
**Post date:** [June 10, 2022, 11:07am UTC](https://discourse.paraview.org/t/best-way-of-visualizing-exported-animated-scenes/9731/34 "2022-06-10T11:07:31Z")

</div>

Indeed, it should be possible.  
You might have to debug what’s going on. Maybe print out `obj` to see what’s available in it.

---

<div class="post-metadata">

**Author:** ![Xabier\_Morales\_Ferez](https://discourse.paraview.org/user_avatar/discourse.paraview.org/xabier_morales_ferez/32/2890_2.png) [@Xabier\_Morales\_Ferez](https://discourse.paraview.org/u/Xabier_Morales_Ferez)\
**Post date:** [June 10, 2022, 2:01pm UTC](https://discourse.paraview.org/t/best-way-of-visualizing-exported-animated-scenes/9731/35 "2022-06-10T14:01:29Z")

</div>

Ok, it seems that `vtkjs_helper` expects the key `"actor"` but in the volume rendering `index.json` it says `"volume"` instead. Is it as easy as changing the key from `"volume"` to `"actor"` in each `index.json` file?

 ![image](https://discourse.paraview.org/uploads/default/original/2X/9/92ae6ebd0d74ce33c8b5cbf2a9c007c2d482dd9d.png)  
 ![image](https://discourse.paraview.org/uploads/default/original/2X/3/31731001637716a71bc7ed858d6dbab8143bab35.png)

---

<div class="post-metadata">

**Author:** ![Julien\_Finet](https://discourse.paraview.org/user_avatar/discourse.paraview.org/julien_finet/32/9321_2.png) [@Julien\_Finet](https://discourse.paraview.org/u/Julien_Finet)\
**Post date:** [June 10, 2022, 4:07pm UTC](https://discourse.paraview.org/t/best-way-of-visualizing-exported-animated-scenes/9731/36 "2022-06-10T16:07:45Z")

</div>

@Adrien_Boucaud

---

<div class="post-metadata">

**Author:** ![Xabier\_Morales\_Ferez](https://discourse.paraview.org/user_avatar/discourse.paraview.org/xabier_morales_ferez/32/2890_2.png) [@Xabier\_Morales\_Ferez](https://discourse.paraview.org/u/Xabier_Morales_Ferez)\
**Post date:** [June 10, 2022, 4:41pm UTC](https://discourse.paraview.org/t/best-way-of-visualizing-exported-animated-scenes/9731/37 "2022-06-10T16:41:41Z")

</div>

I tried changing it but I’m getting some bizarre results in Glance.

 ![image](https://discourse.paraview.org/uploads/default/original/2X/d/ddbd36433ea2fbcb8c78c0c327434a3040a04bc2.png)

It also seems that is not properly saving the point data such as the velocity. They are nowhere to be found on the index.json.

[index.zip](https://discourse.paraview.org/uploads/short-url/bftRgbwLafhssmeTaFAcchxvdn0.zip) (428.5 KB)

---

<div class="post-metadata">

**Author:** ![Adrien\_Boucaud](https://discourse.paraview.org/user_avatar/discourse.paraview.org/adrien_boucaud/32/3580_2.png) [@Adrien\_Boucaud](https://discourse.paraview.org/u/Adrien_Boucaud)\
**Post date:** [June 10, 2022, 4:50pm UTC](https://discourse.paraview.org/t/best-way-of-visualizing-exported-animated-scenes/9731/38 "2022-06-10T16:50:56Z")

</div>

Hello @Xabier_Morales_Ferez ,

Can you try replacing this section in the helper:

```auto
rootTimeStepSection[objName]["actor"] = obj["actor"]

```

with something similar to this:

```auto
if obj["actor"]:
  rootTimeStepSection[objName]["actor"] = obj["actor"]
if obj["volume"]:
  rootTimeStepSection[objName]["volume"] = obj["volume"]

```

Though I remember testing animated volume exports (with animated pwf) and having it work, so I’m not certain that this is the fix.

---

<div class="post-metadata">

**Author:** ![Xabier\_Morales\_Ferez](https://discourse.paraview.org/user_avatar/discourse.paraview.org/xabier_morales_ferez/32/2890_2.png) [@Xabier\_Morales\_Ferez](https://discourse.paraview.org/u/Xabier_Morales_Ferez)\
**Post date:** [June 10, 2022, 4:56pm UTC](https://discourse.paraview.org/t/best-way-of-visualizing-exported-animated-scenes/9731/39 "2022-06-10T16:56:36Z")

</div>

Hi @Adrien_Boucaud !

This is basically what I tried and I got the results I show above.

```auto
try:
    rootTimeStepSection[objName]["actor"] = obj["actor"]
    rootTimeStepSection[objName]["actorRotation"] = obj["actorRotation"]
except:
    rootTimeStepSection[objName]["volume"] = obj["volume"]
    rootTimeStepSection[objName]["volumeRotation"] = obj["volumeRotation"]

```

I think there must be something else wrong as the point data is not present in the root index.json.

---

<div class="post-metadata">

**Author:** ![Adrien\_Boucaud](https://discourse.paraview.org/user_avatar/discourse.paraview.org/adrien_boucaud/32/3580_2.png) [@Adrien\_Boucaud](https://discourse.paraview.org/u/Adrien_Boucaud)\
**Post date:** [June 10, 2022, 5:07pm UTC](https://discourse.paraview.org/t/best-way-of-visualizing-exported-animated-scenes/9731/40 "2022-06-10T17:07:50Z")

</div>

Can you share the contents of the “volume” JSON object ?

[Previous page](https://discourse.paraview.org/t/best-way-of-visualizing-exported-animated-scenes/9731.md?page=1)

[Next page](https://discourse.paraview.org/t/best-way-of-visualizing-exported-animated-scenes/9731.md?page=3)
