Manim Tutorial Series E04: Updater Functions | Mathematical Animations WITH EASE

Sdílet
Vložit
  • čas přidán 5. 09. 2024

Komentáře • 69

  • @behackl
    @behackl  Před 2 lety +21

    Hey everyone! Apologies for mic issues in parts of the first half of the video (noise gate was configured too strictly and so the mic partially swallowed some of my words) -- the issue has been fixed for future recordings, but it was too late to fix anything this time. Sorry!
    I'm thinking of doing an episode on TeX and formula manipulation next, but haven't fully decided yet. Suggestions are very welcome!

    • @mathflipped
      @mathflipped Před 2 lety +6

      Formula manipulation is a great topic. I would also want to see a tutorial on ThreeDScene and 3D mobjects. I think the documentation is too scarce on these topics. Thank you for everything you do, Ben! It is highly appreciated.

    • @mathflipped
      @mathflipped Před 2 lety +4

      I also ran into the same issue in my first videos through OBS Studio, and it took me several trial-and-errors to find an appropriate setting for the noise gate.

    • @behackl
      @behackl  Před 2 lety +3

      Yeah, the noise gate issue annoyed me quite a bit because I just forgot to remove it after experimenting with it; my audio is actually perfectly fine without it. Oh well. 😪

  • @MATHalino1
    @MATHalino1 Před 2 lety +9

    Thank you very much for the thorough and in-depth explanations. Your work is highly appreciated. Each episode of this series is worth the wait. I am glad you explain the how and the why in every line of code.

  • @matthewjames7513
    @matthewjames7513 Před 2 lety +19

    Thank you for everything you're doing for manim :)

  • @PRAMODKUMAR-rk6wh
    @PRAMODKUMAR-rk6wh Před 2 lety +6

    Please sir kindly continue this series.
    Most of videos are outdated in youtube for learning the manim.
    Thanks for the latest videos.
    Very great explanation.

  • @zequanbear7301
    @zequanbear7301 Před 9 měsíci +2

    The best video course of Manim I had ever found, thanks for your contribution!

  • @mathflipped
    @mathflipped Před 2 lety +7

    Finally, the dreams come true! I've been waiting for thus episode for a long time.

  • @novakonstant
    @novakonstant Před rokem

    Hi Benjamin, I finished the series but I keep coming back to this video in particular. Many questions were cleared up with this one and it just shows how powerful the added properties of animations and trackers can be. Thank you for going the extra mile for the community! Cheers

  • @lizardgvng131
    @lizardgvng131 Před rokem

    I could not for the life of me understand why my code would work if I used an integer, but not when I used an iteration variable holding an integer. Then I watched 15:50 and everything made sense. You're the best!

  • @sergiujava
    @sergiujava Před rokem

    This is an extremely well done video on updater functions; it is an intimidating topic but you make it understandable. Well done and I hope you keep making these tutorials!

  • @osmanaydn4648
    @osmanaydn4648 Před 2 lety +1

    Thanks for your efforts. It is very helpful.

  • @nischalbhattarai2575
    @nischalbhattarai2575 Před 2 lety +1

    Thanks! This is very helpful content. I hope you will continue these videos about ThreeDScene and a bit of internal structure of manim like how to define custom mobjects and edit mobjects, rendering process and what's working on background.

  • @RaphaelAndrieux
    @RaphaelAndrieux Před rokem

    Hey man i don't know if you're gonna see this but i wanted to thank you for this series. I was always scared of learning manim but you showed me that it wasn't all that complicated.
    You clearly put a lot of efforts into this so i wanted to thank you !

    • @behackl
      @behackl  Před rokem

      Thanks for the kind words, glad I could help! :-)

  • @sarathram6505
    @sarathram6505 Před rokem

    your videos are really helping me to start working with manim. pls upload more

  • @Nathan-ff4ec
    @Nathan-ff4ec Před 2 lety

    Thank you so much for all this work you are doing!

  • @StarFury2
    @StarFury2 Před rokem

    @16:41 This weird thing about declaring a loop variable bothered me for a long time. Thanks a lot for your hints!

  • @galaxysplus2011
    @galaxysplus2011 Před 2 lety +3

    Hey Ben, a big thank you for these tutorials! They help a lot in understanding manim.
    One suggestion or plea: Could you increase the letter size of VSCode a little bit? - on the big computer screen it is no problem, but I often watch on the smartphone and then its kind of pain in the eye to read and follow the code.

    • @behackl
      @behackl  Před 2 lety +2

      I'll check for the next episode whether increasing the editor scale by one additional tick is feasible. Thanks for the feedback! :-)

    • @mathflipped
      @mathflipped Před 2 lety +1

      @@behackl Is it possible to apply a system-wide scaling in macs? You can then scale up temporarily while recording these videos to make the font larger.

  • @aramarakelyan5712
    @aramarakelyan5712 Před 2 lety +1

    Thank you very much for a wonderful tutorial 👍
    I started working with manim recently, and often I just need to experiment to understand what works and how. It's very funny of course, because manim is not obvious 😀
    Question:
    there is frequently a situation where time-based updates need to be removed depending on certain conditions. In some cases, this can be implemented using the update function itself, such as adding additional parameters and, under certain conditions, removing updates in the same function.
    If there are special methods in manim to implement things mentioned above, it would be very interesting to know about them 🙃
    I am looking forward to the next episode with great interest 💙

    • @behackl
      @behackl  Před 2 lety +1

      Thank you for the kind words! It is hard to give any specifics without knowing the exact nature of the problem you are trying to solve. In many cases, suspend_updating / resume_updating can help (and at least suspend_updating can be called from within the updater itself). Otherwise I'm not aware of any specific mechanism; maybe using a scene updater that takes care of suspending/resuming updating, or even adding/removing updaters for certain mobjects is an idea worth pursuing?

    • @aramarakelyan5712
      @aramarakelyan5712 Před 2 lety

      You answered my question, thank you for the answer!
      This question arises when I try to animate 'physical effects'. An example of such an effect can be a collision of two solid bodies, such as in 3b1b's 'blocks collision' video (although it is possible to issue of detecting collisions by calculating in advance where and when the next collision will be)
      czcams.com/video/HEfHFsfGXjs/video.html

  • @nawsailabang3361
    @nawsailabang3361 Před 2 lety

    Been waiting for ur videos!!!
    I wonder what the next episode would be about....😄

  • @greenote9788
    @greenote9788 Před 2 lety

    Thank you for this tutorial, this is very helpful !

  • @ashishawasthi4350
    @ashishawasthi4350 Před 2 měsíci

    thank u Sir.... 🙏🏻

  • @uwezimmermann5427
    @uwezimmermann5427 Před 2 lety

    Thanks for the explanations and examples!
    If I had listened more carefully at the beginning I would not have spent a couple of hours today with failing dt-updaters. I missed that dt is the time difference and not an accumulated runtime (as in other animation tools I know). Hence I though my code was not working because dt would not change from call to call.

    • @behackl
      @behackl  Před 2 lety +1

      Thanks for the kind words! The dt situation is indeed rather messy, I'd really like to improve that at some point. :-)

  • @samueleprandini1024
    @samueleprandini1024 Před rokem

    Hi Benjamin, I'm finding this serie of tutorial very interesting and I have a suggestion for you. Have you ever thought about making a manim's SoloLearn course? I think that it would be very appreciated and it could also help spreading this knowledge. I imagine a course made with the highlights of this serie and even if it isn't a encompassing archive, it could be a great starting point to show people the topic. It could also be used as a rapid high-level documentation to check when needed.

    I haven't already thanked you, so I'll tell you now: you made a great serie and I hope you'll continue to update it.

    • @behackl
      @behackl  Před rokem +1

      Thanks for the kind words and the suggestion! Never came into contact with SoloLearn before, I'll check it out -- but can't promise that I'll find the time to produce something outside of my channel / Manim's docs. :-)

  • @hampushederberg6554
    @hampushederberg6554 Před 10 měsíci +1

    Very interesting! I'm teaching courses in Mechanics: Dynamics and thus I'm trying to learn manim to further my students understanding of the subject. Very helpful videos. Just a question, how does the add_updater correspond to a method such as always_redraw? I have seen "always_redraw" together with the valuetracker to update the position of mobjects as well. Cheers!

    • @behackl
      @behackl  Před 9 měsíci +2

      Hey there, sorry for the slow reply! always_redraw simply calls add_updater on a mobject which recreates the specified mobject in every step and lets the base mobject turn into this recreated mobject.

    • @hampushederberg6554
      @hampushederberg6554 Před 9 měsíci +1

      @@behackl No worries, thank you for the answer!

  • @upendramaurya4304
    @upendramaurya4304 Před 2 lety

    Thanks for the video

  • @ianthehunter3532
    @ianthehunter3532 Před rokem +1

    Yo how do you add emoji 17:05? Unless it's not in Manim, but still how would you do it?

  • @wizardfix
    @wizardfix Před rokem

    Hi @Benjamin, many thanks for another great tutorial. Just wondering, you use the numpy methods, like `np.sin(x)` and `np.linalg.norm(p)`, rather than `math.sin(x)` and `math.hypot(*p)`. Any particular reason?

    • @behackl
      @behackl  Před rokem

      Thanks for the kind words! No particular reason in this instance. We've recently added support for vectorized functions for `Axes.plot` and such, for those it actually makes sense to use the NumPy-versions. 👍

  • @tarkesdora20
    @tarkesdora20 Před rokem

    Very nice tutorials. I am wondering what are the ways to know all the functions available. I suppose going through the manual is the only way to go.

    • @behackl
      @behackl  Před rokem

      The documentation -- or the source code of the library, depending on what you are more comfortable with -- would be my suggestions too. :-)

  • @AllThingsPhysicsYouTube

    Awesome video! Thanks so much for posting. I tried a simple example very similar to your rotating square and moving red dot example, and saw something a little odd. I had a circle that was shifting due to an updater. I waited for 5 seconds and then tried to fade out the circle while it was still moving. This seemed to work fine except that there seems to be an added frame that occurs just as the fade out begins. I also tried using animate.set_opacity(0) instead of using FadeOut and saw the same behavior. Is this a common behavior? I can't quite tell if the same thing is happening in your rotating square/red dot example.

    • @behackl
      @behackl  Před 2 lety

      Thanks for the kind words! I'm not entirely sure I understand what you mean; it would probably be better if you asked your question in our Discord; feel free to ping me as well! :-)

  • @ayooshkathuria4594
    @ayooshkathuria4594 Před rokem

    Am still not sure what the `dt` arg is supposed to do. In the example `AllUpdaterTypes`, I was playing around and removed the `self.wait(5)` line. This produced a static frame.
    However, when I changed the `sef.update_self(0)` to `self.update_self(1e5)` shouldn't it have frozen the animation since it's gonna wait 1e5 sec to apply the next bit of animation? I get the same results.
    I'm using ManimCE 0.16

  • @jamesbond_007
    @jamesbond_007 Před rokem

    I enjoy these videos about Manim; your presentation has been very clear. One thing about the value objects and updaters. I was kind of expecting the updater to be triggered based on changes to the actual value object value, much like other systems use a listener to listen for events being sent by some object (like their equivalent of a value object). But the updaters you showed didn't seem to be "registering" a listener -- there was no lexically apparent reference to the value object that the "set updater" method could see. So, I'm left to guess that the updaters are running all the time, and in so doing, will naturally pick up changes to the value object, but the updater is not "triggered" by changes to the value object in order to run. Can you please confirm for me if my guess is correct? Apologies for being a little fast & loose with the names here; hopefully you can divine my meaning.

    • @behackl
      @behackl  Před rokem

      Hey -- thanks for the kind words, much appreciated! You are very much correct: updaters are functions that are being passed either just the mobject they are attached to, or the mobject and the time difference since the updater was last called (usually the frame rate or 0 in some edge cases). Updaters attached to the mobjects added to the scene are executed every time a new frame is rendered.

    • @jamesbond_007
      @jamesbond_007 Před rokem

      @@behackl Thank you very much for clarifying (really, reenforcing this, since you already said it in the video) how this all works. It all makes sense now. I hope you do end up making a video (maybe you have already and I just haven't come across it yet) about TeX expressions -- what all is supported, etc. including what support for different fonts there is (I suspect it's a relatively limited finite set, and not "just load in an OTF or TTF and have your equations rendered in OCRA")

  • @knudsrensen2486
    @knudsrensen2486 Před 2 lety

    How does one update the arrowtip to scale with the length of the arrow ?

  • @mathsorcery
    @mathsorcery Před rokem

    A lot of objects in my animation are dependent on Value tracker "t".
    Is there a way I can avoid typing "t.get_value()" again and again?

    • @behackl
      @behackl  Před rokem

      Hey! Here is a simple idea, you do need to use a custom ValueTracker object for that though: gist.github.com/behackl/9af69131e43466c30a5c64810afd1ec4

  • @sinankuniyilathoot5188

    sir can you please tell how to animate text in a 3d scene without it being effected by camera motion,3b1b manim have attribute fix_in_frame for mobjects to do the same but manim community addition ,could you plase suggest some way to get over that?it would be very helpfull,by the way thank you for the tutorials

  • @shawon265
    @shawon265 Před 2 lety

    5:41 any *update* on the updater function? Is there any particular reason why it’s done this way instead of an argument named `dt`?

    • @behackl
      @behackl  Před 2 lety

      No change yet as of v0.16.0.post0. It is this way for historic reasons, Grant wrote it like that.

  • @Stas-bl4ud
    @Stas-bl4ud Před rokem

    I'm sorry, can you explain where mistake is here:
    BHC_angle = always_redraw(lambda: RightAngle(BH, AC, quadrant=(-1, 1)))
    I've got this: ValueError: The lines are parallel, there is no unique intersection point.
    But the almost same code works perfectly
    BH = always_redraw( lambda: Line(B.get_center(), H.get_center()))
    Explain me please where have I made mistake?
    Full code is here:
    from manim import *
    class Task(Scene):
    def construct(self):
    Polygon.set_default(color=RED)
    Dot.set_default(radius=.05)
    x = ValueTracker(1)
    A = Dot([-3, -2, 0])
    B = always_redraw(lambda: Dot([x.get_value(), 2, 0]))
    C = Dot([3, -2, 0])
    triangle = always_redraw(
    lambda: Polygon(A.get_center(), B.get_center(), C.get_center())
    )
    AC = Line(A.get_center(), C.get_center(), color=BLUE).scale(1.5)
    H = always_redraw(lambda: Dot([AC.get_projection(B.get_center())]))
    BH = always_redraw(
    lambda: Line(B.get_center(), H.get_center())
    )
    BHC_angle = always_redraw(
    lambda: RightAngle(BH, AC, quadrant=(-1, 1))
    )
    self.play(AnimationGroup(*[Create(ob) for ob in [
    A, B, C, triangle, H, BH, AC, BHC_angle
    ]], lag_ratio=0.2, run_time=3))
    self.play(x.animate.set_value(4), run_time=3)
    self.wait()

    • @behackl
      @behackl  Před rokem +1

      Hey! CZcams comments are not a great place to discuss code due to the weird formatting, please take a look at docs.manim.community/en/stable/faq/help.html and consider reposting your question in one of the places suggested there. It makes helping you much easier. Thanks! :-)

    • @Stas-bl4ud
      @Stas-bl4ud Před rokem

      @@behackl Thank you for help!

  • @garfieldgray6746
    @garfieldgray6746 Před rokem

    He, hope you're doing well, I was trying to run your code that i faced this weird error:
    "the ValueTracker object has no attribute 'get_value' "!!!

    • @behackl
      @behackl  Před rokem +1

      Hey! That sounds odd, don't see a reason for that. It would be easiest to debug this if you joined the Manim Community Discord at manim.community/discord and opened a new post in our help forum!

    • @garfieldgray6746
      @garfieldgray6746 Před rokem

      @@behackl yeah thanks:)

  • @theFire-nx6pd
    @theFire-nx6pd Před 2 lety

    Continue please

  • @aeuludag
    @aeuludag Před 2 lety

    How can I show a part of the function? Like there is a x -2 to 2 y -8 to 8 axis and I want to show x**2 but only when x goes from -2 to 1
    Sorry if this is poorly worded-

    • @behackl
      @behackl  Před 2 lety

      You can pass an x_range to the plot method, see docs.manim.community/en/stable/reference/manim.mobject.graphing.coordinate_systems.CoordinateSystem.html?highlight=plot#manim.mobject.graphing.coordinate_systems.CoordinateSystem.plot -- so ax.plot(f, x_range=(-2, 1)).

    • @aeuludag
      @aeuludag Před 2 lety

      @@behackl thank you! Do you plan doing a tutorial on using Tex, Text, LaTeX etc.?

    • @behackl
      @behackl  Před 2 lety +1

      @@aeuludag yes, at some point. There are plans to improve the implementations of Tex(t) which I'll likely wait for before producing a new episode.

  • @AxiomTutor
    @AxiomTutor Před rokem

  • @rubempacelli6815
    @rubempacelli6815 Před 2 lety

    Please! Make a comprehensive video about 3D animation! It is missing here so much!

    • @behackl
      @behackl  Před 2 lety

      I don't like the state of 3D in current Manim much, which is why I usually avoid it. Maybe at some point in the future if Manim's backend has been reworked substantially to do 3D stuff more efficiently. :-)

  • @febinjose4597
    @febinjose4597 Před 2 lety

    video is so good. but difficult to understand for me.