Skip to content

autoplay in exported html? #404

Open
@nikhilmishra000

Description

@nikhilmishra000

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...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions