in VShaderWrapper, allowing independent GLSL modifications for:
- stroke programs
- fill programs
- depth programs
Previously, `set_color_by_code()` relied on a single global
replacement mechanism. As a result:
- Multiple calls to `set_color_by_code()` would override each other.
- Applying different GLSL logic to stroke and fill was not possible.
- The last shader replacement always won.
This update solves that limitation by:
1. Storing shader code replacements per program type.
2. Applying replacements only to shaders matching the given program_type.
3. Preserving previously applied replacements for other program types.
4. Maintaining backward compatibility when program_type is None.
Now users can safely do:
set_color_by_code(..., program_type="stroke")
set_color_by_code(..., program_type="fill")
without one affecting the other.
This makes stroke and fill shader logic fully independent,
opening the door for:
- Different gradients for stroke and fill
- Custom sheen effects per layer
- Advanced shader experimentation
- Cleaner shader architecture
Backward compatibility:
If no program_type is provided, behavior falls back to the
original global replacement logic.
This improves flexibility without breaking existing scenes.
* Use preferred_creation_axis in TexturedSurface
* Add ComplexPlane.get_unit_size
* Enable up to 4 clip planes
* Add Mobject.clip_to_box
* Use tex "i" for complex numbers
- Set font_size_for_unit_height: 144 in config
- Calculate the relevant scaling factors for Text and Text using a rendered "0" as a reference, ensuring that a font size of 144 (or whatever is set) would give it a height of 1 in manim coordinates.
* Added a shortcut for remove_all_except() in scene_embed
* Added **kwargs argument to get_axis_label() and get_axis_labels() such that properties of the label like font size and t2c can be configured.
* Comments for set_color_by_rgba_func and set_color_by_rgb_func were ambiguous; clarified the comments.
* Changed the comment to remove the old description. The old description was valid up until pull request #2316.
* refactor(Line): move reset_points_around_ends from Arrow to Line
* fix(Line): make set_path_arc work for both Arrow and StrokeArrow
* refactor(Line): move set_perpendicular_to_camera from Arrow to Line
* typing: add missing Tuple import in Line.get_start_and_end
* fix(SceneState): clear updaters on restore_scene
Previously, restoring a scene checkpoint did not reset updaters.
This caused discrepancies when switching between checkpoints if
a mobject had updaters attached.
Now, restore_scene clears all updaters before restoring the mobject,
ensuring scene state consistency across checkpoints.
* Refactor restore_scene to use list comprehension
---------
Co-authored-by: Grant Sanderson <grant@3blue1brown.com>
The installation instructions suggested python=3.8, but manimgl depends on ipython>=8.18.0, which requires Python ≥3.9.
This PR updates the environment creation command to use Python 3.9 to avoid installation errors.
* Bug fix for TransformMatchingStrings with incompatible lengths
* Change faded line in NumberPlane initialization to be more explicit, and lower opacity
* Add option hide_zero_components_on_complex to DecimalNumber
* Validate syntax before reloading
* Add remembered stroke_config to TracedPath
* Add CLAUDE.md to gitignore
* Move pre-calculated traced points to TracingTail
* Fix interplay between time_span and alpha in Animation
* Clearer init for points in TracingTail
* Fix CoordinateSystem.get_area_under_graph
* Allow ComplexPlane.n2p to take in array of complex numbers
* Add put_start_on and put_end_on
* Add Slider
* Add \minus option for Tex to give shorter negative sign
* Put interp_by_hsl option in various color interpretation functions
* Swap priority of matched_keys vs key_map is TransformMatchingStrings
* Have z-index apply recursively
* Set self.svg_string property for SVGMobject
* Fix num_decimal_places config in Tex.make_number_changeable
* Add Surface. color_by_uv_function
* Add VMobject. set_color_by_proportion
* Add \mathcal to tex_to_symbol_count
* Allow option for BulletedList to be numbered
* ShowPartial should not be restricted to VMobject
* Add basic functionality for imported 3d geometries with texture
* Add interp_by_hsl option to Mobject.set_submobject_colors_by_gradient
* Update Clock class
* Add \circ to tex_to_symbol_count
* Bug fix for TransformMatchingStrings with incompatible lengths
* Change faded line in NumberPlane initialization to be more explicit, and lower opacity
* Add option hide_zero_components_on_complex to DecimalNumber
* Validate syntax before reloading
* Add remembered stroke_config to TracedPath
* Add CLAUDE.md to gitignore
* Move pre-calculated traced points to TracingTail
* Fix interplay between time_span and alpha in Animation
* Clearer init for points in TracingTail
* Fix CoordinateSystem.get_area_under_graph
* Allow ComplexPlane.n2p to take in array of complex numbers
* Add put_start_on and put_end_on
* Add Slider
* Add \minus option for Tex to give shorter negative sign
* Put interp_by_hsl option in various color interpretation functions
* Swap priority of matched_keys vs key_map is TransformMatchingStrings
* Have z-index apply recursively
* Set self.svg_string property for SVGMobject
* Fix num_decimal_places config in Tex.make_number_changeable
* Add Surface. color_by_uv_function
* Add VMobject. set_color_by_proportion
* Add \mathcal to tex_to_symbol_count
* added information for M1 Users
* Update README.md
Co-authored-by: Paweł Cisło <pyxelr@gmail.com>
---------
Co-authored-by: Paweł Cisło <pyxelr@gmail.com>
* created a method remove_all_except() in scene.py and interactive_scene.py
* Made it such that default mobject colors can be set through the yaml config file.
* * Default color initialisation wasn't working.
Changed conditional expression to `or` instead.
* Added default values to yaml file.
* added set_background_color() function to Scene class
* Changed default font back to Consolas
* Improve autocompletion for mobject.animate to show Mobject methods
- Added type hint `-> _AnimationBuilder | Self` to `Mobject.animate`, enabling autocompletion for `Mobject` methods after `mobject.animate`.
- Prioritized `typing_extensions.Self` over `typing.Self` in imports, so autocompletion of `Mobject` methods also works in Python < 3.11.
* Support `mobject.animate.` autocompletion in IPython
* Add docstring to `__dir__` and add return type hint
* improve docsting `__dir__` _AnimationBuilder
* Fix error when using VFadeIn and its subclasses
* add np.floating in type checking of Mobject.set_rgba_array_by_color and VMobject.set_stroke and removing the change in VFadeIn
* Only use -no-pdf for xelatex rendering
* Instead of tracking du and dv points on surface, track points off the surface in the normal direction
This means that surface shading will not necessarily work well for arbitrary transformations of the surface. But the existing solution was flimsy anyway, and caused annoying issues with singularity points.
* Have density of anchor points on arcs depend on arc length
* Allow for specifying true normals and orientation of Sphere
* Change miter threshold on stroke shader
* Add get_start_and_end to DashedLine
* Add min_total_width option to DecimalNumber
* Have BackgroundRectangle.set_style absorb (and ignore) added configuration
Note, this feels suboptimal
* Add LineBrace
* Update font_size adjustment in Tex
* Add scale_factor parameter to BulletedList.fade_all_but
* Minor import tweaks
* Add play_sound
* Small if -> elif update
* Always use Group for FadeTransform
* Use time_spanned_alpha in ChangingDecimal
* Change priority of number_config vs. self.decimal_number_config in NumberLine init
* Fix clock animation
* Allow sample_coords to be passed into VectorField
* Only use -no-pdf for xelatex rendering
* Instead of tracking du and dv points on surface, track points off the surface in the normal direction
This means that surface shading will not necessarily work well for arbitrary transformations of the surface. But the existing solution was flimsy anyway, and caused annoying issues with singularity points.
* Have density of anchor points on arcs depend on arc length
* Allow for specifying true normals and orientation of Sphere
* Change miter threshold on stroke shader
* Add get_start_and_end to DashedLine
* Add min_total_width option to DecimalNumber
* Have BackgroundRectangle.set_style absorb (and ignore) added configuration
Note, this feels suboptimal
* Add LineBrace
* Update font_size adjustment in Tex
* Add scale_factor parameter to BulletedList.fade_all_but
* Minor import tweaks
* Add play_sound
* Only use -no-pdf for xelatex rendering
* Instead of tracking du and dv points on surface, track points off the surface in the normal direction
This means that surface shading will not necessarily work well for arbitrary transformations of the surface. But the existing solution was flimsy anyway, and caused annoying issues with singularity points.
* Have density of anchor points on arcs depend on arc length
* Allow for specifying true normals and orientation of Sphere
* Change miter threshold on stroke shader
* Add get_start_and_end to DashedLine
* Add min_total_width option to DecimalNumber
* Have BackgroundRectangle.set_style absorb (and ignore) added configuration
Note, this feels suboptimal
* Add LineBrace
* Update font_size adjustment in Tex