Skip to content

Move configure_pygui into a Scene method and remove manim.gui #4314

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chopan050
Copy link
Contributor

@chopan050 chopan050 commented Jun 27, 2025

Overview: What does this pull request change?

I took the manim.gui.gui.configure_pygui function, which is used in Scene.interactive_embed(), and transformed it into a Scene method. Since that function was the only thing in manim.gui, I deleted this module as well.

Motivation and Explanation: Why and how do your changes improve the library?

  • configure_pygui was only used by Scene.interactive_embed().
  • Its parameters were:
    • A renderer, although configure_pygui only accesses the scene referenced by the renderer, so why not just pass the scene itself instead...?
    • A sequence of widget configurations. Scene.interactive_embed() is the only code which calls configure_pygui and it passes the Scene.widgets to it, so, again, the reference to the scene is enough.
    • A bool.
  • Internally, configure_pygui also accesses the Scene.queue of actions to do during Scene.interact(). This Scene is the referenced by the passed renderer... so, again, just pass the scene instead.
  • It depends on whether dearpygui is imported, in which case dearpygui_import = True. Otherwise, dearpygui_import = False. This exact same thing also already happens in manim.scene.scene.

Because of the reasons above, I believe that this belongs better as a method of Scene. No need to pass a renderer (or scene), nor a list of widgets, because self is a Scene which already has the widgets attribute, as well as the queue.

Links to added or changed documentation pages

Further Information and Comments

Reviewer Checklist

  • The PR title is descriptive enough for the changelog, and the PR is labeled correctly
  • If applicable: newly added non-private functions and classes have a docstring including a short summary and a PARAMETERS section
  • If applicable: newly added functions and classes are tested

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

Successfully merging this pull request may close these issues.

1 participant