Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autoplay in exported html? #404

Open
nikhilmishra000 opened this issue Jul 21, 2023 · 0 comments
Open

autoplay in exported html? #404

nikhilmishra000 opened this issue Jul 21, 2023 · 0 comments

Comments

@nikhilmishra000
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant