Move configure_pygui
into a Scene
method and remove manim.gui
#4314
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview: What does this pull request change?
I took the
manim.gui.gui.configure_pygui
function, which is used inScene.interactive_embed()
, and transformed it into aScene
method. Since that function was the only thing inmanim.gui
, I deleted this module as well.Motivation and Explanation: Why and how do your changes improve the library?
configure_pygui
was only used byScene.interactive_embed()
.configure_pygui
only accesses the scene referenced by the renderer, so why not just pass the scene itself instead...?Scene.interactive_embed()
is the only code which callsconfigure_pygui
and it passes theScene.widgets
to it, so, again, the reference to the scene is enough.configure_pygui
also accesses theScene.queue
of actions to do duringScene.interact()
. ThisScene
is the referenced by the passed renderer... so, again, just pass the scene instead.dearpygui
is imported, in which casedearpygui_import = True
. Otherwise,dearpygui_import = False
. This exact same thing also already happens inmanim.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, becauseself
is aScene
which already has thewidgets
attribute, as well as thequeue
.Links to added or changed documentation pages
Further Information and Comments
Reviewer Checklist