Skip to content

feat: add flag to disable rendering for mobjects#4649

Open
maejam wants to merge 1 commit intoManimCommunity:mainfrom
maejam:add-flag-to-disable-objects-rendering
Open

feat: add flag to disable rendering for mobjects#4649
maejam wants to merge 1 commit intoManimCommunity:mainfrom
maejam:add-flag-to-disable-objects-rendering

Conversation

@maejam
Copy link
Copy Markdown

@maejam maejam commented Mar 20, 2026

Similar to #2172 for cairo renderer.
Mobjects flagged with should_render=False will not be rendered.

Overview: What does this pull request change?

Any Mobject can be flagged with the boolean attribute should_render. When set to False, the Mobject will not be rendered.

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

It gives more flexibility for users to control Mobjects visibility. For instance, when a Mobject is added to a VGroup that is itself added to the scene, it has 2 consequences: the Mobject is transformed with the Group and is made visible with it. This PR makes it possible to separate those 2 consequences.
See https://discord.com/channels/1453870851807117363/1453897466884784333/threads/1481607827884605545 for an in-depth discussion.
It also adds consistency between the 2 renderers by mimicking the PR linked above.

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

Similar to ManimCommunity#2172 for cairo
renderer.
Mobjects flagged with `should_render=False` will not be rendered.
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

Successfully merging this pull request may close these issues.

1 participant