-
Notifications
You must be signed in to change notification settings - Fork 2k
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
VGroup
can now be initialized with VMobject
iterables
#3966
VGroup
can now be initialized with VMobject
iterables
#3966
Conversation
@@ -24,6 +24,7 @@ | |||
from manim.constants import * | |||
from manim.mobject.mobject import Mobject | |||
from manim.mobject.opengl.opengl_compatibility import ConvertToOpenGL | |||
from manim.mobject.opengl.opengl_mobject import OpenGLMobject |
Check notice
Code scanning / CodeQL
Cyclic import Note
manim.mobject.opengl.opengl_mobject
VGroups
can now be initialized with iterables
VGroups
can now be initialized with iterablesVGroup
can now be initialized with iterables
VGroup
can now be initialized with iterablesVGroup
can now be initialized with VMobject
iterables
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, looks pretty good, thanks for the PR!
I left a few comments, but I think the one thing we need to add here is some
documentation. Maybe a small example like below is a good idea to add?
class VGroupParseIterablesExample(Scene):
def construct(self):
v = VGroup(
Square(),
[Circle(), Triangle()],
Dot(),
(Dot() for _ in range(2)),
)
v.arrange()
self.add(v)
Thanks for the example, I've added it plus some slight explanation to the Let me know if there's a better place to put it or if you need me to add more documentation! 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! One minor doc comment, and after that I'll merge this. Thanks for the PR :)
Thanks :) |
Thanks for all your feedback and help! |
Overview
Updates the add method within the VGroup class to allow it to accept iterables, including generators, and, as was the case before this PR, individual VMobject instances or a list of them. Tests have been added for both the Cairo renderer and OpenGL. Hence, implementation is compatible with OpenGL.
Closes #3540
Changelog
VGroup
can now be initialized withVMobject
iterables, such as generatorsReviewer Checklist