Porting Typing and new functionality from 3b1b/manim
Overview: What does this pull request change?
This pull requests ports all the new changes from 3b1b/manim and adds type hints to OpenGLMobject and OpenGLVmobject
Current annotations and state is pushed in https://github.com/MrDiver/manimlib Every method commented with #DONE is already in this PR
TODO:
- find out the difference between manimgl
arrange_in_gridand our version
changelog
OpenGLMobject
Additions:
init_constructor, __add__, __mul__, are_points_touching, is_touching, apply_over_attr_arrays, get_ancestors, insert_submobject, set_submobject, set_rgba_array, set_color_by_rgba_func, set_color_by_rgb_func, set_rgba_array_by_color, arrange_to_fit_dim, replicate
Renamed:
set_rgba_array -> set_rgba_array_by_color (added new set_rgba_array)
set_rgba_array_direct -> set_rgba_array
Removed/Depcrecated:
set_rgba_array_direct
Changes:
-
self.uniform.fixed_orientation_centeris now anp.ndarray -
__init__:- Now holds all initial
self.x = xassignments and the rest of the constructor which is useful to see is now ininit_constructor
- Now holds all initial
-
set_points:- Uses
asarrayinstead ofarrayto not unnecessarily copy arrays when not needed.
- Uses
-
add_updater:- now uses
self.update(dt=0)
- now uses
-
set_color:- now uses
set_rgba_array_by_colorinstead of setting color directly
- now uses
-
set_opacity:- now uses
set_rgba_array_by_color
- now uses
-
interpolate:- now treats all uniforms equally
-
fix_orientation:- creates a
np.ndarrayto setfixed_orientation_centerinstead of tuple
- creates a
Temporary changes:
-
check_data_alignment:- Does not directly work on
self.datainstead returns the new result directly to be used inget_resized_shader_data_array
- Does not directly work on
OpenGLVmobject
Additions:
-
@property:stroke_opacity,_stroke_opacity,@property:stroke_width,_stroke_width
Removed/Deprecated
Changes:
Temporary changes:
Shader
Additions:
Removed/Deprecated
Changes:
-
set_uniform:- now converts
np.ndarraytotuplefor easier outside usage to only need to convert on the last step when creating uniforms
- now converts
Temporary changes:
Color
Additions:
Removed/Deprecated
Changes:
-
rgb_to_hex:- always returns Uppercase version of Hex string for uniformity
Temporary changes:
Motivation and Explanation: Why and how do your changes improve the library?
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
Depends on
- #2837 after that we can continue with deepcopy and serialization
#3107 Will be continued here