# GLMakie \`recordframe!\` not working with \`MeshViz\`

**URL:** https://discourse.julialang.org/t/glmakie-recordframe-not-working-with-meshviz/86921
**Category:** Visualization
**Tags:** mesh, glmakie
**Created:** [September 8, 2022, 2:57am UTC](https://discourse.julialang.org/t/glmakie-recordframe-not-working-with-meshviz/86921 "2022-09-08T02:57:18Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![lucifer1004](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lucifer1004/32/22311_2.png) [@lucifer1004](https://discourse.julialang.org/u/lucifer1004)
#### Post date: [September 8, 2022, 2:57am UTC](https://discourse.julialang.org/t/glmakie-recordframe-not-working-with-meshviz/86921/1 "2022-09-08T02:57:18Z")

</div>

I implemented a [cloth-simulation](https://github.com/lucifer1004/cloth-simulation-julia) algorithm in Julia and visualized the results using `MeshViz` and `GLMakie`. The GUI worked fluently and here are some screenshots:

 ![Screenshot from 2022-09-08 10-54-17](https://global.discourse-cdn.com/julialang/original/3X/0/0/000ba436543f1b757d67c705bf46e8889ce8ccec.png)

 ![Screenshot from 2022-09-08 10-54-22](https://global.discourse-cdn.com/julialang/original/3X/3/5/352f9dc542b76cfdd7d9662188ce468e4aeb7ac4.png)

The problem is that I was unable to record a movie. The code is a bit long so I only share the [link](https://github.com/lucifer1004/cloth-simulation-julia/blob/main/mass_spring_3d.jl). A video file is generated but it only has the first frame and is not updated as the GUI window is.

---

<div class="post-metadata">

### Author: ![lucifer1004](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lucifer1004/32/22311_2.png) [@lucifer1004](https://discourse.julialang.org/u/lucifer1004)
#### Post date: [September 8, 2022, 8:57am UTC](https://discourse.julialang.org/t/glmakie-recordframe-not-working-with-meshviz/86921/2 "2022-09-08T08:57:15Z")

</div>

A minimal (non)-working example (adapted from [this example](https://makie.juliaplots.org/stable/documentation/animation/#animations_using_observables)):

```julia
using Meshes: Ball, Point3
using MeshViz: viz
using GLMakie: record, Observable, @lift

let
	
time = Observable(0.0)
ball = @lift Ball(rand(Point3), $time % 1.0 + 0.2)
fig = viz(ball; color=:blue)
framerate = 30
timestamps = range(0, 10, step=1/framerate)
record(fig, "time_animation.mp4", timestamps; framerate = framerate) do t
	time[] = t
end

end

```

In the recorded video, the size of the ball does not change with time.

---

<div class="post-metadata">

### Author: ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)
#### Post date: [September 8, 2022, 9:22am UTC](https://discourse.julialang.org/t/glmakie-recordframe-not-working-with-meshviz/86921/3 "2022-09-08T09:22:19Z")

</div>

But it does change in the display?

---

<div class="post-metadata">

### Author: ![lucifer1004](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lucifer1004/32/22311_2.png) [@lucifer1004](https://discourse.julialang.org/u/lucifer1004)
#### Post date: [September 8, 2022, 9:44am UTC](https://discourse.julialang.org/t/glmakie-recordframe-not-working-with-meshviz/86921/4 "2022-09-08T09:44:08Z")

</div>

In the first example (cloth simulation), the display changes via manual manipulation of the scene:

```julia
if !isnothing(plt[])
    delete!(scene, plt[])
end
plt[] = viz!(scene, mesh, color=1:length(indices))

```

In the second example, the display does not change. Seems that the `Observable` is not listened to.

---

<div class="post-metadata">

### Author: ![lucifer1004](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lucifer1004/32/22311_2.png) [@lucifer1004](https://discourse.julialang.org/u/lucifer1004)
#### Post date: [September 8, 2022, 10:27am UTC](https://discourse.julialang.org/t/glmakie-recordframe-not-working-with-meshviz/86921/5 "2022-09-08T10:27:14Z")

</div>

I think this is most probably an issue of `MeshViz`, and I have submitted an [issue](https://github.com/JuliaGeometry/MeshViz.jl/issues/32).

---

<div class="post-metadata">

### Author: ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)
#### Post date: [September 8, 2022, 11:00am UTC](https://discourse.julialang.org/t/glmakie-recordframe-not-working-with-meshviz/86921/6 "2022-09-08T11:00:27Z")

</div>

Hi @lucifer1004 , as I mentioned in the issue, it would be great if you could provide a MWE with just a slider instead of a record. If I can run the example locally and see the effects of the slider on the visualization, then I will be able to investigate it further.

---

<div class="post-metadata">

### Author: ![lucifer1004](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lucifer1004/32/22311_2.png) [@lucifer1004](https://discourse.julialang.org/u/lucifer1004)
#### Post date: [September 8, 2022, 11:15am UTC](https://discourse.julialang.org/t/glmakie-recordframe-not-working-with-meshviz/86921/7 "2022-09-08T11:15:46Z")

</div>

I have put an example in the issue thread.
