Skip to content
This repository was archived by the owner on Jul 27, 2023. It is now read-only.
This repository was archived by the owner on Jul 27, 2023. It is now read-only.

Interaction with Observables is not working #32

@lucifer1004

Description

@lucifer1004

The following code displays the window but the contents do not change, and the recorded video does not change, either.

time = GLMakie.Observable(0.0)
radius = GLMakie.@lift $time % 1.0 + 0.2
ball = GLMakie.@lift Meshes.Ball(rand(Meshes.Point3), $radius)
fig = MeshViz.viz(ball; color=GLMakie.@lift [:green, :blue, :red, :gray][Int(ceil($time * 11.2) % 4 + 1)])
framerate = 30
timestamps = range(0, 100, step=1/framerate)
GLMakie.display(fig)

GLMakie.record(fig, "time_animation.mp4", timestamps; framerate = framerate) do t
	time[] = t
end

In contrast, the following code works

time = GLMakie.Observable(0.0)

xs = range(0, 7, length=40)

ys_1 = GLMakie.@lift(sin.(xs .- $time))
ys_2 = GLMakie.@lift(cos.(xs .- $time) .+ 3)

fig = GLMakie.lines(xs, ys_1, color = :blue, linewidth = 4,
    axis = (title = GLMakie.@lift("t = $(round($time, digits = 1))"),))
GLMakie.scatter!(xs, ys_2, color = :red, markersize = 15)
	
framerate = 30
timestamps = range(0, 100, step=1/framerate)
GLMakie.display(fig)
	
GLMakie.record(fig, "time_animation.mp4", timestamps; framerate = framerate) do t
	time[] = t
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions