Have ability to order Mobjects on scene by animate method #2778
Replies: 2 comments
-
I am a bit confused by this issue. We currently already order Mobjects based on their How did you generate the gif above? This sort of fading effect would be nice, but even interpolating the Could you please make clear what this issue actually is about? |
Beta Was this translation helpful? Give feedback.
-
@behackl ty for reply!
Cool! I thought that it is not working attribute. I had to set objects in right order or use add_foreground_mobjects() method. When it was implemented?
This issue is about having ability to change order of scene mobjects by they z-index through animation. @behackl What about idea adding z_ordering.py file to animations folder? class ChangeZOrder(Animation):
def __init__(self, vmobject, lag_ratio=0.5, **kwargs):
# vmobject instantly changes its z-order.
# if lag_ratio = 0.5 it will be done in the middle of animation
# if lag_ratio = 0 it will be done right in start of animation and so on..
pass
class ChangingZOrder(Animation):
def __init__(self, vmobject, **kwargs):
# vmobject gradually changes its opacity relative to other objects on scene
# by the end of animation vmobject finally changes its z-order
pass What I wan't to achieve is to have ability to combine these animations with mob.animate.set_color() and mob.animate.set_opacity() animations. I submitted common issue about z-ordering in #670 and @leotrs suggested me how to solve my problem. But it is not as flexible as could be. |
Beta Was this translation helpful? Give feedback.
-
@kolibril13 had already mentioned some kind of that request in 3b1b's Manim here 3b1b/manim#852.
Sorry If duplicate. I didn't find it in ManimCE discussions.
Main idea
Have ability to:
It can be reached, for example, comparing mobjects z_indices. @kolibril13 thanks for image
Example of usage
What this code will do
Questions to discuss
On the go
I really look forward for this feature. Unfortunately, I'm not strong enough to change something in Scene class. If someone help me with this implementation and prompt me what to do I can do PR.
Beta Was this translation helpful? Give feedback.
All reactions