GLMakie `recordframe!` not working with `MeshViz`

I implemented a cloth-simulation algorithm in Julia and visualized the results using MeshViz and GLMakie. The GUI worked fluently and here are some screenshots:

The problem is that I was unable to record a movie. The code is a bit long so I only share the link. A video file is generated but it only has the first frame and is not updated as the GUI window is.

1 Like

A minimal (non)-working example (adapted from this example):

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

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


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

But it does change in the display?

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

if !isnothing(plt[])
    delete!(scene, plt[])
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.

I think this is most probably an issue of MeshViz, and I have submitted an issue.

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.

I have put an example in the issue thread.

1 Like