Comments (7)
Solved here
from animationswithmanim.
As I explained in video 8.2 you cannot apply two Animation's classes to the same object, you must do it either using methods, or create a function and apply it with ApplyFunction (you can see it in my documentation), or creating a specific updater function. It is not a bug.
class Test(Scene):
def construct(self):
text = Text("Manim Animation", font="Arial", stroke_width=0,fill_opacity=0)
def shift_and_fade(mob):
mob.shift(UP)
mob.set_fill(opacity=1)
return mob
self.play(
LaggedStart(
ApplyFunction(shift_and_fade,text)
)
)
self.wait()
from animationswithmanim.
You got me wrong. My code renders letter by letter. Your code creates different animation: the whole line appears at the same time. I mean suppose you have an AnimationGroup
with some lagged start animation. Is there a way to animate shifting at the same time with this letter by letter animation I didn't find it in your tutorials?
class test(Scene):
def construct(self):
text = Text("Manim Animation", font="Arial", stroke_width=0)
self.play(
LaggedStartMap(FadeIn, text),
)
from animationswithmanim.
Well in that case you can make use of what I tried to explain in those examples. You can do it in different ways:
class T1(Scene):
def construct(self):
text = Text("Manim Animation", font="Arial", stroke_width=0,fill_opacity=0)
def shift_and_fade(mob):
mob.shift(UP)
mob.set_fill(opacity=1)
return mob
self.play(
LaggedStart(*[ApplyFunction(shift_and_fade,t) for t in text])
)
self.wait()
class T2(Scene):
def construct(self):
text = Text("Manim Animation", font="Arial", stroke_width=0)
self.play(
LaggedStart(*[FadeInFromDown(t) for t in text])
)
self.wait()
class T3(Scene):
def construct(self):
text = Text("Manim Animation", font="Arial", stroke_width=0)
self.play(
LaggedStartMap(FadeInFromDown,text)
)
self.wait()
I recommend that you watch the videos "My projects" 1 and 2 for more examples of how to create your own animations like these.
from animationswithmanim.
Thanks, I understand all your examples. My question is a bit different. Is it possible to animate shifting of an AnimationGroup
? I mean this is the video from one of your examples:
class test(Scene):
def construct(self):
text = Text("Manim Animation", font="Arial", stroke_width=0)
anims = [FadeInFromPoint(obj, obj.get_center() * 1.4) for obj in text]
self.play(LaggedStart(*anims))
Can I shift the whole animation and get this video? Animate letter by letter with an AnimationGroup
and animate shifting of the whole line of text. Or any workaround if it's not possible?
It is useful when you already have some animation groups playing and you want to move them while they are still playing.
from animationswithmanim.
Sorry for the dalay, you can try somethink like this:
class Test(Scene):
def construct(self):
triangle = Triangle()
square = Square()
triangle.add_updater(lambda mob,dt: mob.shift(RIGHT*0.1))
anim1 = Write(triangle)
anim2 = Write(square)
self.add(triangle)
turn_animation_into_updater(anim1)
self.wait(0.4)
self.add(square)
turn_animation_into_updater(anim2)
self.wait(3)
from animationswithmanim.
Thank you! Unfortunately, updaters run forever. How can I apply smooth rate function to this triangle shifting to specific point (not shift forever) and change its run_time
?
from animationswithmanim.
Related Issues (20)
- Can't use TextMobject in CONFIG in latest version HOT 1
- SVGMobject makes svg images without colors and proper geometry. HOT 2
- Trying to randomize students creatures in TeacherStudentsScene but it shows same students every time when i render HOT 2
- FileNotFoundError: [Errno 2] No such file or directory 'example.py' HOT 2
- How to convert simple string to LaTeX string programmatically ? HOT 1
- Error,runting error
- Please help with that parametric surface HOT 2
- Hoping for a reply HOT 2
- RateFunctions in rate_functions_scenes.py:123 doesn't compile the names of rate functions that have underscoores HOT 1
- How can I draw curves in polar form. ex: r = 1 + 2cos(alpha). HOT 1
- Is it possible to place elements of a for in a VGroup? HOT 1
- How to animate python code using manim?
- ¿Error de renderizado?
- Positional arguments are missing (kwargs) HOT 1
- No me reconoce el comando "ffmpeg"
- Creature Malformation HOT 2
- Manim Installation Unsuccesfull "IndexError: list index out of range" HOT 2
- I can’t install requirements.txt, it founds an error with the mapbox_earcut. Could you help me?
- Function graphs to updaters
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from animationswithmanim.