pythreejs icon indicating copy to clipboard operation
pythreejs copied to clipboard

autoplay in exported html?

Open nikhilmishra000 opened this issue 2 years ago • 0 comments

I have a scene that I'm saving to a static html page:

scene = pythreejs.Scene(...)
renderer = pythreejs.Renderer(scene=scene, ...)
clip = pythreejs.AnimationClip(tracks=...)
mixer = pythreejs.AnimationMixer(...)
action = pythreejs.AnimationAction(mixer, clip, scene)
page = ipywidgets.VBox([renderer, action])

ipywidgets.embed.embed_minimal_html(
    "export.html",
    views=page,
    title="Animation",
    state=ipywidgets.embed.dependency_state([page]),
)

and the buttons from the AnimationAction work as expected in the html page.

Is there way to construct the widgets such that the animation automatically plays (without needing to hit the play button)? I saw this issue about calling AnimationAction.play() inside a notebook, but that doesn't seem like it persists in the widget state that gets exported...

nikhilmishra000 avatar Jul 21 '23 18:07 nikhilmishra000